|
16 | 16 | $node_standby->poll_query_until('postgres',
|
17 | 17 | "SELECT (pg_last_wal_replay_lsn() - '$until_lsn'::pg_lsn) >= 0")
|
18 | 18 | or die "standby never caught up";
|
| 19 | + |
| 20 | + # the function does not work correctly |
| 21 | + $node_master->safe_psql( 'postgres', "select pg_sleep(1);" ); |
19 | 22 | }
|
20 | 23 |
|
21 | 24 | my ( $ret, $stdout, $stderr );
|
|
60 | 63 | my $standby_out = $node_standby->safe_psql( 'postgres', "select * from pg_control_snapshot()" );
|
61 | 64 |
|
62 | 65 | ok( $master_out eq '1|3|0', 'pg_control_snapshot() on master' );
|
63 |
| -ok( $standby_out eq '1|2|0', 'pg_control_snapshot() on standby' ); |
| 66 | +ok( $standby_out eq '1|3|0', 'pg_control_snapshot() on standby' ); |
64 | 67 |
|
65 | 68 | # Standby simple checks
|
66 | 69 | ( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select pg_make_snapshot();" );
|
|
70 | 73 | like( $stderr, '/ERROR: Operation is not possible at replica/', 'pg_recover_to_snapshot() is prohibited on standby' );
|
71 | 74 |
|
72 | 75 | ( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select pg_switch_to_snapshot( 2 );" );
|
73 |
| -like( $stderr, '/ERROR: Operation is not possible at replica/', 'pg_recover_to_snapshot() is prohibited on standby' ); |
| 76 | +like( $stderr, '/ERROR: Operation is not possible at replica/', 'pg_switch_to_snapshot() is prohibited on standby' ); |
74 | 77 |
|
75 |
| -( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select pg_set_backend_snapshot( 3 );" ); |
| 78 | +( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select pg_set_backend_snapshot( 4 );" ); |
76 | 79 | like( $stderr, '/ERROR: Invalid snapshot/', 'Invalid snapshot number passed to pg_set_backend_snapshot() on standby' );
|
77 | 80 |
|
78 | 81 | ( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select * from pg_set_backend_snapshot( 2 ); select * from pg_get_backend_snapshot(); select * from pg_set_backend_snapshot( 0 );" );
|
|
89 | 92 |
|
90 | 93 | ( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select coalesce( pg_get_snapshot_timestamp( generate_series ), now() ) = coalesce( pg_get_snapshot_timestamp, now() ) and pg_size_pretty( pg_get_snapshot_size( generate_series ) ) = pg_size_pretty from snapfs_snapshots;" );
|
91 | 94 | $ret = () = $stdout =~ /t/g;
|
92 |
| -is( $ret, 2, 'snapfs_snapshots view check on standby' ); |
93 |
| - |
| 95 | +is( $ret, 3, 'snapfs_snapshots view check on standby' ); |
94 | 96 |
|
95 | 97 | # Master simple checks
|
96 | 98 | ( $ret, $stdout, $stderr ) = $node_master->psql( 'postgres', "select pg_set_backend_snapshot( 4 );" );
|
|
0 commit comments