Skip to content

storage: add benchmark for scanning MVCC garbage#85716

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
erikgrinaker:benchmark-garbage-scan
Aug 8, 2022
Merged

storage: add benchmark for scanning MVCC garbage#85716
craig[bot] merged 1 commit intocockroachdb:masterfrom
erikgrinaker:benchmark-garbage-scan

Conversation

@erikgrinaker
Copy link
Copy Markdown
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 a team and jbowens 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
Copy Markdown
Member

This change is Reviewable

@erikgrinaker erikgrinaker force-pushed the benchmark-garbage-scan branch from e70f6ec to d79d231 Compare August 7, 2022 17:19
@erikgrinaker
Copy link
Copy Markdown
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

@erikgrinaker erikgrinaker force-pushed the benchmark-garbage-scan branch from d79d231 to 254b4e9 Compare August 8, 2022 09:06
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor Author

TFTR!

bors r=jbowens

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

bors r-

Merge conflict with #85708.

@craig
Copy link
Copy Markdown
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 erikgrinaker force-pushed the benchmark-garbage-scan branch from 254b4e9 to cf05775 Compare August 8, 2022 21:31
@erikgrinaker
Copy link
Copy Markdown
Contributor Author

bors r=jbowens,nicktrav

@craig
Copy link
Copy Markdown
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