|
8 | 8 | use PostgresNode;
|
9 | 9 |
|
10 | 10 | use File::Path qw(rmtree);
|
11 |
| -use Test::More tests => 13; |
| 11 | +use Test::More tests => 14; |
12 | 12 | use Time::HiRes qw(usleep);
|
13 | 13 |
|
14 | 14 | $ENV{PGDATABASE} = 'postgres';
|
|
179 | 179 | }
|
180 | 180 | ok($failed, 'check that replication has been broken');
|
181 | 181 |
|
182 |
| -$node_standby->stop; |
| 182 | +$node_master->stop('immediate'); |
| 183 | +$node_standby->stop('immediate'); |
| 184 | + |
| 185 | +my $node_master2 = get_new_node('master2'); |
| 186 | +$node_master2->init(allows_streaming => 1); |
| 187 | +$node_master2->append_conf( |
| 188 | + 'postgresql.conf', qq( |
| 189 | +min_wal_size = 32MB |
| 190 | +max_wal_size = 32MB |
| 191 | +log_checkpoints = yes |
| 192 | +)); |
| 193 | +$node_master2->start; |
| 194 | +$node_master2->safe_psql('postgres', |
| 195 | + "SELECT pg_create_physical_replication_slot('rep1')"); |
| 196 | +$backup_name = 'my_backup2'; |
| 197 | +$node_master2->backup($backup_name); |
| 198 | + |
| 199 | +$node_master2->stop; |
| 200 | +$node_master2->append_conf( |
| 201 | + 'postgresql.conf', qq( |
| 202 | +max_slot_wal_keep_size = 0 |
| 203 | +)); |
| 204 | +$node_master2->start; |
| 205 | + |
| 206 | +$node_standby = get_new_node('standby_2'); |
| 207 | +$node_standby->init_from_backup($node_master2, $backup_name, |
| 208 | + has_streaming => 1); |
| 209 | +$node_standby->append_conf('postgresql.conf', "primary_slot_name = 'rep1'"); |
| 210 | +$node_standby->start; |
| 211 | +my @result = |
| 212 | + split( |
| 213 | + '\n', |
| 214 | + $node_master2->safe_psql( |
| 215 | + 'postgres', |
| 216 | + "CREATE TABLE tt(); |
| 217 | + DROP TABLE tt; |
| 218 | + SELECT pg_switch_wal(); |
| 219 | + CHECKPOINT; |
| 220 | + SELECT 'finished';", |
| 221 | + timeout => '60')); |
| 222 | +is($result[1], 'finished', 'check if checkpoint command is not blocked'); |
183 | 223 |
|
184 | 224 | #####################################
|
185 | 225 | # Advance WAL of $node by $n segments
|
|
0 commit comments