From: Thomas Lamprecht Date: Thu, 30 Jun 2016 14:35:36 +0000 (+0200) Subject: ensure quorum is set false when corosync fails X-Git-Url: https://git.proxmox.com/?p=pve-cluster.git;a=commitdiff_plain;h=c37716dd741861cdfda5d007dc0052b441c59ccb ensure quorum is set false when corosync fails If corosync directly fails (i.e. `killall corosync`) the local node acted like it had still quorum, which is not ideal. Ensure that we set quorate to false before we finalize the quorum. Do this in: * service_quorum_dispatch, if it fails it is important that we set it to false, as there is a good possibility that the quorum_notification_fn won't get called anymore, reproducible with $ killall corosync && sleep 0.1 && ls -l /etc/pve/ \ && systemctl start corosync Expected behavior: corosync is dead, the ls should show that everything in /etc/pve is read only Shown: behavior: /etc/pve still has read/write access and PVE::Cluster::check_cfs_quorum() still returns true * service_quorum_initialize: just to be sure as we successfully registered the quorum notification function already Signed-off-by: Thomas Lamprecht --- diff --git a/data/src/quorum.c b/data/src/quorum.c index 1c258db..d9afc1d 100644 --- a/data/src/quorum.c +++ b/data/src/quorum.c @@ -146,6 +146,7 @@ static int service_quorum_initialize( return quorum_fd; err_finalize: + cfs_set_quorate(0, FALSE); quorum_finalize(handle); err_reset_handle: private->handle = 0; @@ -181,6 +182,7 @@ loop: cfs_critical("quorum_dispatch failed: %d", result); + cfs_set_quorate(0, FALSE); quorum_finalize(handle); private->handle = 0; return FALSE;