Skip to content

Commit

Permalink
c/backend: added explicit check if the raft conifguration has override
Browse files Browse the repository at this point in the history
Added a check in `cluster::controller_backend` validating if
configuration override has been reset before trying to finish the
update. The dependency is already there as backend is waiting for the
leader to be elected and confirmed however it is easier to read when the
dependency is explicitly expressed

Signed-off-by: Michał Maślanka <michal@redpanda.com>
  • Loading branch information
mmaslankaprv committed May 28, 2024
1 parent 640d048 commit ac67ca3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/v/cluster/controller_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ std::error_code check_configuration_update(
partition->ntp());
return errc::partition_configuration_in_joint_mode;
}

if (includes_self && partition->raft()->has_configuration_override()) {
vlog(
clusterlog.trace,
"[{}] contains current node and there is configuration override "
"active",
partition->ntp());
return errc::partition_configuration_in_joint_mode;
}
/*
* if replica set is a leader it must have configuration committed i.e. it
* was successfully replicated to majority of followers.
Expand Down
4 changes: 4 additions & 0 deletions src/v/raft/consensus.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,10 @@ class consensus {
return _replication_monitor;
}

bool has_configuration_override() const {
return _configuration_manager.has_configuration_override();
}

private:
friend replication_monitor;
friend replicate_entries_stm;
Expand Down

0 comments on commit ac67ca3

Please sign in to comment.