From d55ce635a8e171a567d3e1b84776b51e77be0cd2 Mon Sep 17 00:00:00 2001 From: Christophe Varoqui Date: Mon, 11 Oct 2021 12:19:35 +0200 Subject: [PATCH] Don't use duplog() for the split handler logs duplog() hides important logs in the split => unsplit => resplit scenario. Because the log id doesn't change and the duplog map is not cleaned up on unsplit. Use a regular log instead, and trust to callers to not call the split handlers many times. --- opensvc/daemon/shared.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/opensvc/daemon/shared.py b/opensvc/daemon/shared.py index 586cab46b..c7c48a742 100644 --- a/opensvc/daemon/shared.py +++ b/opensvc/daemon/shared.py @@ -981,24 +981,20 @@ def arbitrators_config_count(): def split_handler(self): if not self.quorum: - self.duplog("info", - "cluster is split, ignore as cluster.quorum is " - "false", msgid="quorum disabled") + self.log.info("cluster is split, ignore as cluster.quorum is false") return if self.freezer.node_frozen(): - self.duplog("info", - "cluster is split, ignore as the node is frozen", - msgid="quorum disabled") + self.log.info("cluster is split, ignore as the node is frozen") return total = len(self.cluster_nodes) + self.arbitrators_config_count() live = self.live_nodes_count() extra_votes = self.arbitrators_votes() n_extra_votes = len(extra_votes) if live + n_extra_votes > total / 2: - self.duplog("info", "cluster is split, we have quorum: " - "%(live)d+%(avote)d out of %(total)d votes (%(a)s)", - live=live, avote=n_extra_votes, total=total, - a=",".join(extra_votes)) + self.log.info("cluster is split, we have quorum: " + "%(live)d+%(avote)d out of %(total)d votes (%(a)s)", + live=live, avote=n_extra_votes, total=total, + a=",".join(extra_votes)) return self.event(self.split_action, { "reason": "split",