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

Add support for co-locating sequencers and partition processor leaders #2115

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

tillrohrmann
Copy link
Contributor

Let Scheduler respect replicated loglet placements

Let LogsController respect the preferred sequencer node

This fixes #2081.

Copy link
Contributor

@pcholakov pcholakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super clean and logical! Modulo the imports comments, this reads to me like it's ready to merge 🚢

crates/admin/src/cluster_controller/logs_controller.rs Outdated Show resolved Hide resolved
crates/admin/src/cluster_controller/logs_controller.rs Outdated Show resolved Hide resolved
fn sequencer_node(&self) -> Option<PlainNodeId> {
match self {
LogletConfiguration::Replicated(configuration) => {
Some(configuration.sequencer.as_plain())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure why is this a plain node id.

Copy link
Contributor Author

@tillrohrmann tillrohrmann Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is wrong. Will change it to return GenerationalNodeId.

@tillrohrmann
Copy link
Contributor Author

Thanks for the review @pcholakov and @AhmedSoliman. I've addressed your comments and pushed another commit.

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.

Looks good from a quick look. I've just left one question on the preference fallback order but overall this good to merge.

let sequencer = preferred_sequencer
.and_then(|node_id| {
// map to a known alive node
observed_cluster_state.alive_nodes.get(&node_id.id())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we lose strictness of preference by potentially swapping the generational node id that was requested with whatever generation that we have in the list of alive nodes?

Is that intention here to fallback back in this order?

  • Generational node if it's alive
  • Other generation of the same node if alive
  • Any other alive node

Copy link
Contributor Author

@tillrohrmann tillrohrmann Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is what if a GenerationalNodeId is specified that is not known to be alive? In this case, the logs controller will try to reconfigure the log on the next tick. That's why the order, you've described, is what is being followed.

Right now, the scheduler won't give a GenerationalNodeId hint since the chosen partition processor leader is not bound to a generation.

Let Scheduler respect replicated loglet placements

Let LogsController respect the preferred sequencer node

This fixes restatedev#2081.
@tillrohrmann tillrohrmann merged commit 141bd1c into restatedev:main Oct 17, 2024
5 checks passed
@tillrohrmann tillrohrmann deleted the issues/2081 branch October 17, 2024 10:39
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.

Co-locate sequencers with leading partition processors
3 participants