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.04k stars 3.8k forks source link

kvserver: sep-raft-log: add reconciliation logic for SST ingestion #93244

Open tbg opened 1 year ago

tbg commented 1 year ago

An ill-timed crash may lead to an AddSST command at raft log index N being visible in the LSM but the state machine not having advanced to N yet. We need to reconcile this at Store.Start time (before any raft processing happens), by applying such commands. We need to make sure that it is always possible to apply such commands standalone, i.e. we need to have the fact that this command is committed durable before we ever attempt to apply it in the first place.

https://github.com/tbg/cockroach/blob/e292a73f2af0e55aa760cce168622732c0716ff6/pkg/kv/kvserver/replicas_storage.go#L489-L504

Epic: CRDB-220

Jira issue: CRDB-22237

blathers-crl[bot] commented 1 year ago

cc @cockroachdb/replication