Skip to content

kvserver: assert uniqueness in registerProposalLocked#97566

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
tbg:assert-registerprop
Feb 24, 2023
Merged

kvserver: assert uniqueness in registerProposalLocked#97566
craig[bot] merged 1 commit intocockroachdb:masterfrom
tbg:assert-registerprop

Conversation

@tbg
Copy link
Copy Markdown
Member

@tbg tbg commented Feb 23, 2023

We routinely overwrite entries in the r.mu.proposals map. That is
"fine" (better if we didn't, but currently it is by design - it
happens in refreshProposalsLocked and during
tryReproposeWithNewLeaseIndex) but our overwrites should be no-ops, i.e.
reference the exact same *ProposalData.

This is now asserted.

One way this would trip is a CmdID collision.

Epic: none
Release note: None

We routinely overwrite entries in the `r.mu.proposals` map. That is
"fine" (better if we didn't, but currently it is by design - it
happens in refreshProposalsLocked and during
tryReproposeWithNewLeaseIndex) but our overwrites should be no-ops, i.e.
reference the exact same `*ProposalData`.

This is now asserted.

One way this would trip is a CmdID collision.

Epic: none
Release note: None
@tbg tbg requested review from a team and pav-kv February 23, 2023 12:43
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Feb 23, 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
Copy Markdown
Member

This change is Reviewable

@tbg
Copy link
Copy Markdown
Member Author

tbg commented Feb 24, 2023

bors r=pavelkalinnikov

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 24, 2023

Build succeeded:

@craig craig bot merged commit 4eb5451 into cockroachdb:master Feb 24, 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.

3 participants