From 2b70d9fb8ac96c0ff07d262c08c0094daf451211 Mon Sep 17 00:00:00 2001 From: Aaron Fabbri Date: Thu, 2 Jun 2022 16:20:48 -0700 Subject: [PATCH] cluster: clean up config error logging There are a bunch of places we log config values on error, which are currently safe for secrets (because secrets are all freeform strings that cannot fail validation), but future-proof these paths by using format_raw to ensure that if we added validated+secret fields in future they'd be redacted properly. (cherry picked from commit b74e04ab8beec1fc4a7278dded1b77207ba492ac) Conflicts: src/v/cluster/config_manager.cc src/v/redpanda/admin_server.cc --- src/v/cluster/config_manager.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/v/cluster/config_manager.cc b/src/v/cluster/config_manager.cc index d1198c98d7d7..9486ea204055 100644 --- a/src/v/cluster/config_manager.cc +++ b/src/v/cluster/config_manager.cc @@ -240,13 +240,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()); - auto& property = cfg.get(key); property.set_value(decoded); // Because we are in preload, it doesn't matter if the property @@ -266,7 +266,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); } } @@ -520,11 +520,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 errored_properties;