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

cluster: clean up config error logging #4942

Merged
merged 1 commit into from
May 27, 2022
Merged
Show file tree
Hide file tree
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
11 changes: 3 additions & 8 deletions src/v/cluster/config_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,13 @@ static void preload_local(
result) {
auto& cfg = config::shard_local_cfg();
if (cfg.contains(key)) {
auto& property = cfg.get(key);
try {
// Cache values are string-ized yaml. In many cases this
// is the same as the underlying value (e.g. integers, bools),
// but for strings it's not (the literal value in the cache is
// "\"foo\"").
auto decoded = YAML::Load(value.as<std::string>());
auto& property = cfg.get(key);
property.set_value(decoded);

// Because we are in preload, it doesn't matter if the property
Expand All @@ -294,7 +294,7 @@ static void preload_local(
clusterlog.info,
"Ignoring invalid property: {}={}",
key,
YAML::Dump(value));
property.format_raw(YAML::Dump(value)));
result.value().get().invalid.push_back(key);
}
}
Expand Down Expand Up @@ -580,7 +580,7 @@ apply_local(cluster_config_delta_cmd_data const& data, bool silent) {
clusterlog.warn,
"Invalid property value {}: {} ({})",
u.first,
val_yaml,
property.format_raw(val_yaml),
validation_err.value().error_message());
}
result.invalid.push_back(u.first);
Expand Down Expand Up @@ -657,11 +657,6 @@ void config_manager::merge_apply_result(
config_status& status,
cluster_config_delta_cmd_data const& data,
apply_result const& r) {
vlog(
clusterlog.trace,
"merge_apply_result: data {} {}",
fmt::ptr(&data),
Copy link
Contributor

Choose a reason for hiding this comment

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

Good call removing this. Nothing secret revealed here, but I'm not sure how useful this actually is (maybe if you're in a debugger or something).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this was something left behind from ancient debugging that I was cleaning up while making the pass.

data.upsert.size());
status.restart |= r.restart;

std::set<ss::sstring> errored_properties;
Expand Down
6 changes: 3 additions & 3 deletions src/v/redpanda/admin_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ void admin_server::register_cluster_config_routes() {
logger.warn,
"Invalid {}: '{}' ({})",
i.first,
yaml_value,
property.format_raw(yaml_value),
validation_err.value().error_message());
} else {
// In case any property subclass might throw
Expand Down Expand Up @@ -1042,7 +1042,7 @@ void admin_server::register_cluster_config_routes() {
logger.warn,
"Invalid {}: '{}' ({})",
i.first,
yaml_value,
property.format_raw(yaml_value),
std::current_exception());
} catch (...) {
auto message = fmt::format(
Expand All @@ -1052,7 +1052,7 @@ void admin_server::register_cluster_config_routes() {
logger.warn,
"Invalid {}: '{}' ({})",
i.first,
yaml_value,
property.format_raw(yaml_value),
message);
}
}
Expand Down