-
Notifications
You must be signed in to change notification settings - Fork 23
Min-quorum reconciliation #1733
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
base: main
Are you sure you want to change the base?
Conversation
Quick notes on failing CI tests:
|
de311a2
to
1c75dc7
Compare
21a03f8
to
1b91f6c
Compare
1c75dc7
to
ac5c71a
Compare
I've fixed the |
I'm hopefully fixing the verification test in cc512f4 , which waits for the third Downstairs to start (so that we can do full-quorum reconciliation before verifying on-disk data). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments to start, I'm still looking though.
crutest/src/main.rs
Outdated
@@ -2622,12 +2631,13 @@ async fn replace_before_active( | |||
tokio::time::sleep(tokio::time::Duration::from_secs(4)).await; | |||
} | |||
|
|||
old_ds = (old_ds + 1) % (ds_total as u32 + 1); | |||
old_ds_a = (old_ds_a + 1) % (ds_total as u32 + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... Will this test pass if you do 2 region sets?
I think this logic can get you 1 downstairs in one region set, and a 2nd in a different region set, which is not the behavior we want here. Also, If we don't have multiple region set testing turned on by default, I'm going to go do that everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! I notice a CI failure in test-up-2region-encrypted
, so I suspect that you're correct 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fixed in d2d168e bdcfc08.
It's somewhat subtle: the unused downstairs is always right before the downstairs we're about to replace, but the second downstairs in that set could either be before or after (and shifts over time). That commit tracks which downstairs is in which region set, so that we can always disable 2 in the same region set (and prevent activation, which is the whole point).
4d632b5
to
cf1e0f8
Compare
d2d168e
to
bdcfc08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, and also: there should be some additional downstairs tests for the non-"all clients are participating" cases.
if let DsStateData::Connecting { | ||
state, | ||
mode: ConnectionMode::New, | ||
.. | ||
} = &mut self.state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems wrong that begin_reconcile
now doesn't panic or return an error if the state is incorrect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an intentional behavior change: we are using begin_reconcile
to also detect which members were participating in reconciliation.
However, we also check this when building the mend list, so I've moved stuff around: mismatch_list
now returns both the mend list and the participating downstairs, and this function is back to panicking if you call it on a Downstairs in the wrong state.
/// Returns `false` if we aren't ready, or if things failed. If there's a | ||
/// failure, then we also update the client state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote for returning Result<bool, some error>
instead - having false
cover both cases seems wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Counterproposal: let's remove the return value entirely! It's only ever used in one unit test, so I've updated that test to look at states instead.
return; | ||
}; | ||
assert!(min_quorum_deadline.is_some()); | ||
*min_quorum_deadline = None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think clearing min_quorum_deadline
here means that if ready_count
!= 2 (checked below), control will leave this function and not attempt min quorum activation again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but I think this is fine: next time we end up with 2 ready Downstairs, then we'll reschedule min_quorum_deadline
.
.. | ||
} => { | ||
assert!(!did_work); | ||
c.set_active(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not faulted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, this is for the case where we've found that no reconciliation is necessary, so we go straight from WaitQuorum
without passing through Reconcile
(equivalent to this conditional in the old code).
(staged on #1732)
This implements RFD 542 and closes #1690.
Here's the quick version:
WaitQuorum
, we schedule an event to fire afterNEGOTIATION_DELAY
(currently 500 ms)I'm opening this as a draft because I want to see how the CI tests go. The PR includes integration tests for common and uncommon orderings of events, but it's hard to hit every possible path due to specific timing requirements; I'm very open to suggestions for other tests.
Before merging, we also need to figure out #1661 (comment)