-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix merge iterator duplicates issue #1157
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please merge after tests pass.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ashish-goswami, @jarifibrahim, and @manishrjain)
table/merge_iterator.go, line 33 at r1 (raw file):
small *node curKey []byte
Please add a comment saying that this is used for remove duplicate keys across different iterators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ashish-goswami and @jarifibrahim)
table/merge_iterator.go, line 164 at r1 (raw file):
func (mi *MergeIterator) setCurrent() { if cap(mi.curKey) < len(mi.small.key) { mi.curKey = make([]byte, 2*len(mi.small.key))
mi.curKey = append(mi.curKey[:0], mi.small.key...)
Windows build is not failing because of this PR. I'll fix the windows build in a separate PR. |
Fixes: #1153
The tree-based merge iterator would not skip duplicate keys. This PR fixes it.
If merge iterator consists of 3 iterator
The result should be
This change is