From d0d5ab44252d3e3fbf7c12f4726dfe7d793f0a04 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 4 Aug 2019 16:50:21 -0400 Subject: [PATCH] Fix bug if the switchover target is the same --- node-daemon/pvcd/NodeInstance.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node-daemon/pvcd/NodeInstance.py b/node-daemon/pvcd/NodeInstance.py index f2db1219..73b2520a 100644 --- a/node-daemon/pvcd/NodeInstance.py +++ b/node-daemon/pvcd/NodeInstance.py @@ -306,6 +306,9 @@ class NodeInstance(object): if stdout: self.logger.out('Successfully switched Patroni leader\n{}'.format(stdout), state='o') break + elif stderr == "Error: Switchover target and source are the same.": + self.logger.out('Failed to switch Patroni leader to ourselves; this is fine\n{}'.format(stderr), state='w') + break else: self.logger.out('Failed to switch Patroni leader; retrying\n{}'.format(stderr), state='e') time.sleep(2)