Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1ef920

Browse files
committed
Remove uses of "slave" in replication contexts
This affects mostly code comments, some documentation, and tests. Official APIs already used "standby".
1 parent d6391b0 commit a1ef920

File tree

21 files changed

+103
-103
lines changed

21 files changed

+103
-103
lines changed

contrib/dblink/expected/dblink.out

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ SELECT *
270270
FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
271271
WHERE t.a > 7;
272272
ERROR: connection not available
273-
-- put more data into our slave table, first using arbitrary connection syntax
273+
-- put more data into our table, first using arbitrary connection syntax
274274
-- but truncate the actual return value so we can use diff to check for success
275275
SELECT substr(dblink_exec(connection_parameters(),'INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
276276
substr
@@ -285,7 +285,7 @@ SELECT dblink_connect(connection_parameters());
285285
OK
286286
(1 row)
287287

288-
-- put more data into our slave table, using persistent connection syntax
288+
-- put more data into our table, using persistent connection syntax
289289
-- but truncate the actual return value so we can use diff to check for success
290290
SELECT substr(dblink_exec('INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
291291
substr
@@ -610,7 +610,7 @@ SELECT dblink_connect('myconn',connection_parameters());
610610
OK
611611
(1 row)
612612

613-
-- put more data into our slave table, using named persistent connection syntax
613+
-- put more data into our table, using named persistent connection syntax
614614
-- but truncate the actual return value so we can use diff to check for success
615615
SELECT substr(dblink_exec('myconn','INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
616616
substr

contrib/dblink/sql/dblink.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@ SELECT *
160160
FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
161161
WHERE t.a > 7;
162162

163-
-- put more data into our slave table, first using arbitrary connection syntax
163+
-- put more data into our table, first using arbitrary connection syntax
164164
-- but truncate the actual return value so we can use diff to check for success
165165
SELECT substr(dblink_exec(connection_parameters(),'INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
166166

167167
-- create a persistent connection
168168
SELECT dblink_connect(connection_parameters());
169169

170-
-- put more data into our slave table, using persistent connection syntax
170+
-- put more data into our table, using persistent connection syntax
171171
-- but truncate the actual return value so we can use diff to check for success
172172
SELECT substr(dblink_exec('INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
173173

@@ -316,7 +316,7 @@ WHERE t.a > 7;
316316
-- create a named persistent connection
317317
SELECT dblink_connect('myconn',connection_parameters());
318318

319-
-- put more data into our slave table, using named persistent connection syntax
319+
-- put more data into our table, using named persistent connection syntax
320320
-- but truncate the actual return value so we can use diff to check for success
321321
SELECT substr(dblink_exec('myconn','INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
322322

doc/src/sgml/high-availability.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
server to modify the data. Servers that can modify data are
4141
called read/write, <firstterm>master</> or <firstterm>primary</> servers.
4242
Servers that track changes in the master are called <firstterm>standby</>
43-
or <firstterm>slave</> servers. A standby server that cannot be connected
43+
or <firstterm>secondary</> servers. A standby server that cannot be connected
4444
to until it is promoted to a master server is called a <firstterm>warm
4545
standby</> server, and one that can accept connections and serves read-only
4646
queries is called a <firstterm>hot standby</> server.

doc/src/sgml/ref/pgupgrade.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ pg_upgrade.exe
483483

484484
<para>
485485
From a directory that is above the old and new database cluster
486-
directories, run this for each slave:
486+
directories, run this for each standby:
487487

488488
<programlisting>
489489
rsync --archive --delete --hard-links --size-only old_pgdata new_pgdata remote_dir
@@ -517,7 +517,7 @@ rsync --archive --delete --hard-links --size-only old_pgdata new_pgdata remote_d
517517
<para>
518518
Configure the servers for log shipping. (You do not need to run
519519
<function>pg_start_backup()</> and <function>pg_stop_backup()</>
520-
or take a file system backup as the slaves are still synchronized
520+
or take a file system backup as the standbys are still synchronized
521521
with the master.)
522522
</para>
523523
</step>

src/backend/access/transam/commit_ts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ CommitTsParameterChange(bool newvalue, bool oldvalue)
621621
*
622622
* The reason why this SLRU needs separate activation/deactivation functions is
623623
* that it can be enabled/disabled during start and the activation/deactivation
624-
* on master is propagated to slave via replay. Other SLRUs don't have this
624+
* on master is propagated to standby via replay. Other SLRUs don't have this
625625
* property and they can be just initialized during normal startup.
626626
*
627627
* This is in charge of creating the currently active segment, if it's not

src/backend/access/transam/multixact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
939939

940940
debug_elog3(DEBUG2, "GetNew: for %d xids", nmembers);
941941

942-
/* safety check, we should never get this far in a HS slave */
942+
/* safety check, we should never get this far in a HS standby */
943943
if (RecoveryInProgress())
944944
elog(ERROR, "cannot assign MultiXactIds during recovery");
945945

src/backend/access/transam/varsup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ GetNewTransactionId(bool isSubXact)
6767
return BootstrapTransactionId;
6868
}
6969

70-
/* safety check, we should never get this far in a HS slave */
70+
/* safety check, we should never get this far in a HS standby */
7171
if (RecoveryInProgress())
7272
elog(ERROR, "cannot assign TransactionIds during recovery");
7373

@@ -468,7 +468,7 @@ GetNewObjectId(void)
468468
{
469469
Oid result;
470470

471-
/* safety check, we should never get this far in a HS slave */
471+
/* safety check, we should never get this far in a HS standby */
472472
if (RecoveryInProgress())
473473
elog(ERROR, "cannot assign OIDs during recovery");
474474

src/backend/catalog/namespace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3802,10 +3802,10 @@ InitTempTableNamespace(void)
38023802
get_database_name(MyDatabaseId))));
38033803

38043804
/*
3805-
* Do not allow a Hot Standby slave session to make temp tables. Aside
3805+
* Do not allow a Hot Standby session to make temp tables. Aside
38063806
* from problems with modifying the system catalogs, there is a naming
38073807
* conflict: pg_temp_N belongs to the session with BackendId N on the
3808-
* master, not to a slave session with the same BackendId. We should not
3808+
* master, not to a hot standby session with the same BackendId. We should not
38093809
* be able to get here anyway due to XactReadOnly checks, but let's just
38103810
* make real sure. Note that this also backstops various operations that
38113811
* allow XactReadOnly transactions to modify temp tables; they'd need

src/backend/commands/variable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ show_log_timezone(void)
472472
* We allow idempotent changes (r/w -> r/w and r/o -> r/o) at any time, and
473473
* we also always allow changes from read-write to read-only. However,
474474
* read-only may be changed to read-write only when in a top-level transaction
475-
* that has not yet taken an initial snapshot. Can't do it in a hot standby
476-
* slave, either.
475+
* that has not yet taken an initial snapshot. Can't do it in a hot standby,
476+
* either.
477477
*
478478
* If we are not in a transaction at all, just allow the change; it means
479479
* nothing since XactReadOnly will be reset by the next StartTransaction().

src/backend/executor/execMain.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,8 @@ ExecCheckRTEPermsModified(Oid relOid, Oid userid, Bitmapset *modifiedCols,
759759
* unless we're in parallel mode, in which case don't even allow writes
760760
* to temp tables.
761761
*
762-
* Note: in a Hot Standby slave this would need to reject writes to temp
763-
* tables just as we do in parallel mode; but an HS slave can't have created
762+
* Note: in a Hot Standby this would need to reject writes to temp
763+
* tables just as we do in parallel mode; but an HS standby can't have created
764764
* any temp tables in the first place, so no need to check that.
765765
*/
766766
static void

src/backend/replication/walsender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2572,7 +2572,7 @@ XLogSendPhysical(void)
25722572
* fsync'd to disk. We cannot go further than what's been written out
25732573
* given the current implementation of XLogRead(). And in any case
25742574
* it's unsafe to send WAL that is not securely down to disk on the
2575-
* master: if the master subsequently crashes and restarts, slaves
2575+
* master: if the master subsequently crashes and restarts, standbys
25762576
* must not have applied any WAL that got lost on the master.
25772577
*/
25782578
SendRqstPtr = GetFlushRecPtr();

src/backend/storage/ipc/procarray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ GetOldestXmin(Relation rel, int flags)
14081408
* being careful not to generate a "permanent" XID.
14091409
*
14101410
* vacuum_defer_cleanup_age provides some additional "slop" for the
1411-
* benefit of hot standby queries on slave servers. This is quick and
1411+
* benefit of hot standby queries on standby servers. This is quick and
14121412
* dirty, and perhaps not all that useful unless the master has a
14131413
* predictable transaction rate, but it offers some protection when
14141414
* there's no walsender connection. Note that we are assuming

src/backend/tcop/utility.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ PreventCommandIfParallelMode(const char *cmdname)
264264
/*
265265
* PreventCommandDuringRecovery: throw error if RecoveryInProgress
266266
*
267-
* The majority of operations that are unsafe in a Hot Standby slave
267+
* The majority of operations that are unsafe in a Hot Standby
268268
* will be rejected by XactReadOnly tests. However there are a few
269269
* commands that are allowed in "read-only" xacts but cannot be allowed
270270
* in Hot Standby mode. Those commands should call this function.

src/bin/pg_dump/pg_dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ main(int argc, char **argv)
676676
dopt.no_security_labels = 1;
677677

678678
/*
679-
* On hot standby slaves, never try to dump unlogged table data, since it
679+
* On hot standbys, never try to dump unlogged table data, since it
680680
* will just throw an error.
681681
*/
682682
if (fout->isStandby)

src/bin/pg_rewind/RewindTest.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ sub promote_standby
160160
$node_master->poll_query_until('postgres', $wal_received_query)
161161
or die "Timed out while waiting for standby to receive and write WAL";
162162

163-
# Now promote slave and insert some new data on master, this will put
163+
# Now promote standby and insert some new data on master, this will put
164164
# the master out-of-sync with the standby.
165165
$node_standby->promote;
166166

src/test/modules/commit_ts/t/002_standby.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
$master->safe_psql('postgres', 'select pg_current_wal_lsn()');
3535
$standby->poll_query_until('postgres',
3636
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()})
37-
or die "slave never caught up";
37+
or die "standby never caught up";
3838

3939
my $standby_ts = $standby->safe_psql('postgres',
4040
qq{select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname = 't10'}
@@ -47,7 +47,7 @@
4747
$master_lsn = $master->safe_psql('postgres', 'select pg_current_wal_lsn()');
4848
$standby->poll_query_until('postgres',
4949
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()})
50-
or die "slave never caught up";
50+
or die "standby never caught up";
5151
$standby->safe_psql('postgres', 'checkpoint');
5252

5353
# This one should raise an error now

src/test/modules/commit_ts/t/003_standby_2.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
$master->safe_psql('postgres', 'select pg_current_wal_lsn()');
3434
$standby->poll_query_until('postgres',
3535
qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()})
36-
or die "slave never caught up";
36+
or die "standby never caught up";
3737

3838
$standby->safe_psql('postgres', 'checkpoint');
3939
$standby->restart;

src/test/recovery/t/002_archiving.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Start it
1717
$node_master->start;
1818

19-
# Take backup for slave
19+
# Take backup for standby
2020
$node_master->backup($backup_name);
2121

2222
# Initialize standby node from backup, fetching WAL from archives

src/test/recovery/t/005_replay_delay.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"INSERT INTO tab_int VALUES (generate_series(11, 20))");
4141

4242
# Now wait for replay to complete on standby. We're done waiting when the
43-
# slave has replayed up to the previously saved master LSN.
43+
# standby has replayed up to the previously saved master LSN.
4444
my $until_lsn =
4545
$node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn()");
4646

0 commit comments

Comments
 (0)