Skip to content

Commit c962167

Browse files
authored
Fix pgautofailover.update_secondary_check() for dropped nodes. (#755)
1 parent 0556bf1 commit c962167

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/monitor/pgautofailover--1.5--1.6.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ begin
431431
into nodeid, reportedstate
432432
from pgautofailover.node
433433
where node.formationid = new.formationid
434-
and node.reportedstate <> 'single';
434+
and node.reportedstate <> 'single'
435+
and node.goalstate <> 'dropped';
435436

436437
if nodeid is not null
437438
then

src/monitor/pgautofailover.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,8 @@ begin
730730
into nodeid, reportedstate
731731
from pgautofailover.node
732732
where node.formationid = new.formationid
733-
and node.reportedstate <> 'single';
733+
and node.reportedstate <> 'single'
734+
and node.goalstate <> 'dropped';
734735

735736
if nodeid is not null
736737
then

tests/pgautofailover_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,9 @@ def print_state(self, formation="default"):
18191819
print("pg_autoctl show state --pgdata %s" % self.datadir)
18201820

18211821
command = PGAutoCtl(self)
1822-
out, err, ret = command.execute("show state", "show", "state")
1822+
out, err, ret = command.execute(
1823+
"show state", "show", "state", "--formation", formation
1824+
)
18231825
print("%s" % out)
18241826

18251827
def get_other_nodes(self, nodeid):

0 commit comments

Comments
 (0)