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

[1/n][Release] Renames and configuration updates #2566

Closed
wants to merge 2 commits into from
Closed

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Jan 28, 2025

Summary:
This renames a few configuration and command line arguments while keeping compatibility with old options. This also introduces extra documentation on those configuration keys

  • allow-bootstrap -> auto-provision
  • bootstrap-num-partitions -> default-num-partitions (aligns with default-partition-replication)
  • [bifrost.replicated-loglet] default_replication-property -> default_log_replication

Stack created with Sapling. Best reviewed with ReviewStack.

Copy link

github-actions bot commented Jan 28, 2025

Test Results

  7 files    7 suites   4m 32s ⏱️
 47 tests  46 ✅ 1 💤 0 ❌
182 runs  179 ✅ 3 💤 0 ❌

Results for commit 97ad3f2.

♻️ This comment has been updated with latest results.

@AhmedSoliman AhmedSoliman force-pushed the pr2566 branch 2 times, most recently from 0f47059 to cb70236 Compare January 28, 2025 15:14
Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

LGTM. +1 for merging :-)

/// Auto Cluster Provisioning
///
/// If true, then this node is allowed to automatically provision as a new cluster.
/// This node *must* have an admin role and a new nodes configuration will be created that includes this node.
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 it is no longer required that the node that provisions the cluster runs the admin role.

///
/// Bootstrap is allowed by default, unless it is explicitly disabled in config files.
/// If true, then this node is allowed to automatically provision as a new cluster.
/// This node *must* have an admin role and a new nodes configuration will be created that includes this node.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above.

@@ -51,7 +51,7 @@ pub enum Role {
// todo switch to serializing as "metadata-server" in version 1.3
#[serde(rename(serialize = "metadata-store"))]
MetadataServer,
/// [IN DEVELOPMENT] Serves a log server for replicated loglets
/// [PREVIEW FEATURE] Serves a log-server for replicated loglets
Copy link
Contributor

Choose a reason for hiding this comment

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

[__PREVIEW FEATURE__]?

///
/// Default: true
pub allow_bootstrap: bool,
#[serde(alias = "allow-bootstrap")]
Copy link
Contributor

Choose a reason for hiding this comment

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

The alias might actually result into duplicate fields when trying to read a configuration where allow-bootstrap is defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugh, I couldn't actually find a good solution to this :( without investing too much time, and I don't want us to give up on the rename.

I'm not sure if there are good ideas here :(

Copy link
Contributor

Choose a reason for hiding this comment

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

The way I solved it in another PR is by introducing a Shadow variant: https://github.com/restatedev/restate/pull/2571/files#diff-b07de33428bbafda6c26f429c0f36178f5ef8e6215e7a1f187c72142417ecc29R249. Not particularly proud of it, though.

crates/types/src/config/admin.rs Outdated Show resolved Hide resolved
crates/types/src/config/bifrost.rs Outdated Show resolved Hide resolved
pub auto_provision_partitions: Option<bool>,
/// Default: 24
#[clap(long, global = true, alias = "bootstrap-num-partitions")]
pub default_num_partitions: Option<NonZeroU64>,
Copy link
Contributor

@pcholakov pcholakov Jan 29, 2025

Choose a reason for hiding this comment

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

This breaks in a weird way when set via an env variable:

❯ RESTATE_BOOTSTRAP_NUM_PARTITIONS=1 restate-server
[RT0002] configuration loading error: duplicate field `default-num-partitions`

Copy link
Contributor

Choose a reason for hiding this comment

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

Update: rebuilt from the PR branch and tested again, this no longer happens. Both of these work as expected:

RESTATE_DEFAULT_NUM_PARTITIONS=1 restate-server
RESTATE_BOOTSTRAP_NUM_PARTITIONS=1 restate-server

@AhmedSoliman
Copy link
Contributor Author

We agreed that @tillrohrmann will take this over and get ie ready for merge

@tillrohrmann
Copy link
Contributor

Taking over this PR now.

Summary:
This renames a few configuration and command line arguments while keeping compatibility with old options. This also introduces extra documentation on those configuration keys

- `allow-bootstrap` -> `auto-provision`
- `bootstrap-num-partitions` -> `default-num-partitions` (aligns with `default-partition-replication`)
- `[bifrost.replicated-loglet] default_replication-property` -> `default_log_replication`
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.

Not sure what else is still blocking this but +1 for the renames, and I'm no longer seeing the odd "duplicate key" config error that was happening before.


/// # Default nodeset size
///
/// Configures the target nodeset size used by the replicated loglet when generating new
/// nodesets for logs. Setting this to 0 will let the system choose a reasonable value based on
/// the effective replication_property at the time of logs reconfiguration.
///
/// Note that this value only impacts the cluster initial provisioning and will not be respected after
/// the cluster has been provisioned.
// hide the configuration option from serialization if it is the default
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe include the same callout here, too?

Suggested change
// hide the configuration option from serialization if it is the default
///
/// To update existing clusters use the `restatectl` utility.
// hide the configuration option from serialization if it is the default

Copy link
Contributor

Choose a reason for hiding this comment

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

Will do.

Comment on lines +757 to +758
/// | `auto_provision` | `allow_bootstrap` |
/// | `default_num_partitions` | `bootstrap_num_partitions` |
Copy link
Contributor

Choose a reason for hiding this comment

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

OCD:

Suggested change
/// | `auto_provision` | `allow_bootstrap` |
/// | `default_num_partitions` | `bootstrap_num_partitions` |
/// | `auto_provision` | `allow_bootstrap` |
/// | `default_num_partitions` | `bootstrap_num_partitions` |

pub auto_provision_partitions: Option<bool>,
/// Default: 24
#[clap(long, global = true, alias = "bootstrap-num-partitions")]
pub default_num_partitions: Option<NonZeroU64>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Update: rebuilt from the PR branch and tested again, this no longer happens. Both of these work as expected:

RESTATE_DEFAULT_NUM_PARTITIONS=1 restate-server
RESTATE_BOOTSTRAP_NUM_PARTITIONS=1 restate-server

@tillrohrmann
Copy link
Contributor

Merged via 2674511

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.

3 participants