Skip to content

Conversation

@tzdybal
Copy link

@tzdybal tzdybal commented Nov 12, 2025

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

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)

Note

Adds a new pebbledb2 backend (Pebble v2) and refactors PebbleDB to use an adapter that supports both Pebble v1 and v2, with tests and dependency updates.

  • Storage Backends:
    • Add new backend Pebble2DBBackend (pebbledb2) and register creator in pebble.go/db.go.
  • Implementation:
    • Refactor PebbleDB to wrap a pebbleDB interface; introduce adapters pebbleV1Adapter and pebbleV2Adapter plus batch/iter shim types.
    • Update Get/Set/Delete/batch commit paths to route through adapter and unify sync/no-sync options.
    • Iterator construction now uses unified pebbleIterOptions/pebbleIter.
    • DB() now returns underlying instance as any.
  • Tests/Benchmarks:
    • Add TestPebble2DBBackend and BenchmarkPebble2DBRandomReadsWrites in pebble_test.go.
  • Dependencies:
    • Bump github.com/cockroachdb/pebble to v1.1.5; add github.com/cockroachdb/pebble/v2 v2.1.1 and related indirect deps; update go.sum accordingly.

Written by Cursor Bugbot for commit c92e8a3. This will update automatically on new commits. Configure here.

@tzdybal tzdybal requested review from a team as code owners November 12, 2025 11:26
@tzdybal
Copy link
Author

tzdybal commented Nov 24, 2025

Closing this as we're gonna work with our fork.

@tzdybal tzdybal closed this Nov 24, 2025
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.

1 participant