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

Auto provision #2058

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Auto provision #2058

merged 1 commit into from
Oct 15, 2024

Conversation

tillrohrmann
Copy link
Contributor

@tillrohrmann tillrohrmann commented Oct 10, 2024

Adds a feature to disable the auto-provisioning of partitions by the cluster controller. To disable the auto-provisioning, you can set the auto-provision-partitions = false in the configuration or on the CLI via --auto-provision-partitions=false.

This PR is based on #2053

self.task_center.clone(),
self.metadata_store_client.clone(),
self.networking.clone(),
)
.await?;

let mut logs_controller = LogsController::init(
configuration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a blocker, but I'd have loved if we rely more on Live configuration for a more reactive experience.

Copy link
Contributor Author

@tillrohrmann tillrohrmann Oct 15, 2024

Choose a reason for hiding this comment

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

Once the LogsController depends on values in the Configuration apart from the init phase, then this sounds like a good idea.

Comment on lines +337 to +340
async fn init_partition_table(&mut self) -> anyhow::Result<()> {
let configuration = self.configuration.live_load();

let partition_table = retry_on_network_error(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Might be worth logging that we are initializing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, will add it.

config.common.cluster_name(),
)))?;
}
// todo write bootstrap state
Copy link
Contributor

Choose a reason for hiding this comment

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

what should we expect to do here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not fully clear to me yet. It could be the initial default log provider or whether to auto provision partitions if this needs to be agreed upon.

Comment on lines +85 to +90
/// # Automatically provision number of configured partitions
///
/// If this option is set to `false`, then one needs to manually write a partition table to
/// the metadata store. Without a partition table, the cluster will not start.
#[clap(long, global = true)]
pub auto_provision_partitions: Option<bool>,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we will need to review the ergonomics of this process but I wouldn't block merging this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good :-)

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.

Very nice. I'm fine with this as a temporary design until we discuss a more ergonomic way for single-node vs. cluster setup.

@tillrohrmann
Copy link
Contributor Author

tillrohrmann commented Oct 15, 2024

Thanks for the review @AhmedSoliman. I will address your comments and then merge this PR once GHA gives green light.

This also adds the auto-provision option which tells the cluster controller
whether to create an intially empty partition table or a partition table with
as many partitions as the configured bootstrap partitions.

This fixes restatedev#2084.
@tillrohrmann tillrohrmann merged commit c4e958a into restatedev:main Oct 15, 2024
3 checks passed
@tillrohrmann tillrohrmann deleted the auto-provision branch October 15, 2024 21:17
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.

Allow to disable auto-provisioning of partitions
2 participants