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

scaffolding leader Sequencer #1982

Merged
merged 2 commits into from
Sep 25, 2024
Merged

Conversation

muhamadazmy
Copy link
Contributor

@muhamadazmy muhamadazmy commented Sep 23, 2024

scaffolding leader Sequencer


Stack created with Sapling. Best reviewed with ReviewStack.

This was referenced Sep 23, 2024
@muhamadazmy muhamadazmy force-pushed the pr1982 branch 3 times, most recently from fec7eb8 to d1330af Compare September 23, 2024 13:13
@muhamadazmy muhamadazmy marked this pull request as ready for review September 23, 2024 14:58
@muhamadazmy muhamadazmy force-pushed the pr1982 branch 11 times, most recently from 0fc55ac to 491eb54 Compare September 25, 2024 09:04
Shutdown(#[from] ShutdownError),
}

/// A sharable part of the sequencer state. This is shared with node workers
Copy link
Contributor

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> {
Copy link
Contributor

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.

Copy link
Contributor Author

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

Comment on lines 197 to 203
let permits = Arc::new(Semaphore::new(
Configuration::pinned()
.bifrost
.replicated_loglet
.maximum_inflight_batches
.into(),
));
Copy link
Contributor

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);
Copy link
Contributor

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?

Comment on lines +169 to +177
pub struct ClusterState {
pub sequencer_id: GenerationalNodeId,
pub global_committed_tail: TailState<LogletOffset>,
}
Copy link
Contributor

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?

Comment on lines 217 to 232
pub maximum_inflight_batches: NonZeroUsize,

pub sequencer_backoff_strategy: RetryPolicy,

pub log_server_timeout: Duration,
Copy link
Contributor

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)

Copy link
Contributor

@AhmedSoliman AhmedSoliman left a 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.

@muhamadazmy muhamadazmy merged commit 750cc50 into restatedev:main Sep 25, 2024
22 checks passed
@muhamadazmy muhamadazmy deleted the pr1982 branch September 25, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants