-
Notifications
You must be signed in to change notification settings - Fork 94
[Bifrost] Read stream will seal the chain if partial seal is detected #3597
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
Conversation
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.
Great work @AhmedSoliman. The logic seems sound to me. LGTM. +1 for merging :-)
crates/bifrost/src/read_stream.rs
Outdated
Reconfiguring, | ||
/// Waiting for the tail LSN of the substream's loglet to be determined (sealing in-progress). | ||
/// We land on this state when we observe a "Sealed" signal from an open segment after we | ||
/// reached the safe known tail for that loglet. We can continue reading only after the chain | ||
/// has been sealed by a marker or with a new installed chain. | ||
AwaitingReconfiguration { |
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.
Nit: Reconfiguring
(compared to AwaitingReconfiguration
) reads as if the read stream would reconfigure something. Could renaming Reconfiguring
into Awaiting(NewSegment | Reconfiguration)
and AwaitingReconfiguration
into Awaiting(NewSegment | Reconfiguration)OrSealChain
be an idea?
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.
No strong opinions here. I'll update.
The PR introduces two changes: - `Bifrost::find_tail()` will only attempt to seal the chain if FindTailOpts asks for consistent result; we don't need to cripple the fast path for find-tail. - Find tail will eagerly seal the chain without grace period. This is to avoid unnecessary startup delays for single-node setups. The fact that chain sealing is idempotent makes it lighterweight to perform as it'll coalesce nicely with other reconfigurations that might be happening concurrently.
Allows the system to capture the "source" and the "node" for chain seal markers. There is also a new `--reason` flag to `restatectl log seal` to specify the reason, and the reason + the node id will be printed in `restatectl logs describe <id>` output.
A partial seal is when the tail loglet is sealed but the chain itself is not. The read stream will detect this situation and seal the chain after a grace period (5s+50% jitter).
A partial seal is when the tail loglet is sealed but the chain itself is not. The read stream will detect this situation and seal the chain after a grace period (5s+50% jitter).
Stack created with Sapling. Best reviewed with ReviewStack.