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

storage: reproposals after snapshot may swallow necessary ambiguous result #31935

Open
tbg opened this issue Oct 26, 2018 · 6 comments
Open

storage: reproposals after snapshot may swallow necessary ambiguous result #31935

tbg opened this issue Oct 26, 2018 · 6 comments
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-erroneous-edge-case Database produces or stores erroneous data without visible error/warning, in rare edge cases. T-kv KV Team
Milestone

Comments

@tbg
Copy link
Member

tbg commented Oct 26, 2018

See #30792 (comment) for full details.

When we call refreshProposalsLocked, we pass in a refreshReason. If this reason indicates that a snapshot was applied, we return ambiguous results to clients waiting on those proposals (since they might've applied through a snapshot; we don't know).

Unfortunately, we sometimes override this refreshReason at the caller in handleRaftReady, so that in principle ambiguous results could be omitted when they are necessary.

Jira issue: CRDB-4769

Epic CRDB-39898

@tbg tbg added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-erroneous-edge-case Database produces or stores erroneous data without visible error/warning, in rare edge cases. labels Oct 26, 2018
@tbg tbg added this to the 2.2 milestone Oct 26, 2018
@andreimatei
Copy link
Contributor

Tobi I tried to do something but I don't quite understand the code that does the dubious overwrite. Mind if I assign you here?
This came back to my mind because I'm doing the related #33381 and I was about to file it again.

@tbg
Copy link
Member Author

tbg commented Dec 28, 2018

Sure, I'll take a look.

@nvanbenschoten
Copy link
Member

This still seems real, right? We still appear to prioritize reasonNewLeader and reasonNewLeaderOrConfigChange above reasonSnapshotApplied in handleRaftReadyRaftMuLocked.

@tbg
Copy link
Member Author

tbg commented Aug 18, 2020

Yes, still a problem.

@tbg
Copy link
Member Author

tbg commented Aug 18, 2020

I poked at this and it'd be really easy to fix but then hard to test, so at that point we'll want to pull out the reason state changes into something that can stomach unit testing. But that takes a bit of work.

@jlinder jlinder added the T-kv KV Team label Jun 16, 2021
@erikgrinaker erikgrinaker added T-kv-replication and removed T-kv KV Team labels May 31, 2022
@tbg tbg removed their assignment May 31, 2022
Copy link

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it in
10 days to keep the issue queue tidy. Thank you for your contribution
to CockroachDB!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-erroneous-edge-case Database produces or stores erroneous data without visible error/warning, in rare edge cases. T-kv KV Team
Projects
No open projects
Status: Incoming
Development

No branches or pull requests

5 participants