|
2 | 2 | use warnings;
|
3 | 3 | use PostgresNode;
|
4 | 4 | use TestLib;
|
5 |
| -use Test::More tests => 11; |
| 5 | +use Test::More tests => 12; |
6 | 6 |
|
7 | 7 | # Setup master node
|
8 | 8 | my $node_master = get_new_node("Candie");
|
|
21 | 21 |
|
22 | 22 | # Switch to synchronous replication
|
23 | 23 | $node_master->append_conf('postgresql.conf', qq(
|
24 |
| -synchronous_standby_names = '*' |
| 24 | + synchronous_standby_names = '*' |
25 | 25 | ));
|
26 | 26 | $node_master->psql('postgres', "select pg_reload_conf()");
|
27 | 27 |
|
28 | 28 | my $psql_out = '';
|
29 | 29 | my $psql_rc = '';
|
30 | 30 |
|
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +$node_master->psql('postgres', " |
| 36 | + begin; |
| 37 | + insert into t values (1); |
| 38 | + prepare transaction 'x'; |
| 39 | +"); |
| 40 | +$node_slave->teardown_node; |
| 41 | +$node_master->psql('postgres',"commit prepared 'x'"); |
| 42 | +$node_slave->start; |
| 43 | +$node_slave->psql('postgres',"select count(*) from pg_prepared_xacts", stdout => \$psql_out); |
| 44 | +is($psql_out, '0', "Commit prepared on master while slave is down."); |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
31 | 51 | ###############################################################################
|
32 | 52 | # Check that we can commit and abort tx after soft restart.
|
33 | 53 | # Here checkpoint happens before shutdown and no WAL replay will not occur
|
|
223 | 243 | $node_master->psql('postgres',"commit prepared 'x'");
|
224 | 244 |
|
225 | 245 |
|
| 246 | +############################################################################### |
| 247 | +# Commit prepared on master while slave is down. |
| 248 | +############################################################################### |
| 249 | + |
| 250 | +# Switch to asynchronous replication |
| 251 | +#$node_master->append_conf('postgresql.conf', qq( |
| 252 | +# synchronous_standby_names = '' |
| 253 | +#)); |
| 254 | +#$node_master->psql('postgres', "select pg_reload_conf()"); |
| 255 | + |
| 256 | + |
0 commit comments