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
30.13k stars 3.81k forks source link

rangefeed: add data-driven test harness #82715

Open erikgrinaker opened 2 years ago

erikgrinaker commented 2 years ago

We should have a data-driven test harness for rangefeeds. This would set up a testserver/cluster, use datadriven to run commands against it, and run a rangefeed.Factory-based client to record rangefeed responses. This would allow much more exhaustive testing of e.g. catchup scans and event handling. However, care must be taken to make this deterministic -- for example, we can't have timestamps anywhere, and we need to wait for each event after running a command to avoid ordering issues (i.e. take the current timestamp and wait for the checkpoint to progress past it). It should support error handling, and use multiple ranges/nodes.

Functionality needed to be on par with existing non-datadriven tests:

Functionality needs adding:

Some more ad-hoc settings that might be left out

Functionality for randomized tests

Not all of those are translated to data driven statements directly.

Jira issue: CRDB-16628

Epic CRDB-39959

blathers-crl[bot] commented 2 years ago

cc @cockroachdb/replication

erikgrinaker commented 1 year ago

@aliher1911 This seems like it'd be very useful for the rangefeed refactor, reassigning to you and pulling into 23.2.