mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
mvcc: revert change made by 10526
Revert #10526 and its followup #10699.
This commit is contained in:
parent
a7568d63a7
commit
4345f74426
@ -91,11 +91,10 @@ func (ti *treeIndex) keyIndex(keyi *keyIndex) *keyIndex {
|
|||||||
func (ti *treeIndex) visit(key, end []byte, f func(ki *keyIndex)) {
|
func (ti *treeIndex) visit(key, end []byte, f func(ki *keyIndex)) {
|
||||||
keyi, endi := &keyIndex{key: key}, &keyIndex{key: end}
|
keyi, endi := &keyIndex{key: key}, &keyIndex{key: end}
|
||||||
|
|
||||||
ti.Lock()
|
ti.RLock()
|
||||||
clone := ti.tree.Clone()
|
defer ti.RUnlock()
|
||||||
ti.Unlock()
|
|
||||||
|
|
||||||
clone.AscendGreaterOrEqual(keyi, func(item btree.Item) bool {
|
ti.tree.AscendGreaterOrEqual(keyi, func(item btree.Item) bool {
|
||||||
if len(endi.key) > 0 && !item.Less(endi) {
|
if len(endi.key) > 0 && !item.Less(endi) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user