diff options
Diffstat (limited to 'src/test/modules/commit_ts/t/003_standby_2.pl')
-rw-r--r-- | src/test/modules/commit_ts/t/003_standby_2.pl | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/test/modules/commit_ts/t/003_standby_2.pl b/src/test/modules/commit_ts/t/003_standby_2.pl index 138cc43dc2b..d37ff182c4c 100644 --- a/src/test/modules/commit_ts/t/003_standby_2.pl +++ b/src/test/modules/commit_ts/t/003_standby_2.pl @@ -8,9 +8,10 @@ use Test::More tests => 4; use PostgresNode; my $bkplabel = 'backup'; -my $master = get_new_node('master'); +my $master = get_new_node('master'); $master->init(allows_streaming => 1); -$master->append_conf('postgresql.conf', qq{ +$master->append_conf( + 'postgresql.conf', qq{ track_commit_timestamp = on max_wal_senders = 5 wal_level = hot_standby @@ -29,20 +30,25 @@ for my $i (1 .. 10) $master->append_conf('postgresql.conf', 'track_commit_timestamp = off'); $master->restart; $master->safe_psql('postgres', 'checkpoint'); -my $master_lsn = $master->safe_psql('postgres', - 'select pg_current_xlog_location()'); +my $master_lsn = + $master->safe_psql('postgres', 'select pg_current_xlog_location()'); $standby->poll_query_until('postgres', qq{SELECT '$master_lsn'::pg_lsn <= pg_last_xlog_replay_location()}) - or die "slave never caught up"; + or die "slave never caught up"; $standby->safe_psql('postgres', 'checkpoint'); $standby->restart; -my ($psql_ret, $standby_ts_stdout, $standby_ts_stderr) = $standby->psql('postgres', - qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't10'}); +my ($psql_ret, $standby_ts_stdout, $standby_ts_stderr) = $standby->psql( + 'postgres', +qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't10'} +); is($psql_ret, 3, 'expect error when getting commit timestamp after restart'); is($standby_ts_stdout, '', "standby does not return a value after restart"); -like($standby_ts_stderr, qr/could not get commit timestamp data/, 'expected err msg after restart'); +like( + $standby_ts_stderr, + qr/could not get commit timestamp data/, + 'expected err msg after restart'); $master->append_conf('postgresql.conf', 'track_commit_timestamp = on'); $master->restart; @@ -54,5 +60,7 @@ $standby->poll_query_until('postgres', "SELECT pg_is_in_recovery() <> true"); $standby->safe_psql('postgres', "create table t11()"); my $standby_ts = $standby->safe_psql('postgres', - qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't11'}); -isnt($standby_ts, '', "standby gives valid value ($standby_ts) after promotion"); +qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't11'} +); +isnt($standby_ts, '', + "standby gives valid value ($standby_ts) after promotion"); |