Skip to content
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

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

dt
Copy link
Member

@dt dt commented Apr 10, 2020

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.

@dt dt requested review from pbardea and petermattis April 10, 2020 12:24
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt dt changed the title storage_test: test TBI via ExportToSST storage_test: test incremental iteration via ExportToSST Apr 10, 2020
@dt dt force-pushed the inc-iter-test-via-export branch from d8b7170 to b6a8cc3 Compare April 10, 2020 12:25
@dt
Copy link
Member Author

dt commented Apr 10, 2020

@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?

@blathers-crl
Copy link

blathers-crl bot commented Apr 10, 2020

❌ 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}
Copy link
Contributor

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?

Copy link
Member Author

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.
@dt dt force-pushed the inc-iter-test-via-export branch from b6a8cc3 to 9e93ac3 Compare April 15, 2020 21:29
@dt
Copy link
Member Author

dt commented Apr 16, 2020

TFTR!
bors r+

@craig
Copy link
Contributor

craig bot commented Apr 16, 2020

Build failed (retrying...)

@craig
Copy link
Contributor

craig bot commented Apr 16, 2020

Build succeeded

@craig craig bot merged commit bfa6ffb into cockroachdb:master Apr 16, 2020
@dt dt deleted the inc-iter-test-via-export branch July 12, 2020 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants