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.16k stars 3.82k forks source link

raft: revamp async log storage protocol #124440

Open pav-kv opened 6 months ago

pav-kv commented 6 months ago

The async log storage protocol (https://github.com/etcd-io/raft/pull/8) can be improved in a few aspects:


To support the new log write protocol, we are missing the notion of "leader term" - the term of the leader with whom our log is consistent. By raft invariants, all writes to, and acknowledgements from log storage are ordered by (leader term, index). Today, we approximate the "leader term" by using the last entry ID, but it complicates the protocol. It is also hard to reuse for Replication Admission Control because it requires remembering the unacknowledged entry IDs, but these are cleared from the unstable data structure as soon as the entries are written.

The plan is to support the "leader term" tracking:


Epic: CRDB-37515 Jira issue: CRDB-38897

blathers-crl[bot] commented 6 months ago

cc @cockroachdb/replication