-
Notifications
You must be signed in to change notification settings - Fork 613
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
feat(config): deny unitialized data_directory
and state_store
#9170
Conversation
@huangjw806 We might want to update the docs about system params. /// Macro input is { field identifier, type, default value }
///
/// Note:
/// - Having `None` as default value means the parameter must be initialized.
macro_rules! for_all_undeprecated_params {
($macro:ident
$(, { $field:ident, $type:ty, $default:expr })*) => {
$macro! {
{ barrier_interval_ms, u32, Some(1000_u32) },
{ checkpoint_frequency, u64, Some(10_u64) },
{ sstable_size_mb, u32, Some(256_u32) },
{ block_size_kb, u32, Some(64_u32) },
{ bloom_false_positive, f64, Some(0.001_f64) },
{ state_store, String, None },
{ data_directory, String, None },
{ backup_storage_url, String, Some("memory".to_string()) },
{ backup_storage_directory, String, Some("backup".to_string()) },
{ telemetry_enabled, bool, Some(true) },
$({ $field, $type, $default },)*
}
};
} The third column's value being |
Codecov Report
@@ Coverage Diff @@
## main #9170 +/- ##
=======================================
Coverage 70.84% 70.84%
=======================================
Files 1200 1200
Lines 199998 200010 +12
=======================================
+ Hits 141689 141703 +14
+ Misses 58309 58307 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@arkbriar Please confirm whether the operator needs to be changed synchronously, thank you! |
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.
LGTM
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.
LGTM
Sure. AFAIK, the operator should work without any change. |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
To support mandatory initialization of a system parameter, developers can specify
None
as the default value in the params declaration macro (for_all_undeprecated_params
). Then we can utilizesystem_params_to_kv
invoked when the cluster is started for the first time to check for uninitialized params.ALTER SYSTEM SET data_directory/state_store = DEFAULT;
will also result in an error (though the semantic is wrong as discussed in #8851):Closes #9153
Checklist For Contributors
./risedev check
(or alias,./risedev c
)Checklist For Reviewers
Documentation
Types of user-facing changes
Please keep the types that apply to your changes, and remove the others.
Release note
--data_directory
and--state_store
must be specified on CLI of the meta node, or the cluster will fail to start.