Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvserver: use actual empty proposal to unquiesce #101719

Closed
wants to merge 1 commit into from

Conversation

tbg
Copy link
Member

@tbg tbg commented Apr 18, 2023

We used to unquiesce via a "noop" but not nil log entry but it turns out that
it can happen that raft is out of budget for nontrivial log entries when
unquiescing. So, use a nil one which is identical to what raft proposes when
leadership changes.

Closes #100096.

Epic: none
Release note: None

We used to unquiesce via a "noop" but not nil log entry but it turns out that
it can happen that raft is out of budget for nontrivial log entries when
unquiescing. So, use a nil one which is identical to what raft proposes when
leadership changes.

Closes cockroachdb#100096.

Epic: none
Release note: None
@blathers-crl
Copy link

blathers-crl bot commented Apr 18, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

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

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg
Copy link
Member Author

tbg commented Apr 18, 2023

There actually is a probable downside to this PR, which is that we're interpreting the true empty entry as a signal that a new leader has stepped up, and react to applying it by unconditionally reproposing everything in flight at that point:

if stats.apply.numEmptyEntries > 0 {
// Overwrite unconditionally since this is the most aggressive
// reproposal mode.
if !r.store.TestingKnobs().DisableRefreshReasonNewLeaderOrConfigChange {
refreshReason = reasonNewLeaderOrConfigChange
}
}

So when a quiescent range sees multiple writes at once, we'll repropose some of these, pointlessly. That isn't great.

We'll have to mull this over a bit more, I wouldn't land this as-is.

@tbg tbg closed this Apr 26, 2023
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.

kvserver: investigate exceeding uncommitted entry size
2 participants