File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,23 @@ sub test_index_replay
13
13
{
14
14
my ($test_name ) = @_ ;
15
15
16
+ # Check server version
17
+ my $server_version = $node_master -> safe_psql(" postgres" , " SELECT current_setting('server_version_num');" ) + 0;
18
+
16
19
# Wait for standby to catch up
17
20
my $applname = $node_standby -> name;
18
- my $caughtup_query =
19
- " SELECT pg_current_wal_lsn() <= write_lsn FROM pg_stat_replication WHERE application_name = '$applname ';" ;
21
+ my $caughtup_query ;
22
+
23
+ if ($server_version < 100000)
24
+ {
25
+ $caughtup_query =
26
+ " SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname ';" ;
27
+ }
28
+ else
29
+ {
30
+ $caughtup_query =
31
+ " SELECT pg_current_wal_lsn() <= write_lsn FROM pg_stat_replication WHERE application_name = '$applname ';" ;
32
+ }
20
33
$node_master -> poll_query_until(' postgres' , $caughtup_query )
21
34
or die " Timed out while waiting for standby 1 to catch up" ;
22
35
You can’t perform that action at this time.
0 commit comments