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

[v23.3.x] cluster/config_manager: use property's main name in store_delta #15734

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/v/cluster/config_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,29 @@ void config_manager::merge_apply_result(
*/
ss::future<>
config_manager::store_delta(cluster_config_delta_cmd_data const& data) {
auto& cfg = config::shard_local_cfg();

for (const auto& u : data.upsert) {
_raw_values[u.key] = u.value;
if (!cfg.contains(u.key)) {
// passthrough unknown values
_raw_values[u.key] = u.value;
continue;
}

auto& prop = cfg.get(u.key);
if (prop.name() == u.key) {
// u key is already the main name of the property
_raw_values[u.key] = u.value;
continue;
}

// ensure only the main name is used
_raw_values[ss::sstring{prop.name()}] = u.value;
// cleanup any old alias lying around (it should be normally not
// necessary, and at most one loop)
for (auto const& alias : prop.aliases()) {
_raw_values.erase(ss::sstring{alias});
}
}
for (const auto& d : data.remove) {
_raw_values.erase(d);
Expand Down