File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 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
1313{
1414 my ($test_name ) = @_ ;
1515
16+ # Check server version
17+ my $server_version = $node_master -> safe_psql(" postgres" , " SELECT current_setting('server_version_num');" ) + 0;
18+
1619 # Wait for standby to catch up
1720 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+ }
2033 $node_master -> poll_query_until(' postgres' , $caughtup_query )
2134 or die " Timed out while waiting for standby 1 to catch up" ;
2235
You can’t perform that action at this time.
0 commit comments