Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2fd31ad

Browse files
committed
Merge branch 'pg_snap' of https://github.com/postgrespro/snapfs into pg_snap
2 parents 212e8dc + 5ccd6e9 commit 2fd31ad

File tree

2 files changed

+272
-51
lines changed

2 files changed

+272
-51
lines changed

src/test/recovery/t/016_snapfs_simple_checks.pl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ ( $$ )
1616
$node_standby->poll_query_until('postgres',
1717
"SELECT (pg_last_wal_replay_lsn() - '$until_lsn'::pg_lsn) >= 0")
1818
or die "standby never caught up";
19+
20+
# the function does not work correctly
21+
$node_master->safe_psql( 'postgres', "select pg_sleep(1);" );
1922
}
2023

2124
my ( $ret, $stdout, $stderr );
@@ -60,7 +63,7 @@ ( $$ )
6063
my $standby_out = $node_standby->safe_psql( 'postgres', "select * from pg_control_snapshot()" );
6164

6265
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' );
6467

6568
# Standby simple checks
6669
( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select pg_make_snapshot();" );
@@ -70,9 +73,9 @@ ( $$ )
7073
like( $stderr, '/ERROR: Operation is not possible at replica/', 'pg_recover_to_snapshot() is prohibited on standby' );
7174

7275
( $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' );
7477

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 );" );
7679
like( $stderr, '/ERROR: Invalid snapshot/', 'Invalid snapshot number passed to pg_set_backend_snapshot() on standby' );
7780

7881
( $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,8 +92,7 @@ ( $$ )
8992

9093
( $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;" );
9194
$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' );
9496

9597
# Master simple checks
9698
( $ret, $stdout, $stderr ) = $node_master->psql( 'postgres', "select pg_set_backend_snapshot( 4 );" );

0 commit comments

Comments
 (0)