-
Notifications
You must be signed in to change notification settings - Fork 465
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: track latest reported status and report on reconnect #30576
storage: track latest reported status and report on reconnect #30576
Conversation
3947a06
to
c2840f6
Compare
c2840f6
to
de6c0ab
Compare
Before, we would purely pump upgrades from running dataflows over to the controller. Which would make it so that when a controller re-connects it doesn't get status messages for the latest state. Now, we track the latest status update, per object, and also what has been reported, per object. And on re-connect we clear out what has been reported, which makes it so that we report the latest status when a reconnect happens.
de6c0ab
to
6ae2711
Compare
src/storage/src/storage_state.rs
Outdated
@@ -1288,6 +1340,8 @@ impl StorageState { | |||
self.ingestions.remove(&id); | |||
self.exports.remove(&id); | |||
|
|||
let _ = self.reported_status_updates.remove(&id); |
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.
Don't we need to remove the latest_status_updates
entry too?
} | ||
|
||
if to_report.len() > 0 { | ||
self.send_storage_response(response_tx, StorageResponse::StatusUpdates(to_report)); |
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 place that's going to conflict with #31261 (fyi @petrosagg)
src/storage/src/storage_state.rs
Outdated
/// The latest status update that has been _reported_ back to the | ||
/// controller. This will be reset when a new client connects, so that we | ||
/// can determine what updates we have to report again. | ||
pub reported_status_updates: BTreeMap<GlobalId, StatusUpdate>, |
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.
The existence of this map surprises me! Naively I'd have thought that we can just unconditionally send the contents of latest_status_updates
on reconnect. Or, if that's somehow hard to set up, wouldn't an initial_status_reported
flag suffice?
@teskje I updated with your suggestions, ptal. 🙏 |
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.
LGTM!
Thanks for the speedy review/iteration on this one! 🙇♂️ |
Before, we would purely pump upgrades from running dataflows over to the
controller. Which would make it so that when a controller re-connects it
doesn't get status messages for the latest state.
Now, we track the latest status update, per object, and also what has
been reported, per object. And on re-connect we clear out what has been
reported, which makes it so that we report the latest status when a
reconnect happens.
Motivation
Tips for reviewer
Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.