Skip to content

storage: Implement teeing test engine to compare RocksDB and Pebble #42381

@itsbilal

Description

@itsbilal

To help track down potential correctness issues with RocksDB and Pebble as well as our MVCC implementations on top of those, a new engine type pebble-rocksdb or pebble+rocksdb should be created, that spins up instances of both RocksDB and Pebble (in subdirectories from the main provided data directory), writes to both for any write-related operations, and compares the two in all read paths, panicking if there's a difference.

Should be selectable as an engine type with the COCKROACH_STORAGE_ENGINE env variable, and the --storage-engine flag, but it's okay if it's not documented since uses of this engine would be limited to testing.

Rough implementation plan:

  • Implement TeeingEngine (with read-only variant/flag), TeeingBatch (with distinct variant/flag), TeeingIterator (with ability to work on batches), implementing the appropriate interfaces
  • Add new EngineType and new engine constructor that takes in config for both RocksDB and Pebble
  • Wire up config logic in server/config.go
  • Anything else that needs to be done (eg. TestServer updates) to support this new engine type.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions