feat: add Pebbe v2 support #277
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces support for Pebble v2. As v1 and v2 are not compatible (data migration is required) new DB backend was introduced.
On the API level, v1 and v2 are very similar. To avoid code duplication, adapter pattern was used to hide v1 and v2 details.
PR checklist
.changelog(we use unclog to manage our changelog)Note
Adds a new
pebbledb2backend (Pebble v2) and refactorsPebbleDBto use an adapter that supports both Pebble v1 and v2, with tests and dependency updates.Pebble2DBBackend(pebbledb2) and register creator inpebble.go/db.go.PebbleDBto wrap apebbleDBinterface; introduce adapterspebbleV1AdapterandpebbleV2Adapterplus batch/iter shim types.Get/Set/Delete/batch commit paths to route through adapter and unify sync/no-sync options.pebbleIterOptions/pebbleIter.DB()now returns underlying instance asany.TestPebble2DBBackendandBenchmarkPebble2DBRandomReadsWritesinpebble_test.go.github.com/cockroachdb/pebbletov1.1.5; addgithub.com/cockroachdb/pebble/v2 v2.1.1and related indirect deps; updatego.sumaccordingly.Written by Cursor Bugbot for commit c92e8a3. This will update automatically on new commits. Configure here.