Skip to content

Commit

Permalink
Fix pgautofailover.update_secondary_check() for dropped nodes. (#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimCitus committed Jul 6, 2021
1 parent 0556bf1 commit c962167
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/monitor/pgautofailover--1.5--1.6.sql
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ begin
into nodeid, reportedstate
from pgautofailover.node
where node.formationid = new.formationid
and node.reportedstate <> 'single';
and node.reportedstate <> 'single'
and node.goalstate <> 'dropped';

if nodeid is not null
then
Expand Down
3 changes: 2 additions & 1 deletion src/monitor/pgautofailover.sql
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,8 @@ begin
into nodeid, reportedstate
from pgautofailover.node
where node.formationid = new.formationid
and node.reportedstate <> 'single';
and node.reportedstate <> 'single'
and node.goalstate <> 'dropped';

if nodeid is not null
then
Expand Down
4 changes: 3 additions & 1 deletion tests/pgautofailover_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,9 @@ def print_state(self, formation="default"):
print("pg_autoctl show state --pgdata %s" % self.datadir)

command = PGAutoCtl(self)
out, err, ret = command.execute("show state", "show", "state")
out, err, ret = command.execute(
"show state", "show", "state", "--formation", formation
)
print("%s" % out)

def get_other_nodes(self, nodeid):
Expand Down

0 comments on commit c962167

Please sign in to comment.