mvcc: revert change made by 10526
Revert and its followup
@@ -91,11 +91,10 @@ func (ti *treeIndex) keyIndex(keyi *keyIndex) *keyIndex {
func (ti *treeIndex) visit(key, end []byte, f func(ki *keyIndex)) {
keyi, endi := &keyIndex{key: key}, &keyIndex{key: end}
- ti.Lock()
- clone := ti.tree.Clone()
- ti.Unlock()
+ ti.RLock()
+ defer ti.RUnlock()
- 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) {
return false
}
