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
mvcc: continue scanning if ReverseScan falls off end of range #17868
mvcc: continue scanning if ReverseScan falls off end of range #17868
Conversation
Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. pkg/storage/engine/mvcc.go, line 1742 at r1 (raw file):
is it legal to call ISTM that it would be illegal if pkg/storage/engine/mvcc_test.go, line 2321 at r1 (raw file):
Could you add commentary narrating what's going on and what used to go wrong? I know what you're fixing, but it still takes me some energy to see through the random numbers. Comments from Reviewable |
Reviewed 2 of 2 files at r1. Comments from Reviewable |
but I'm not sure about the answer to @tschottdorf's question. Reviewed 2 of 2 files at r1. Comments from Reviewable |
Fixes cockroachdb#17825. When an `mvccGetInternal` call scans off the end of a key range while attempting to find a value at a certain timestamp, `MVCCReverseScan` shouldn't stop scanning backwards. This change fixes this behavior by ignoring the `iter.Valid` in `MVCCIterate` until after the iterator has scanned to the previous key.
f80166a
to
2354a32
Compare
TFTRs. Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions. pkg/storage/engine/mvcc.go, line 1742 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Yeah, that's a good point. Before calling pkg/storage/engine/mvcc_test.go, line 2321 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Done. Comments from Reviewable |
Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. pkg/storage/engine/mvcc.go, line 1742 at r1 (raw file): Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
I don't think
Rather than trying to keep track of where the iterator is pointed, perhaps we should add a dummy "max" key when an engine is created. PS Comments from Reviewable |
Reviewed 2 of 2 files at r2. pkg/storage/engine/mvcc_test.go, line 2321 at r1 (raw file): Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Thanks! 🎩 💵 (<- attempted "hat tip") Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. pkg/storage/engine/mvcc.go, line 1742 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
The newest version of this change will only Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. pkg/storage/engine/mvcc.go, line 1742 at r1 (raw file): Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Comments from Reviewable |
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/storage/engine/mvcc.go, line 1742 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
The newest version looks fine. Nice job on tracking this down. Not at all where I expected the bug to be. Comments from Reviewable |
Fixes #17825.
When an
mvccGetInternal
call scans off the end of a key rangewhile attempting to find a value at a certain timestamp,
MVCCReverseScan
shouldn't stop scanning backwards. This changefixes this behavior by ignoring the
iter.Valid
inMVCCIterate
until after the iterator has scanned to the previous key.