cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
29.86k stars 3.77k forks source link

kvserver: sep-raft-log: add crash-testing datadriven test harness #93247

Open tbg opened 1 year ago

tbg commented 1 year ago

We need to exhaustively test the invariants for the engine states in separate raft logs. We'll add assertions but should also explore these using datadriven tests.

Some of the code in https://github.com/cockroachdb/cockroach/pull/88606 might be helpful.

TODO:

I'll add that our testing of the snapshot SSTs is currently weak. We rely on spinning up a real cluster and then intercept the SSTs, which is not very maintainable. We should complement this with kvstorage-level tests that create a snapshot and examine in detail their contents and the engine each one targets.

Epic: CRDB-220

Jira issue: CRDB-22240

blathers-crl[bot] commented 1 year ago

cc @cockroachdb/replication

tbg commented 1 year ago

We have a basic datadriven framework at https://github.com/cockroachdb/cockroach/blob/672e8b1e628ef0a4c920cf42355c44cbc7a625b6/pkg/kv/kvserver/kvstorage/datadriven_test.go that should, with extra work, be able to accommodate our testing needs.

The testing it is used for is limited. I'm adding some bullets to the comment above about missing areas.