etcd icon indicating copy to clipboard operation
etcd copied to clipboard

Why is the check within func Mutex.Lock() needed after Txn committing?

Open ch0ngsheng opened this issue 2 years ago • 1 comments

https://github.com/etcd-io/etcd/blob/be2929568f81080b20ef6812992f2e09c8dac91b/client/v3/concurrency/mutex.go#L78

After Txn is commited, getOwner should return exactly one KV and len(ownerKey)should equals to 1. Because if cmp is true, we will put one into it within the same txn.

So, in which case we will have len(ownerKey) equals to 0?

The relevant PR is https://github.com/etcd-io/etcd/pull/8107

ch0ngsheng avatar Mar 28 '22 07:03 ch0ngsheng

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 10 '22 13:07 stale[bot]