summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-08-07 17:42:47 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-08-10 22:55:41 -0400
commita1ef920e27ba6ab3602aaf6d6751d8628fac1af8 (patch)
tree51485b2898ae4b01b2e71ad5e40a7d3b02d75f91 /src/test
parentd6391b03b3025372620925e5746e65c288a1e371 (diff)
Remove uses of "slave" in replication contexts
This affects mostly code comments, some documentation, and tests. Official APIs already used "standby".
Diffstat (limited to 'src/test')
-rw-r--r--src/test/modules/commit_ts/t/002_standby.pl4
-rw-r--r--src/test/modules/commit_ts/t/003_standby_2.pl2
-rw-r--r--src/test/recovery/t/002_archiving.pl2
-rw-r--r--src/test/recovery/t/005_replay_delay.pl2
-rw-r--r--src/test/recovery/t/009_twophase.pl86
-rw-r--r--src/test/recovery/t/012_subtransactions.pl62
6 files changed, 79 insertions, 79 deletions
diff --git a/src/test/modules/commit_ts/t/002_standby.pl b/src/test/modules/commit_ts/t/002_standby.pl
index 1437519aa19..83e851954b3 100644
--- a/src/test/modules/commit_ts/t/002_standby.pl
+++ b/src/test/modules/commit_ts/t/002_standby.pl
@@ -34,7 +34,7 @@ my $master_lsn =
$master->safe_psql('postgres', 'select pg_current_wal_lsn()');
$standby->poll_query_until('postgres',
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()})
- or die "slave never caught up";
+ or die "standby never caught up";
my $standby_ts = $standby->safe_psql('postgres',
qq{select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname = 't10'}
@@ -47,7 +47,7 @@ $master->safe_psql('postgres', 'checkpoint');
$master_lsn = $master->safe_psql('postgres', 'select pg_current_wal_lsn()');
$standby->poll_query_until('postgres',
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()})
- or die "slave never caught up";
+ or die "standby never caught up";
$standby->safe_psql('postgres', 'checkpoint');
# This one should raise an error now
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 c3000f5b4c6..27494709e17 100644
--- a/src/test/modules/commit_ts/t/003_standby_2.pl
+++ b/src/test/modules/commit_ts/t/003_standby_2.pl
@@ -33,7 +33,7 @@ my $master_lsn =
$master->safe_psql('postgres', 'select pg_current_wal_lsn()');
$standby->poll_query_until('postgres',
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()})
- or die "slave never caught up";
+ or die "standby never caught up";
$standby->safe_psql('postgres', 'checkpoint');
$standby->restart;
diff --git a/src/test/recovery/t/002_archiving.pl b/src/test/recovery/t/002_archiving.pl
index 42a9afb2f34..e1bd3c95cca 100644
--- a/src/test/recovery/t/002_archiving.pl
+++ b/src/test/recovery/t/002_archiving.pl
@@ -16,7 +16,7 @@ my $backup_name = 'my_backup';
# Start it
$node_master->start;
-# Take backup for slave
+# Take backup for standby
$node_master->backup($backup_name);
# Initialize standby node from backup, fetching WAL from archives
diff --git a/src/test/recovery/t/005_replay_delay.pl b/src/test/recovery/t/005_replay_delay.pl
index 208b278fcd1..8909c4548bf 100644
--- a/src/test/recovery/t/005_replay_delay.pl
+++ b/src/test/recovery/t/005_replay_delay.pl
@@ -40,7 +40,7 @@ $node_master->safe_psql('postgres',
"INSERT INTO tab_int VALUES (generate_series(11, 20))");
# Now wait for replay to complete on standby. We're done waiting when the
-# slave has replayed up to the previously saved master LSN.
+# standby has replayed up to the previously saved master LSN.
my $until_lsn =
$node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn()");
diff --git a/src/test/recovery/t/009_twophase.pl b/src/test/recovery/t/009_twophase.pl
index d5bcd25fed7..1d1dae66f2b 100644
--- a/src/test/recovery/t/009_twophase.pl
+++ b/src/test/recovery/t/009_twophase.pl
@@ -23,7 +23,7 @@ sub configure_and_reload
is($psql_out, 't', "reload node $name with $parameter");
}
-# Set up two nodes, which will alternately be master and replication slave.
+# Set up two nodes, which will alternately be master and replication standby.
# Setup london node
my $node_london = get_new_node("london");
@@ -46,9 +46,9 @@ $node_paris->start;
configure_and_reload($node_london, "synchronous_standby_names = 'paris'");
configure_and_reload($node_paris, "synchronous_standby_names = 'london'");
-# Set up nonce names for current master and slave nodes
-note "Initially, london is master and paris is slave";
-my ($cur_master, $cur_slave) = ($node_london, $node_paris);
+# Set up nonce names for current master and standby nodes
+note "Initially, london is master and paris is standby";
+my ($cur_master, $cur_standby) = ($node_london, $node_paris);
my $cur_master_name = $cur_master->name;
# Create table we'll use in the test transactions
@@ -163,7 +163,7 @@ is($psql_rc, '0', "Cleanup of shared memory state for 2PC commit");
$cur_master->psql('postgres', "COMMIT PREPARED 'xact_009_7'");
###############################################################################
-# Check that WAL replay will cleanup its shared memory state on running slave.
+# Check that WAL replay will cleanup its shared memory state on running standby.
###############################################################################
$cur_master->psql(
@@ -174,7 +174,7 @@ $cur_master->psql(
INSERT INTO t_009_tbl VALUES (18, 'issued to ${cur_master_name}');
PREPARE TRANSACTION 'xact_009_8';
COMMIT PREPARED 'xact_009_8';");
-$cur_slave->psql(
+$cur_standby->psql(
'postgres',
"SELECT count(*) FROM pg_prepared_xacts",
stdout => \$psql_out);
@@ -182,7 +182,7 @@ is($psql_out, '0',
"Cleanup of shared memory state on running standby without checkpoint");
###############################################################################
-# Same as in previous case, but let's force checkpoint on slave between
+# Same as in previous case, but let's force checkpoint on standby between
# prepare and commit to use on-disk twophase files.
###############################################################################
@@ -193,9 +193,9 @@ $cur_master->psql(
SAVEPOINT s1;
INSERT INTO t_009_tbl VALUES (20, 'issued to ${cur_master_name}');
PREPARE TRANSACTION 'xact_009_9';");
-$cur_slave->psql('postgres', "CHECKPOINT");
+$cur_standby->psql('postgres', "CHECKPOINT");
$cur_master->psql('postgres', "COMMIT PREPARED 'xact_009_9'");
-$cur_slave->psql(
+$cur_standby->psql(
'postgres',
"SELECT count(*) FROM pg_prepared_xacts",
stdout => \$psql_out);
@@ -203,7 +203,7 @@ is($psql_out, '0',
"Cleanup of shared memory state on running standby after checkpoint");
###############################################################################
-# Check that prepared transactions can be committed on promoted slave.
+# Check that prepared transactions can be committed on promoted standby.
###############################################################################
$cur_master->psql(
@@ -214,26 +214,26 @@ $cur_master->psql(
INSERT INTO t_009_tbl VALUES (22, 'issued to ${cur_master_name}');
PREPARE TRANSACTION 'xact_009_10';");
$cur_master->teardown_node;
-$cur_slave->promote;
+$cur_standby->promote;
# change roles
-note "Now paris is master and london is slave";
-($cur_master, $cur_slave) = ($node_paris, $node_london);
+note "Now paris is master and london is standby";
+($cur_master, $cur_standby) = ($node_paris, $node_london);
$cur_master_name = $cur_master->name;
# because london is not running at this point, we can't use syncrep commit
# on this command
$psql_rc = $cur_master->psql('postgres',
"SET synchronous_commit = off; COMMIT PREPARED 'xact_009_10'");
-is($psql_rc, '0', "Restore of prepared transaction on promoted slave");
+is($psql_rc, '0', "Restore of prepared transaction on promoted standby");
-# restart old master as new slave
-$cur_slave->enable_streaming($cur_master);
-$cur_slave->append_conf(
+# restart old master as new standby
+$cur_standby->enable_streaming($cur_master);
+$cur_standby->append_conf(
'recovery.conf', qq(
recovery_target_timeline='latest'
));
-$cur_slave->start;
+$cur_standby->start;
###############################################################################
# Check that prepared transactions are replayed after soft restart of standby
@@ -250,12 +250,12 @@ $cur_master->psql(
INSERT INTO t_009_tbl VALUES (24, 'issued to ${cur_master_name}');
PREPARE TRANSACTION 'xact_009_11';");
$cur_master->stop;
-$cur_slave->restart;
-$cur_slave->promote;
+$cur_standby->restart;
+$cur_standby->promote;
# change roles
-note "Now london is master and paris is slave";
-($cur_master, $cur_slave) = ($node_london, $node_paris);
+note "Now london is master and paris is standby";
+($cur_master, $cur_standby) = ($node_london, $node_paris);
$cur_master_name = $cur_master->name;
$cur_master->psql(
@@ -265,18 +265,18 @@ $cur_master->psql(
is($psql_out, '1',
"Restore prepared transactions from files with master down");
-# restart old master as new slave
-$cur_slave->enable_streaming($cur_master);
-$cur_slave->append_conf(
+# restart old master as new standby
+$cur_standby->enable_streaming($cur_master);
+$cur_standby->append_conf(
'recovery.conf', qq(
recovery_target_timeline='latest'
));
-$cur_slave->start;
+$cur_standby->start;
$cur_master->psql('postgres', "COMMIT PREPARED 'xact_009_11'");
###############################################################################
-# Check that prepared transactions are correctly replayed after slave hard
+# Check that prepared transactions are correctly replayed after standby hard
# restart while master is down.
###############################################################################
@@ -289,13 +289,13 @@ $cur_master->psql(
PREPARE TRANSACTION 'xact_009_12';
");
$cur_master->stop;
-$cur_slave->teardown_node;
-$cur_slave->start;
-$cur_slave->promote;
+$cur_standby->teardown_node;
+$cur_standby->start;
+$cur_standby->promote;
# change roles
-note "Now paris is master and london is slave";
-($cur_master, $cur_slave) = ($node_paris, $node_london);
+note "Now paris is master and london is standby";
+($cur_master, $cur_standby) = ($node_paris, $node_london);
$cur_master_name = $cur_master->name;
$cur_master->psql(
@@ -305,13 +305,13 @@ $cur_master->psql(
is($psql_out, '1',
"Restore prepared transactions from records with master down");
-# restart old master as new slave
-$cur_slave->enable_streaming($cur_master);
-$cur_slave->append_conf(
+# restart old master as new standby
+$cur_standby->enable_streaming($cur_master);
+$cur_standby->append_conf(
'recovery.conf', qq(
recovery_target_timeline='latest'
));
-$cur_slave->start;
+$cur_standby->start;
$cur_master->psql('postgres', "COMMIT PREPARED 'xact_009_12'");
@@ -332,7 +332,7 @@ $cur_master->psql(
CHECKPOINT;
COMMIT PREPARED 'xact_009_13';");
-$cur_slave->psql(
+$cur_standby->psql(
'postgres',
"SELECT count(*) FROM t_009_tbl2",
stdout => \$psql_out);
@@ -383,13 +383,13 @@ $cur_master->psql(
is($psql_out, qq{27|issued to paris},
"Check expected t_009_tbl2 data on master");
-$cur_slave->psql(
+$cur_standby->psql(
'postgres',
"SELECT count(*) FROM pg_prepared_xacts",
stdout => \$psql_out);
-is($psql_out, '0', "No uncommitted prepared transactions on slave");
+is($psql_out, '0', "No uncommitted prepared transactions on standby");
-$cur_slave->psql(
+$cur_standby->psql(
'postgres',
"SELECT * FROM t_009_tbl ORDER BY id",
stdout => \$psql_out);
@@ -415,11 +415,11 @@ is($psql_out, qq{1|issued to london
24|issued to paris
25|issued to london
26|issued to london},
- "Check expected t_009_tbl data on slave");
+ "Check expected t_009_tbl data on standby");
-$cur_slave->psql(
+$cur_standby->psql(
'postgres',
"SELECT * FROM t_009_tbl2",
stdout => \$psql_out);
is($psql_out, qq{27|issued to paris},
- "Check expected t_009_tbl2 data on slave");
+ "Check expected t_009_tbl2 data on standby");
diff --git a/src/test/recovery/t/012_subtransactions.pl b/src/test/recovery/t/012_subtransactions.pl
index c99733cad71..216c3331d6b 100644
--- a/src/test/recovery/t/012_subtransactions.pl
+++ b/src/test/recovery/t/012_subtransactions.pl
@@ -18,11 +18,11 @@ $node_master->start;
$node_master->backup('master_backup');
$node_master->psql('postgres', "CREATE TABLE t_012_tbl (id int)");
-# Setup slave node
-my $node_slave = get_new_node('slave');
-$node_slave->init_from_backup($node_master, 'master_backup',
+# Setup standby node
+my $node_standby = get_new_node('standby');
+$node_standby->init_from_backup($node_master, 'master_backup',
has_streaming => 1);
-$node_slave->start;
+$node_standby->start;
# Switch to synchronous replication
$node_master->append_conf(
@@ -100,31 +100,31 @@ $node_master->psql(
BEGIN;
SELECT hs_subxids(127);
COMMIT;");
-$node_master->wait_for_catchup($node_slave, 'replay',
+$node_master->wait_for_catchup($node_standby, 'replay',
$node_master->lsn('insert'));
-$node_slave->psql(
+$node_standby->psql(
'postgres',
"SELECT coalesce(sum(id),-1) FROM t_012_tbl",
stdout => \$psql_out);
is($psql_out, '8128', "Visible");
$node_master->stop;
-$node_slave->promote;
+$node_standby->promote;
-$node_slave->psql(
+$node_standby->psql(
'postgres',
"SELECT coalesce(sum(id),-1) FROM t_012_tbl",
stdout => \$psql_out);
is($psql_out, '8128', "Visible");
# restore state
-($node_master, $node_slave) = ($node_slave, $node_master);
-$node_slave->enable_streaming($node_master);
-$node_slave->append_conf(
+($node_master, $node_standby) = ($node_standby, $node_master);
+$node_standby->enable_streaming($node_master);
+$node_standby->append_conf(
'recovery.conf', qq(
recovery_target_timeline='latest'
));
-$node_slave->start;
-$node_slave->psql(
+$node_standby->start;
+$node_standby->psql(
'postgres',
"SELECT coalesce(sum(id),-1) FROM t_012_tbl",
stdout => \$psql_out);
@@ -151,33 +151,33 @@ $node_master->psql(
BEGIN;
SELECT hs_subxids(127);
PREPARE TRANSACTION 'xact_012_1';");
-$node_master->wait_for_catchup($node_slave, 'replay',
+$node_master->wait_for_catchup($node_standby, 'replay',
$node_master->lsn('insert'));
-$node_slave->psql(
+$node_standby->psql(
'postgres',
"SELECT coalesce(sum(id),-1) FROM t_012_tbl",
stdout => \$psql_out);
is($psql_out, '-1', "Not visible");
$node_master->stop;
-$node_slave->promote;
+$node_standby->promote;
-$node_slave->psql(
+$node_standby->psql(
'postgres',
"SELECT coalesce(sum(id),-1) FROM t_012_tbl",
stdout => \$psql_out);
is($psql_out, '-1', "Not visible");
# restore state
-($node_master, $node_slave) = ($node_slave, $node_master);
-$node_slave->enable_streaming($node_master);
-$node_slave->append_conf(
+($node_master, $node_standby) = ($node_standby, $node_master);
+$node_standby->enable_streaming($node_master);
+$node_standby->append_conf(
'recovery.conf', qq(
recovery_target_timeline='latest'
));
-$node_slave->start;
+$node_standby->start;
$psql_rc = $node_master->psql('postgres', "COMMIT PREPARED 'xact_012_1'");
is($psql_rc, '0',
-"Restore of PGPROC_MAX_CACHED_SUBXIDS+ prepared transaction on promoted slave"
+"Restore of PGPROC_MAX_CACHED_SUBXIDS+ prepared transaction on promoted standby"
);
$node_master->psql(
@@ -192,33 +192,33 @@ $node_master->psql(
BEGIN;
SELECT hs_subxids(201);
PREPARE TRANSACTION 'xact_012_1';");
-$node_master->wait_for_catchup($node_slave, 'replay',
+$node_master->wait_for_catchup($node_standby, 'replay',
$node_master->lsn('insert'));
-$node_slave->psql(
+$node_standby->psql(
'postgres',
"SELECT coalesce(sum(id),-1) FROM t_012_tbl",
stdout => \$psql_out);
is($psql_out, '-1', "Not visible");
$node_master->stop;
-$node_slave->promote;
+$node_standby->promote;
-$node_slave->psql(
+$node_standby->psql(
'postgres',
"SELECT coalesce(sum(id),-1) FROM t_012_tbl",
stdout => \$psql_out);
is($psql_out, '-1', "Not visible");
# restore state
-($node_master, $node_slave) = ($node_slave, $node_master);
-$node_slave->enable_streaming($node_master);
-$node_slave->append_conf(
+($node_master, $node_standby) = ($node_standby, $node_master);
+$node_standby->enable_streaming($node_master);
+$node_standby->append_conf(
'recovery.conf', qq(
recovery_target_timeline='latest'
));
-$node_slave->start;
+$node_standby->start;
$psql_rc = $node_master->psql('postgres', "ROLLBACK PREPARED 'xact_012_1'");
is($psql_rc, '0',
-"Rollback of PGPROC_MAX_CACHED_SUBXIDS+ prepared transaction on promoted slave"
+"Rollback of PGPROC_MAX_CACHED_SUBXIDS+ prepared transaction on promoted standby"
);
$node_master->psql(