Skip to content

Commit

Permalink
cluster: drop maintenance mode messages on n=1 cluster
Browse files Browse the repository at this point in the history
If a system got into the bad state of issue redpanda-data#4338, then
their cluster is broken until we replay the controller
log _without_ putting the node into maintenance mode.

Related redpanda-data#4338
  • Loading branch information
jcsp committed May 25, 2022
1 parent b970b2d commit 20f3597
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/v/cluster/members_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ members_table::apply(model::offset version, maintenance_mode_cmd cmd) {
return errc::success;
}

if (_brokers.size() < 2) {
// Maintenance mode is refused on size 1 clusters in the admin API, but
// we might be upgrading from a version that didn't have the validation.
vlog(
clusterlog.info,
"Dropping maintenance mode enable operation on single node cluster");

// Return success to enable progress: this is a clean no-op.
return errc::success;
}

if (
target->second->get_maintenance_state()
== model::maintenance_state::active) {
Expand Down

0 comments on commit 20f3597

Please sign in to comment.