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: put MsgHeartbeat.Match on the wire #127350

Open pav-kv opened 4 months ago

pav-kv commented 4 months ago

In #124225, we introduced Match field into leader->follower messages, so that followers can assert their log state is consistent with what leader believes. The assertion was added to detect stable storage state regressions after restarts (e.g. in cases when fsync did not work properly).

In CRDB, we repackage heartbeats into coalesced heartbeats. The Match field is missing from the coalesced heartbeats, we should consider adding it.

The Match field is also carried by MsgApp messages, so an alternative is to remove it from MsgHeartbeat.

Jira issue: CRDB-40404

Epic CRDB-39898

blathers-crl[bot] commented 4 months ago

Hi @pav-kv, please add branch-* labels to identify which branch(es) this C-bug affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

pav-kv commented 1 month ago

We probably don't need to do this change, because raft heartbeats are going to be deprecated. For the Match check, we are covered by the MsgApp.Match field.