-
Notifications
You must be signed in to change notification settings - Fork 593
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
allow property aliases in redpanda.yaml, fix aliases not being applied #15605
allow property aliases in redpanda.yaml, fix aliases not being applied #15605
Conversation
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/42800#018c6996-a6a5-4fe2-82ca-24148ae86c69 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/42800#018c699f-45d7-4173-bda3-29f7ba7285a5 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/42800#018c6996-a6a8-4b28-ab7d-30107fa4fc68 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/42800#018c699f-45db-4b52-95ca-73a6dd85f183 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/42894#018c6edb-deab-4763-8cde-33a1c3641652 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/42894#018c6ed5-a356-46ca-b70e-4a95a7196713 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/42894#018c6ed5-a359-4db4-81e0-04b99f0cf2f3 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/42894#018c6edb-deae-4924-8859-31f360cfabbe |
src/v/config/config_store.h
Outdated
auto found = _properties.find(name); | ||
if (found == _properties.end()) { | ||
found = _aliases.find(name); | ||
if (found == _aliases.end()) { | ||
if (!ignore_missing.contains(name)) { | ||
throw std::invalid_argument( | ||
fmt::format("Unknown property {}", name)); | ||
} | ||
auto* prop = [&]() -> base_property* { | ||
auto primary = _properties.find(name); | ||
if (primary != _properties.end()) { | ||
return primary->second; | ||
} | ||
} else { | ||
bool ok = false; | ||
try { | ||
auto validation_err = found->second->validate(node.second); | ||
if (validation_err.has_value()) { | ||
errors[name] = fmt::format( | ||
"Validation error: {}", | ||
validation_err.value().error_message()); | ||
} | ||
|
||
found->second->set_value(node.second); | ||
ok = true; |
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.
config_store bug about not considering aliases for bootstrap
please describe the problem that is fixed in this commit, and how it is fixed. it also looks like there is some code moved / refactored? if so, that could be a separate commit to make it easier to understand the change.
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.
done, splitted it apart. the first commit has the first fix, the following are some cosmetic change to bring it up smoothly at this stage
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.
what test(s) should we add?
fb0bce5
to
c6f5348
Compare
and another where we trigger the invalid argument check. in cluster_config_test.py |
As far as I can tell the issue linked to in this PR doesn't mention any failing tests. So maybe it's changing / fixing some behavior? If so, that would qualify for a test or update to a test? |
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.
The changes look good, but will wait on a test to approve. It'd be great to at least cover the behavior in the issue, where delete_retention_ms
is set in the config
before this commit, finding the name in the alias table would not throw the std::invalid_argument exception. but would not set the property.
this is a non-functional change
non functional change, the optional was just used inside a code block
property_aliases() mirrors property_names() and both get merged in property_names_and_aliases(), to be used instead of property_names when filtering/scanning over user input
this allows to include prop aliases when validating external input
c6f5348
to
1f12a5c
Compare
the last commit address issue #15263 and #13362 it's a partial solution, because if the cluster is in the middle of an upgrade, the conversion is skipped (and this in not strictly required. we could save the version when an alias is introduced, to skip conversion only for the latest) |
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.
The first few commits lgtm, but I've got some questions about the last one.
Still would be great to have a test for the functional changes
1f12a5c
to
b025e34
Compare
force push: removed last commit, the issue was solved with #15725 |
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.
I think these changes look good. Would be great to have some tests
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.
Thanks for adding some tests! There is probably more to be done, e.g. in ducktape tests, but I don't think that has to block this
new failures in https://buildkite.com/redpanda/redpanda/builds/42986#018c7e88-7056-4487-ac0c-889b74651af3:
|
Failure here seems to be #15261 |
/backport v23.3.x |
Property aliases are not included in the ignored items when reading a node yaml config or cluster yaml config.
This pr fixes 3 distinct but related bugs:
3. properties set with aliases reverting to a previous value after a restart, under some conditions.- with commit 6 translate aliases to the main name before applying it to the controller log. this is more a workaround than a proper fix of the underlying issue, as described in #13362edit: #15725 should be a proper fix for #13362. so the third commit is no longer necessary. once that merge, this can merge on top
Fixes #15603
Backports Required
Release Notes
Bug Fixes