When the last unit in a cluster is stopping, it adds the voting_config_exclusion, but doesn't delete it anymore (because all units are already stopped). It is then persisting on disk. If the storage is reused and the first new unit starts, it may happen that the new unit can't become cluster manager because it's not possible to reach quorum.
Therefore the last unit stopping should not add a voting exclusion.
Issue
https://github.com/canonical/opensearch-operator/issues/320
Solution
When the last unit in a cluster is stopping, it adds the
voting_config_exclusion
, but doesn't delete it anymore (because all units are already stopped). It is then persisting on disk. If the storage is reused and the first new unit starts, it may happen that the new unit can't become cluster manager because it's not possible to reach quorum.Therefore the last unit stopping should not add a voting exclusion.