-
Notifications
You must be signed in to change notification settings - Fork 4.1k
storage: MVCC benchmarks unreliable under Bazel #83599
Description
pkg/storage has a set of MVCC benchmarks in bench_pebble_test.go, e.g. BenchmarkMVCCGet_Pebble and BenchmarkMVCCScan_Pebble. These operate on a relatively large dataset, which is pre-created if it does not already exist, but otherwise reused if one is found. This is generated by setupMVCCData, under pkg/storage/mvcc_data_*/.
When running under Bazel, e.g.:
$ dev bench pkg/storage -f "BenchmarkMVCCGet"
I often get highly unreliable results that can vary greatly between each run, especially when switching between two commits (to compare before/after benchmarks). I suspect this is some combination of Bazel reusing a previously created dataset in a working directory dependant on the build commit hash or some such. It may also be related to having cancelled the dataset creation, such that one of the builds uses a partial dataset while the other uses a complete one. I haven't dug into this. I don't see this variability with make, which stores the dataset directly in the Git clone, thus reusing the same dataset each run.
Epic CRDB-17171
Jira issue: CRDB-17163