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: add benchmark for scanning MVCC garbage #85716

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

erikgrinaker
Copy link
Contributor

This patch adds BenchmarkMVCCScanGarbage, which benchmarks MVCC scans
across garbage. It builds a dataset similarly to BenchmarkMVCCScan,
but writes point tombstones instead of values, and any MVCC range
tombstones are written above the point keys rather than below them.

name                                                               time/op
MVCCScanGarbage_Pebble/rows=50000/versions=1/numRangeKeys=0-24     8.37ms ± 0%
MVCCScanGarbage_Pebble/rows=50000/versions=1/numRangeKeys=1-24     4.03ms ± 1%
MVCCScanGarbage_Pebble/rows=50000/versions=1/numRangeKeys=100-24   60.4ms ± 7%
MVCCScanGarbage_Pebble/rows=50000/versions=10/numRangeKeys=0-24    45.5ms ± 3%
MVCCScanGarbage_Pebble/rows=50000/versions=10/numRangeKeys=1-24    22.9ms ± 0%
MVCCScanGarbage_Pebble/rows=50000/versions=10/numRangeKeys=100-24   109ms ±13%

Resolves #84383.

Release note: None

@erikgrinaker erikgrinaker requested review from jbowens and a team August 7, 2022 17:18
@erikgrinaker erikgrinaker requested a review from a team as a code owner August 7, 2022 17:18
@erikgrinaker erikgrinaker self-assigned this Aug 7, 2022
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@erikgrinaker
Copy link
Contributor Author

@jbowens I expect #85576 will improve this significantly? See profile below for the numRangeKeys=1 case, i.e. a single MVCC range tombstone across all points.

I realized that if we can improve the scan performance here by a couple of orders of magnitude then MVCC range tombstones may provide a solution to outbox-style workloads. We currently struggle with these because of the amount of garbage we have to scan across.

Screenshot 2022-08-07 at 19 19 47

Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should help by ~two orders of magnitude. I'll try to get that in soon, but it might take a minute to figure out why the mvcc metamorphic tests are failing.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker)

Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @erikgrinaker)

@erikgrinaker
Copy link
Contributor Author

TFTR!

bors r=jbowens

Copy link
Collaborator

@nicktrav nicktrav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @erikgrinaker)

@erikgrinaker
Copy link
Contributor Author

bors r-

Merge conflict with #85708.

@craig
Copy link
Contributor

craig bot commented Aug 8, 2022

Canceled.

This patch adds `BenchmarkMVCCScanGarbage`, which benchmarks MVCC scans
across garbage. It builds a dataset similarly to `BenchmarkMVCCScan`,
but writes point tombstones instead of values, and any MVCC range
tombstones are written above the point keys rather than below them.

```
name                                                               time/op
MVCCScanGarbage_Pebble/rows=50000/versions=1/numRangeKeys=0-24     8.37ms ± 0%
MVCCScanGarbage_Pebble/rows=50000/versions=1/numRangeKeys=1-24     4.03ms ± 1%
MVCCScanGarbage_Pebble/rows=50000/versions=1/numRangeKeys=100-24   60.4ms ± 7%
MVCCScanGarbage_Pebble/rows=50000/versions=10/numRangeKeys=0-24    45.5ms ± 3%
MVCCScanGarbage_Pebble/rows=50000/versions=10/numRangeKeys=1-24    22.9ms ± 0%
MVCCScanGarbage_Pebble/rows=50000/versions=10/numRangeKeys=100-24   109ms ±13%
```

Release note: None
@erikgrinaker
Copy link
Contributor Author

bors r=jbowens,nicktrav

@craig
Copy link
Contributor

craig bot commented Aug 8, 2022

Build succeeded:

@craig craig bot merged commit fbe4fea into cockroachdb:master Aug 8, 2022
@erikgrinaker erikgrinaker deleted the benchmark-garbage-scan branch August 12, 2022 12:42
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.

storage: benchmark reads with MVCC range tombstones
4 participants