diff --git a/zketcd.go b/zketcd.go index e60b594..d396ac9 100644 --- a/zketcd.go +++ b/zketcd.go @@ -213,13 +213,15 @@ func (z *zkEtcd) mkDeleteTxnOp(op *DeleteRequest) opBundle { } } - crev := s.Rev(mkPathCVer(p)) + // Force CVer into read-set to catch any conflicting update + // which would invalidate emptiness check. + s.Rev(mkPathCVer(p)) + // Check if directory has any children. gresp, gerr := z.c.Get(z.c.Ctx(), getListPfx(p), // TODO: monotonic revisions from serializable // etcd.WithSerializable(), etcd.WithPrefix(), etcd.WithCountOnly(), - etcd.WithRev(crev), etcd.WithLimit(1)) if gerr != nil { return gerr