-
Notifications
You must be signed in to change notification settings - Fork 44
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
scaffolding leader Sequencer #1982
Conversation
fec7eb8
to
d1330af
Compare
0fc55ac
to
491eb54
Compare
Shutdown(#[from] ShutdownError), | ||
} | ||
|
||
/// A sharable part of the sequencer state. This is shared with node workers |
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.
outdated comment?
&self.sequencer_shared_state | ||
} | ||
|
||
pub async fn cluster_state(&self) -> Result<ClusterState, ShutdownError> { |
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: get_cluster_state()
. Convention is to use nouns for attribute accessors not for operations that need to perform work or can take time.
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.
Definitely, I still under the influence of Golang Getter naming convention
let permits = Arc::new(Semaphore::new( | ||
Configuration::pinned() | ||
.bifrost | ||
.replicated_loglet | ||
.maximum_inflight_batches | ||
.into(), | ||
)); |
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: If permits is not shared with anything else, perhaps it should be constructed and owned by SchedulerHandle
?
sequencer_shared_state: Arc<SequencerSharedState>, | ||
) -> (SequencerHandle, SequencerHandleSink) { | ||
// todo: the size of the channel should be 1 | ||
let (commands_sender, commands_receiver) = mpsc::channel(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.
This this is protected by the semaphore, can we use unbounded channel instead?
pub struct ClusterState { | ||
pub sequencer_id: GenerationalNodeId, | ||
pub global_committed_tail: TailState<LogletOffset>, | ||
} |
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.
Maybe in a follow up pr:
I'd imagine that'd to see the number of in-flight appends among other things. Since the semaphore is what we use to know the capacity, should we move it to live within SequencerSharedState
?
crates/types/src/config/bifrost.rs
Outdated
pub maximum_inflight_batches: NonZeroUsize, | ||
|
||
pub sequencer_backoff_strategy: RetryPolicy, | ||
|
||
pub log_server_timeout: Duration, |
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.
Please add public documentation. Documentation of attributes get automatically published on our website (https://docs.restate.dev/operate/configuration/server#configuration-reference)
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.
Thanks for working on this. Let's get this one merged and iterate from there.
scaffolding leader Sequencer
Stack created with Sapling. Best reviewed with ReviewStack.