$master->restart;
system_or_bail('pg_ctl', '-D', $standby->data_dir, 'promote');
-$standby->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
- or die "standby never exited recovery";
$standby->safe_psql('postgres', "create table t11()");
my $standby_ts = $standby->safe_psql('postgres',
# Promote the standby
$node_standby->promote;
-$node_standby->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
- or die "Timed out while waiting for promotion of standby";
$node_standby->psql('postgres', 'checkpoint');
# Restart to discard in-memory copy of FSM
PREPARE TRANSACTION 'xact_009_10';");
$cur_master->teardown_node;
$cur_slave->promote;
-$cur_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
- or die "Timed out while waiting for promotion of standby " . $cur_slave->name;
# change roles
note "Now paris is master and london is slave";
$cur_master->stop;
$cur_slave->restart;
$cur_slave->promote;
-$cur_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
- or die "Timed out while waiting for promotion of standby " . $cur_slave->name;
# change roles
note "Now london is master and paris is slave";
$cur_slave->teardown_node;
$cur_slave->start;
$cur_slave->promote;
-$cur_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
- or die "Timed out while waiting for promotion of standby " . $cur_slave->name;
# change roles
note "Now paris is master and london is slave";
$node_master->stop('immediate');
$node_replica->promote;
-print "waiting for replica to come up\n";
-$node_replica->poll_query_until('postgres',
- "SELECT NOT pg_is_in_recovery();")
- or die "replica never exited recovery";
$node_replica->safe_psql('postgres',
"INSERT INTO decoding(blah) VALUES ('after failover');");
is($psql_out, '8128', "Visible");
$node_master->stop;
$node_slave->promote;
-$node_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
- or die "Timed out while waiting for promotion of standby";
$node_slave->psql(
'postgres',
is($psql_out, '-1', "Not visible");
$node_master->stop;
$node_slave->promote;
-$node_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
- or die "Timed out while waiting for promotion of standby";
$node_slave->psql(
'postgres',
is($psql_out, '-1', "Not visible");
$node_master->stop;
$node_slave->promote;
-$node_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
- or die "Timed out while waiting for promotion of standby";
$node_slave->psql(
'postgres',