From 86bb085f041bddd0efd2d22ad5f66607a5eae07c Mon Sep 17 00:00:00 2001 From: Jingyi Hu Date: Wed, 29 May 2019 17:41:33 -0700 Subject: [PATCH] mvcc: revert change made by 10526 Revert #10526 and its followup #10699. --- go.mod | 2 ++ mvcc/index.go | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d3fef6a4ffb..8d9b19aeebe 100644 --- a/go.mod +++ b/go.mod @@ -59,3 +59,5 @@ require ( gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect gopkg.in/yaml.v2 v2.2.2 ) + +go 1.13 diff --git a/mvcc/index.go b/mvcc/index.go index 8588977890c..f8cc6df88cf 100644 --- a/mvcc/index.go +++ b/mvcc/index.go @@ -92,10 +92,9 @@ func (ti *treeIndex) visit(key, end []byte, f func(ki *keyIndex)) { keyi, endi := &keyIndex{key: key}, &keyIndex{key: end} ti.RLock() - clone := ti.tree.Clone() - ti.RUnlock() + 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 }