Skip to content

Commit

Permalink
Merge pull request redpanda-data#15848 from vbotbuildovich/backport-p…
Browse files Browse the repository at this point in the history
…r-15835-v23.2.x-632

[v23.2.x] node_config: Disallow empty rack
  • Loading branch information
michael-redpanda authored Dec 22, 2023
2 parents 7db730e + 9b0e785 commit 71f50e7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/v/redpanda/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,20 @@ void application::hydrate_config(const po::variables_map& cfg) {
if (node_config_errors.size() > 0) {
throw std::invalid_argument("Validation errors in node config");
}
/// Special case scenario with Rack ID being set to ''
/// Redpanda supplied ansible scripts are setting "rack: ''" which has
/// caused issues with some of our customers. This hacky work around is an
/// alternative to using validation in node config to stop Redpanda from
/// starting if rack is supplied with an empty string.
auto& rack_id = config::node().rack.value();
if (rack_id.has_value() && *rack_id == model::rack_id{""}) {
vlog(
_log.warn,
"redpanda.rack specified as empty string. Please remove "
"`redpanda.rack = ''` from your node config as in the future this "
"may result in Redpanda failing to start");
config::node().rack.set_value(std::nullopt);
}

// This includes loading from local bootstrap file or legacy
// config file on first-start or upgrade cases.
Expand Down

0 comments on commit 71f50e7

Please sign in to comment.