diff --git a/clientv3/concurrency/election.go b/clientv3/concurrency/election.go index f14cd55e369..8fbb003c087 100644 --- a/clientv3/concurrency/election.go +++ b/clientv3/concurrency/election.go @@ -70,7 +70,7 @@ func (e *Election) Campaign(ctx context.Context, val string) error { } } - err = waitDeletes(ctx, client, e.keyPrefix, v3.WithPrefix(), v3.WithRev(e.leaderRev-1)) + err = waitDeletes(ctx, client, e.keyPrefix+"/", v3.WithPrefix(), v3.WithRev(e.leaderRev-1)) if err != nil { // clean up in case of context cancel select { diff --git a/clientv3/concurrency/mutex.go b/clientv3/concurrency/mutex.go index 298d7636b8b..3bf89fc1048 100644 --- a/clientv3/concurrency/mutex.go +++ b/clientv3/concurrency/mutex.go @@ -57,7 +57,7 @@ func (m *Mutex) Lock(ctx context.Context) error { } // wait for deletion revisions prior to myKey - err = waitDeletes(ctx, client, m.pfx, v3.WithPrefix(), v3.WithRev(m.myRev-1)) + err = waitDeletes(ctx, client, m.pfx+"/", v3.WithPrefix(), v3.WithRev(m.myRev-1)) // release lock key if cancelled select { case <-ctx.Done():