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 range keys and mvccstats to gc bench #87261

Merged

Conversation

aliher1911
Copy link
Contributor

Previously gc benchmarking code didn't include neither range key
tombstones, nor mvcc stats calculations.
This is not realistic as production always uses stats and it is
a non-negligible part of the operation time.
This commit adds option to enable stats calculation during
benchmarking as well as adding underlying range key tombstone
to include everything.

Release justification: increasing bench coverage, non production.
Release note: None

@aliher1911 aliher1911 self-assigned this Sep 1, 2022
@aliher1911 aliher1911 requested a review from a team as a code owner September 1, 2022 12:10
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@aliher1911 aliher1911 force-pushed the add_range_tombstone_to_mvcc_gc_bench branch from 208f9ac to 00f4bdd Compare September 1, 2022 12:12
@aliher1911 aliher1911 force-pushed the add_range_tombstone_to_mvcc_gc_bench branch from 00f4bdd to 7f91582 Compare September 5, 2022 10:00
@aliher1911 aliher1911 requested a review from a team September 6, 2022 08:33
for _, rangeTombstones := range numRangeTombstones {
b.Run(fmt.Sprintf("numRangeTs=%d", rangeTombstones), func(b *testing.B) {
for _, stats := range updateStats {
b.Run(fmt.Sprintf("updateStats=%t", stats), func(b *testing.B) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the false variant here have any real value, since we'll always enable stats during real GC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is helpful when comparing to previous releases mostly. Maybe we should remove unhelpful benchmarks later.
Maybe we should backport benchmarks like that to make life easier?

Copy link
Contributor

Choose a reason for hiding this comment

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

No strong opinion either way. It's fine to keep it in as well.

pkg/storage/bench_test.go Outdated Show resolved Hide resolved
@@ -63,6 +63,8 @@ func BenchmarkMVCCGarbageCollect(b *testing.B) {
{2, []int{1}},
{1024, []int{1, 16, 32, 512, 1015, 1023}},
}
numRangeTombstones := []int{0, 1}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to have a variant with 100 random range tombstones too, like the other benchmarks, but this is fine for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That requires reverting key by key to ts by ts insertion. I did this change when experimenting with batch performance, but I'd rather add it separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created #87417

Previously gc benchmarking code didn't include neither range key
tombstones, nor mvcc stats calculations.
This is not realistic as production always uses stats and it is
a non-negligible part of the operation time.
This commit adds option to enable stats calculation during
benchmarking as well as adding underlying range key tombstone
to include everything.

Release justification: increasing bench coverage, non production.
Release note: None
@aliher1911 aliher1911 force-pushed the add_range_tombstone_to_mvcc_gc_bench branch from 7f91582 to ab4b121 Compare September 6, 2022 14:39
@aliher1911
Copy link
Contributor Author

TFTR

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 6, 2022

Build failed (retrying...):

@craig craig bot merged commit 0197ada into cockroachdb:master Sep 6, 2022
@craig
Copy link
Contributor

craig bot commented Sep 6, 2022

Build succeeded:

@aliher1911 aliher1911 deleted the add_range_tombstone_to_mvcc_gc_bench branch September 6, 2022 18:05
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