mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3/concurrency: fix rev comparison on concurrent key deletion
This commit is contained in:
parent
94eec5d41a
commit
acec15ebc6
@ -249,11 +249,10 @@ func (s *stmReadCommitted) commit() *v3.TxnResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isKeyCurrent(k string, r *v3.GetResponse) v3.Cmp {
|
func isKeyCurrent(k string, r *v3.GetResponse) v3.Cmp {
|
||||||
rev := r.Header.Revision + 1
|
|
||||||
if len(r.Kvs) != 0 {
|
if len(r.Kvs) != 0 {
|
||||||
rev = r.Kvs[0].ModRevision + 1
|
return v3.Compare(v3.ModRevision(k), "=", r.Kvs[0].ModRevision)
|
||||||
}
|
}
|
||||||
return v3.Compare(v3.ModRevision(k), "<", rev)
|
return v3.Compare(v3.ModRevision(k), "=", 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func respToValue(resp *v3.GetResponse) string {
|
func respToValue(resp *v3.GetResponse) string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user