-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
storage_test: test incremental iteration via ExportToSST #47331
Conversation
d8b7170
to
b6a8cc3
Compare
@pbardea This sadly doesn't catch either of the Seek bugs from last month, presumably since with so few keys we never get into cases where we can seek, but it seemed like maybe a start in terms of getting some test coverage that the c++ version? |
❌ The GitHub CI (Cockroach) build has failed on b6a8cc3e. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. I am experimental - my owner is otan. |
@@ -115,7 +196,7 @@ func TestMVCCIncrementalIterator(t *testing.T) { | |||
testValue3 = []byte("val3") | |||
testValue4 = []byte("val4") | |||
|
|||
tsMin = hlc.Timestamp{WallTime: 0, Logical: 0} | |||
tsMin = hlc.Timestamp{WallTime: 0, Logical: 1} |
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.
I was a bit confused about why we needed to up the logical timestamp for the export tests. I think it's odd enough that it may warrant a brief explanation as a comment?
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.
Good point, done!
TestMVCCIncrementalIterator used to serve as one of our primary unit tests on incremental iteration. However with the introduction of the c++ implementation of an incremental iterator, the fact that it directly tests the Go iterator leaves the parallel implementation (that is used by default at runtime) untested. This change extends the test to also verify each test case via engine.ExportToSST, which, because it lets the engine in use decide which iterator to use, means that it now tests both iterators. Additionally this serves to actually test that the usage of those iterators yields the expected results at the same time. Futhermore, both of these iterators behave differently when the min/max timestamp hints are provided, when they use a second filtered (time-bound) iterator to skip keys. Previously this test never set these hints, and thus never exercise the TBI path in either iterator. Not however that even with this hint set and the pair of iterators being used, this test still only covers a fraction of the TBI code, as the handful of keys used in each test never get flushed, much less into separate SSTs with different time-bounds, so all of the logic around Seeking over large swaths of keys, catching up in the known edges cases, etc is still uncovered. Release note: none.
b6a8cc3
to
9e93ac3
Compare
TFTR! |
Build failed (retrying...) |
Build succeeded |
TestMVCCIncrementalIterator used to serve as one of our primary unit
tests on incremental iteration. However with the introduction of the c++
implementation of an incremental iterator, the fact that it directly
tests the Go iterator leaves the parallel implementation (that is used
by default at runtime) untested.
This change extends the test to also verify each test case via
engine.ExportToSST, which, because it lets the engine in use decide
which iterator to use, means that it now tests both iterators.
Additionally this serves to actually test that the usage of those
iterators yields the expected results at the same time.
Futhermore, both of these iterators behave differently when the min/max
timestamp hints are provided, when they use a second filtered
(time-bound) iterator to skip keys. Previously this test never set these
hints, and thus never exercise the TBI path in either iterator. Not
however that even with this hint set and the pair of iterators being
used, this test still only covers a fraction of the TBI code, as the
handful of keys used in each test never get flushed, much less into
separate SSTs with different time-bounds, so all of the logic around
Seeking over large swaths of keys, catching up in the known edges cases,
etc is still uncovered.
Release note: none.