[pve-devel] [PATCH manager 14/14] ceph: mon destroy: do not stop monitor ourselves

Dominik Csapak d.csapak at proxmox.com
Tue Jun 18 15:42:58 CEST 2019


a 'mon remove' does this already for us, so do not stop it
this lead to a race where we could stop the next to the last monitor
before it was removed from the cluster, leading to a state
where two monitor were needed for quorum, but only one did exist

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2/Ceph/MON.pm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/PVE/API2/Ceph/MON.pm b/PVE/API2/Ceph/MON.pm
index 975e1848..d63029a8 100644
--- a/PVE/API2/Ceph/MON.pm
+++ b/PVE/API2/Ceph/MON.pm
@@ -348,11 +348,9 @@ __PACKAGE__->register_method ({
 
 		$assert_mon_can_remove->($monhash, $monlist, $monid);
 
+		# this also stops the service
 		$rados->mon_command({ prefix => "mon remove", name => $monid, format => 'plain' });
 
-		eval { PVE::Ceph::Services::ceph_service_cmd('stop', $monsection); };
-		warn $@ if $@;
-
 		# delete section
 		delete $cfg->{$monsection};
 
-- 
2.11.0





More information about the pve-devel mailing list