mvcc: continue scanning if ReverseScan falls off end of range#17868
mvcc: continue scanning if ReverseScan falls off end of range#17868nvb merged 1 commit intocockroachdb:masterfrom
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 |
|
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
mvccGetInternalcall scans off the end of a key rangewhile attempting to find a value at a certain timestamp,
MVCCReverseScanshouldn't stop scanning backwards. This changefixes this behavior by ignoring the
iter.ValidinMVCCIterateuntil after the iterator has scanned to the previous key.