1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

tap tests: replace 'master' with 'primary'.

We've largely replaced master with primary in docs etc, but tap test
still widely used master.

Author: Andres Freund
Reviewed-By: David Steele
Discussion: https://postgr.es/m/20200615182235.x7lch5n6kcjq4aue@alap3.anarazel.de
This commit is contained in:
Andres Freund
2020-06-14 11:47:37 -07:00
parent 2661a793ff
commit 229f8c219f
37 changed files with 777 additions and 777 deletions

View File

@ -1,4 +1,4 @@
# Test master/standby scenario where the track_commit_timestamp GUC is
# Test primary/standby scenario where the track_commit_timestamp GUC is
# repeatedly toggled on and off.
use strict;
use warnings;
@ -8,31 +8,31 @@ use Test::More tests => 4;
use PostgresNode;
my $bkplabel = 'backup';
my $master = get_new_node('master');
$master->init(allows_streaming => 1);
$master->append_conf(
my $primary = get_new_node('primary');
$primary->init(allows_streaming => 1);
$primary->append_conf(
'postgresql.conf', qq{
track_commit_timestamp = on
max_wal_senders = 5
});
$master->start;
$master->backup($bkplabel);
$primary->start;
$primary->backup($bkplabel);
my $standby = get_new_node('standby');
$standby->init_from_backup($master, $bkplabel, has_streaming => 1);
$standby->init_from_backup($primary, $bkplabel, has_streaming => 1);
$standby->start;
for my $i (1 .. 10)
{
$master->safe_psql('postgres', "create table t$i()");
$primary->safe_psql('postgres', "create table t$i()");
}
$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_wal_lsn()');
$primary->append_conf('postgresql.conf', 'track_commit_timestamp = off');
$primary->restart;
$primary->safe_psql('postgres', 'checkpoint');
my $primary_lsn =
$primary->safe_psql('postgres', 'select pg_current_wal_lsn()');
$standby->poll_query_until('postgres',
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()})
qq{SELECT '$primary_lsn'::pg_lsn <= pg_last_wal_replay_lsn()})
or die "standby never caught up";
$standby->safe_psql('postgres', 'checkpoint');
@ -49,10 +49,10 @@ like(
qr/could not get commit timestamp data/,
'expected err msg after restart');
$master->append_conf('postgresql.conf', 'track_commit_timestamp = on');
$master->restart;
$master->append_conf('postgresql.conf', 'track_commit_timestamp = off');
$master->restart;
$primary->append_conf('postgresql.conf', 'track_commit_timestamp = on');
$primary->restart;
$primary->append_conf('postgresql.conf', 'track_commit_timestamp = off');
$primary->restart;
system_or_bail('pg_ctl', '-D', $standby->data_dir, 'promote');