Skip to content

Commit

Permalink
mvcc: revert change made by 10526
Browse files Browse the repository at this point in the history
Revert etcd-io#10526 and its followup etcd-io#10699.
  • Loading branch information
jingyih authored and nolouch committed Dec 22, 2019
1 parent 77d4b74 commit 86bb085
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 2 additions & 3 deletions mvcc/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 86bb085

Please sign in to comment.