Skip to content

roachtest: add KV/YCSB benchmarks with global MVCC range tombstones#85368

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
erikgrinaker:mvcc-range-tombstones-global-envvar
Aug 1, 2022
Merged

roachtest: add KV/YCSB benchmarks with global MVCC range tombstones#85368
craig[bot] merged 2 commits intocockroachdb:masterfrom
erikgrinaker:mvcc-range-tombstones-global-envvar

Conversation

@erikgrinaker
Copy link
Copy Markdown
Contributor

@erikgrinaker erikgrinaker commented Jul 30, 2022

kvserver: add env var to write global MVCC range tombstone

This patch adds the envvar COCKROACH_GLOBAL_MVCC_RANGE_TOMBSTONE.
When enabled, it will write a global MVCC range tombstone across the
entire table data keyspan during cluster bootstrapping. This can be used
to test performance and correctness in the presence of MVCC range
tombstones, by activating range key-specific code paths while not
semantically affecting the data above it.

Touches #84384.

Release note: None

roachtest: add KV/YCSB benchmarks with global MVCC range tombstones

This patch adds a set of benchmark variants that write a single MVCC
range tombstone across the entire SQL keyspan at cluster start, via the
COCKROACH_GLOBAL_MVCC_RANGE_TOMBSTONE env var. Even though this range
tombstone will not affect the data written during the benchmarks, it
activates range key-specific code paths in the storage layer which can
have a significant impact on performance.

The new benchmarks are:

  • kv0/enc=false/nodes=3/cpu=32/mvcc-range-keys=global
  • kv95/enc=false/nodes=3/cpu=32/mvcc-range-keys=global
  • ycsb/A/nodes=3/cpu=32/mvcc-range-keys=global
  • ycsb/B/nodes=3/cpu=32/mvcc-range-keys=global
  • ycsb/C/nodes=3/cpu=32/mvcc-range-keys=global
  • ycsb/D/nodes=3/cpu=32/mvcc-range-keys=global
  • ycsb/E/nodes=3/cpu=32/mvcc-range-keys=global
  • ycsb/F/nodes=3/cpu=32/mvcc-range-keys=global

Resolves #84384.

Release note: None

@erikgrinaker erikgrinaker requested review from a team, aliher1911 and pav-kv July 30, 2022 19:07
@erikgrinaker erikgrinaker requested a review from a team as a code owner July 30, 2022 19:07
@erikgrinaker erikgrinaker self-assigned this Jul 30, 2022
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@erikgrinaker erikgrinaker changed the title kvserver: add env var to write global MVCC range tombstone roachtest: add KV/YCSB benchmarks with global MVCC range tombstones Jul 30, 2022
@erikgrinaker
Copy link
Copy Markdown
Contributor Author

First kv95 run is looking pretty bad, with a ~30% regression. For comparison, the last nightly came in at 116,870 ops/s total (about 110k reads/s and 5,700 writes/s).

_elapsed___errors_____ops(total)___ops/sec(cum)__avg(ms)__p50(ms)__p95(ms)__p99(ms)_pMax(ms)__total
 1800.0s        0      138764578        77091.4      2.3      1.7      6.6     12.1    125.8  read

_elapsed___errors_____ops(total)___ops/sec(cum)__avg(ms)__p50(ms)__p95(ms)__p99(ms)_pMax(ms)__total
 1800.0s        0        7301068         4056.1      4.1      3.3      9.4     16.3    184.5  write

_elapsed___errors_____ops(total)___ops/sec(cum)__avg(ms)__p50(ms)__p95(ms)__p99(ms)_pMax(ms)__result
 1800.0s        0      146065646        81147.5      2.4      1.7      6.6     12.6    184.5  

@erikgrinaker erikgrinaker force-pushed the mvcc-range-tombstones-global-envvar branch from ed9546a to 3149769 Compare July 30, 2022 22:31
This patch adds the envvar `COCKROACH_GLOBAL_MVCC_RANGE_TOMBSTONE`.
When enabled, it will write a global MVCC range tombstone across the
entire table data keyspan during cluster bootstrapping. This can be used
to test performance and correctness in the presence of MVCC range
tombstones, by activating range key-specific code paths while not
semantically affecting the data above it.

Release note: None
This patch adds a set of benchmark variants that write a single MVCC
range tombstone across the entire SQL keyspan at cluster start, via the
`COCKROACH_GLOBAL_MVCC_RANGE_TOMBSTONE` env var. Even though this range
tombstone will not affect the data written during the benchmarks, it
activates range key-specific code paths in the storage layer which can
have a significant impact on performance.

The new benchmarks are:

* `kv0/enc=false/nodes=3/cpu=32/mvcc-range-keys=global`
* `kv95/enc=false/nodes=3/cpu=32/mvcc-range-keys=global`
* `ycsb/A/nodes=3/cpu=32/mvcc-range-keys=global`
* `ycsb/B/nodes=3/cpu=32/mvcc-range-keys=global`
* `ycsb/C/nodes=3/cpu=32/mvcc-range-keys=global`
* `ycsb/D/nodes=3/cpu=32/mvcc-range-keys=global`
* `ycsb/E/nodes=3/cpu=32/mvcc-range-keys=global`
* `ycsb/F/nodes=3/cpu=32/mvcc-range-keys=global`

Release note: None
@erikgrinaker erikgrinaker force-pushed the mvcc-range-tombstones-global-envvar branch from 3149769 to a1d87ac Compare July 30, 2022 22:42
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:

First kv95 run is looking pretty bad, with a ~30% regression.

😅

Reviewed 6 of 6 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @aliher1911 and @pavelkalinnikov)

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r=jbowens

@nicktrav
Copy link
Copy Markdown
Collaborator

nicktrav commented Aug 1, 2022

First kv95 run is looking pretty bad, with a ~30% regression.

Thanks for adding this, @erikgrinaker. Gotta start somewhere!

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 6 of 6 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @aliher1911 and @pavelkalinnikov)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 1, 2022

Build succeeded:

@craig craig bot merged commit 9c4662b into cockroachdb:master Aug 1, 2022
@erikgrinaker
Copy link
Copy Markdown
Contributor Author

erikgrinaker commented Aug 4, 2022

Oof, YCSB/B is looking at a 78% regression:

@erikgrinaker erikgrinaker deleted the mvcc-range-tombstones-global-envvar branch August 5, 2022 11:19
@jbowens
Copy link
Copy Markdown
Contributor

jbowens commented Aug 5, 2022

I had a thought about this case where there's a single very broad range key. The range key will be split into 1 fragment for every sstable in L6. During iteration we defragment to ensure deterministic bounds, which means we need to load every range key block in L6, and compare bounds to defragment it.

Respecting the iterator bounds when defragmenting should help. The worst case becomes defragmenting across all the range key blocks that overlap the KV range we're reading. Filed cockroachdb/pebble#1861.

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.

roachtest: add benchmarks with MVCC range tombstones

4 participants