cockroachdb / pebble

RocksDB/LevelDB inspired key-value database in Go
BSD 3-Clause "New" or "Revised" License
4.6k stars 424 forks source link

crl-release-23.2: provider: consult readahead config when initializing handle #3692

Closed RaduBerinde closed 6 days ago

RaduBerinde commented 6 days ago

Backport of #3668

Makefile: add gen-bazel target

This change adds a gen-bazel target which generates a WORKSPACE file and runs gazelle to generate BUILD.bazelfiles. Generating these files allows a local clone of the repository to be used directly when building Cockroach using the override_repository flag, for example:

./dev build short -- --override_repository=com_github_cockroachdb_pebble=~/go/src/github.com/cockroachdb/pebble

The new files are added to .gitignore so that generating them doesn't interfere with commits.

We also add a clean-bazel target that cleans up these files (useful when switching back to an older branch).

provider: consult readahead config when initializing handle

We currently retrieve the readahead config when we create a Readable and then we use that config for all read handles. This makes the settings not responsive, as any tables already in the table cache will have the Readable created.

We change ReadaheadConfig to an atomic that is loaded every time we initialize a read handle.

cockroach-teamcity commented 6 days ago

This change is Reviewable

RaduBerinde commented 6 days ago

TFTR!