Skip to content

Conversation

@erikgrinaker
Copy link

Backports etcd-io#52 on behalf of @tbg.

Move from StatePause->StateReplicate on heartbeat response when possible
See individual commits. Essentially, when a fully caught-up follower was
reported unreachable, it'd transition to StateProbe but then wouldn't
recover from that via heartbeats (once they resumed).

This caused some issues in CRDB because we rely on the reported status
to reason about the safety of leadership changes, etc.

This PR makes it such that StateProbe resolves on its own: when the
leader hears back from the follower via a heartbeat, it sends an
empty MsgApp, and as response to this moves the follower back into
StateProbe.

Touches cockroachdb/cockroach#104304.
Touches cockroachdb/cockroach#101624.

Signed-off-by: Tobias Grieger [email protected]

pav-kv added 2 commits May 19, 2023 11:22
…-bytes-leak

tracker: fix byte counter leak in Inflights tracker

This change fixes a bug in the Inflights tracker. The reset() method did not
zero the bytes counter, which could result in a quota "leak" and delayed or
stalled MsgApp sends.

The reset() method is used when the replication flow changes state between
Probe/Replicate/Snapshot. If reset() is not called at an appropriate moment,
when Inflights.Full(), the bytes counter would stay over the budget and stall
the flow.

Signed-off-by: Pavel Kalinnikov <[email protected]>
…-read

raft: paginate the unapplied config changes scan

There is a potentially unlimited memory usage spike possible in raft.hup()
which reads all unapplied committed entries in order to check that there are no
unapplied config changes. This PR paginates this scan so that the spike is
limited to MaxCommittedSizePerReady. It also terminates the scan early if a
config change has been found.

Signed-off-by: Pavel Kalinnikov <[email protected]>
@erikgrinaker erikgrinaker requested a review from tbg July 7, 2023 10:11
@erikgrinaker erikgrinaker self-assigned this Jul 7, 2023
@erikgrinaker
Copy link
Author

Oops, messed up the base/branch picks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants