Skip to content

Commit

Permalink
Merge pull request #4942 from jcsp/config-log-cleanup
Browse files Browse the repository at this point in the history
cluster: clean up config error logging
  • Loading branch information
andrwng committed May 27, 2022
2 parents 5bb252b + b74e04a commit 9bb79f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
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),
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

0 comments on commit 9bb79f7

Please sign in to comment.