Skip to content

Commit 5e7bbb5

Browse files
committed
code: replace 'master' with 'primary' where appropriate.
Also changed "in the primary" to "on the primary", and added a few "the" before "primary". Author: Andres Freund Reviewed-By: David Steele Discussion: https://postgr.es/m/20200615182235.x7lch5n6kcjq4aue@alap3.anarazel.de
1 parent 229f8c2 commit 5e7bbb5

File tree

31 files changed

+110
-110
lines changed

31 files changed

+110
-110
lines changed

src/backend/access/common/bufmask.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ mask_unused_space(Page page)
8888
/*
8989
* mask_lp_flags
9090
*
91-
* In some index AMs, line pointer flags can be modified in master without
92-
* emitting any WAL record.
91+
* In some index AMs, line pointer flags can be modified on the primary
92+
* without emitting any WAL record.
9393
*/
9494
void
9595
mask_lp_flags(Page page)

src/backend/access/gist/gistxlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ gistRedoPageReuse(XLogReaderState *record)
391391
* RecentGlobalXmin test in gistPageRecyclable() conceptually mirrors the
392392
* pgxact->xmin > limitXmin test in GetConflictingVirtualXIDs().
393393
* Consequently, one XID value achieves the same exclusion effect on
394-
* master and standby.
394+
* primary and standby.
395395
*/
396396
if (InHotStandby)
397397
{

src/backend/access/heap/heapam.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,10 @@ heapgetpage(TableScanDesc sscan, BlockNumber page)
410410
* visible to everyone, we can skip the per-tuple visibility tests.
411411
*
412412
* Note: In hot standby, a tuple that's already visible to all
413-
* transactions in the master might still be invisible to a read-only
413+
* transactions on the primary might still be invisible to a read-only
414414
* transaction in the standby. We partly handle this problem by tracking
415415
* the minimum xmin of visible tuples as the cut-off XID while marking a
416-
* page all-visible on master and WAL log that along with the visibility
416+
* page all-visible on the primary and WAL log that along with the visibility
417417
* map SET operation. In hot standby, we wait for (or abort) all
418418
* transactions that can potentially may not see one or more tuples on the
419419
* page. That's how index-only scans work fine in hot standby. A crucial
@@ -6889,7 +6889,7 @@ HeapTupleHeaderAdvanceLatestRemovedXid(HeapTupleHeader tuple,
68896889
* updated/deleted by the inserting transaction.
68906890
*
68916891
* Look for a committed hint bit, or if no xmin bit is set, check clog.
6892-
* This needs to work on both master and standby, where it is used to
6892+
* This needs to work on both primary and standby, where it is used to
68936893
* assess btree delete records.
68946894
*/
68956895
if (HeapTupleHeaderXminCommitted(tuple) ||
@@ -6951,9 +6951,9 @@ xid_horizon_prefetch_buffer(Relation rel,
69516951
* tuples being deleted.
69526952
*
69536953
* We used to do this during recovery rather than on the primary, but that
6954-
* approach now appears inferior. It meant that the master could generate
6954+
* approach now appears inferior. It meant that the primary could generate
69556955
* a lot of work for the standby without any back-pressure to slow down the
6956-
* master, and it required the standby to have reached consistency, whereas
6956+
* primary, and it required the standby to have reached consistency, whereas
69576957
* we want to have correct information available even before that point.
69586958
*
69596959
* It's possible for this to generate a fair amount of I/O, since we may be
@@ -8943,7 +8943,7 @@ heap_mask(char *pagedata, BlockNumber blkno)
89438943
*
89448944
* During redo, heap_xlog_insert() sets t_ctid to current block
89458945
* number and self offset number. It doesn't care about any
8946-
* speculative insertions in master. Hence, we set t_ctid to
8946+
* speculative insertions on the primary. Hence, we set t_ctid to
89478947
* current block number and self offset number to ignore any
89488948
* inconsistency.
89498949
*/

src/backend/access/heap/pruneheap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ heap_page_prune_opt(Relation relation, Buffer buffer)
7878

7979
/*
8080
* We can't write WAL in recovery mode, so there's no point trying to
81-
* clean the page. The master will likely issue a cleaning WAL record soon
81+
* clean the page. The primary will likely issue a cleaning WAL record soon
8282
* anyway, so this is no particular loss.
8383
*/
8484
if (RecoveryInProgress())

src/backend/access/nbtree/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ writers that insert on to the page being deleted.)
574574

575575
During recovery all index scans start with ignore_killed_tuples = false
576576
and we never set kill_prior_tuple. We do this because the oldest xmin
577-
on the standby server can be older than the oldest xmin on the master
577+
on the standby server can be older than the oldest xmin on the primary
578578
server, which means tuples can be marked LP_DEAD even when they are
579579
still visible on the standby. We don't WAL log tuple LP_DEAD bits, but
580580
they can still appear in the standby because of full page writes. So

src/backend/access/nbtree/nbtxlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ btree_xlog_reuse_page(XLogReaderState *record)
932932
* RecentGlobalXmin test in _bt_page_recyclable() conceptually mirrors the
933933
* pgxact->xmin > limitXmin test in GetConflictingVirtualXIDs().
934934
* Consequently, one XID value achieves the same exclusion effect on
935-
* master and standby.
935+
* primary and standby.
936936
*/
937937
if (InHotStandby)
938938
{

src/backend/access/transam/commit_ts.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ error_commit_ts_disabled(void)
392392
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
393393
errmsg("could not get commit timestamp data"),
394394
RecoveryInProgress() ?
395-
errhint("Make sure the configuration parameter \"%s\" is set on the master server.",
395+
errhint("Make sure the configuration parameter \"%s\" is set on the primary server.",
396396
"track_commit_timestamp") :
397397
errhint("Make sure the configuration parameter \"%s\" is set.",
398398
"track_commit_timestamp")));
@@ -592,12 +592,12 @@ CommitTsParameterChange(bool newvalue, bool oldvalue)
592592
{
593593
/*
594594
* If the commit_ts module is disabled in this server and we get word from
595-
* the master server that it is enabled there, activate it so that we can
595+
* the primary server that it is enabled there, activate it so that we can
596596
* replay future WAL records involving it; also mark it as active on
597597
* pg_control. If the old value was already set, we already did this, so
598598
* don't do anything.
599599
*
600-
* If the module is disabled in the master, disable it here too, unless
600+
* If the module is disabled in the primary, disable it here too, unless
601601
* the module is enabled locally.
602602
*
603603
* Note this only runs in the recovery process, so an unlocked read is
@@ -616,12 +616,12 @@ CommitTsParameterChange(bool newvalue, bool oldvalue)
616616
* Activate this module whenever necessary.
617617
* This must happen during postmaster or standalone-backend startup,
618618
* or during WAL replay anytime the track_commit_timestamp setting is
619-
* changed in the master.
619+
* changed in the primary.
620620
*
621621
* The reason why this SLRU needs separate activation/deactivation functions is
622622
* that it can be enabled/disabled during start and the activation/deactivation
623-
* on master is propagated to standby via replay. Other SLRUs don't have this
624-
* property and they can be just initialized during normal startup.
623+
* on the primary is propagated to the standby via replay. Other SLRUs don't
624+
* have this property and they can be just initialized during normal startup.
625625
*
626626
* This is in charge of creating the currently active segment, if it's not
627627
* already there. The reason for this is that the server might have been

src/backend/access/transam/xlog.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static bool restoredFromArchive = false;
273273

274274
/* Buffers dedicated to consistency checks of size BLCKSZ */
275275
static char *replay_image_masked = NULL;
276-
static char *master_image_masked = NULL;
276+
static char *primary_image_masked = NULL;
277277

278278
/* options formerly taken from recovery.conf for archive recovery */
279279
char *recoveryRestoreCommand = NULL;
@@ -784,7 +784,7 @@ typedef enum
784784
XLOG_FROM_ANY = 0, /* request to read WAL from any source */
785785
XLOG_FROM_ARCHIVE, /* restored using restore_command */
786786
XLOG_FROM_PG_WAL, /* existing file in pg_wal */
787-
XLOG_FROM_STREAM /* streamed from master */
787+
XLOG_FROM_STREAM /* streamed from primary */
788788
} XLogSource;
789789

790790
/* human-readable names for XLogSources, for debugging output */
@@ -1478,21 +1478,21 @@ checkXLogConsistency(XLogReaderState *record)
14781478
* page here, a local buffer is fine to hold its contents and a mask
14791479
* can be directly applied on it.
14801480
*/
1481-
if (!RestoreBlockImage(record, block_id, master_image_masked))
1481+
if (!RestoreBlockImage(record, block_id, primary_image_masked))
14821482
elog(ERROR, "failed to restore block image");
14831483

14841484
/*
1485-
* If masking function is defined, mask both the master and replay
1485+
* If masking function is defined, mask both the primary and replay
14861486
* images
14871487
*/
14881488
if (RmgrTable[rmid].rm_mask != NULL)
14891489
{
14901490
RmgrTable[rmid].rm_mask(replay_image_masked, blkno);
1491-
RmgrTable[rmid].rm_mask(master_image_masked, blkno);
1491+
RmgrTable[rmid].rm_mask(primary_image_masked, blkno);
14921492
}
14931493

1494-
/* Time to compare the master and replay images. */
1495-
if (memcmp(replay_image_masked, master_image_masked, BLCKSZ) != 0)
1494+
/* Time to compare the primary and replay images. */
1495+
if (memcmp(replay_image_masked, primary_image_masked, BLCKSZ) != 0)
14961496
{
14971497
elog(FATAL,
14981498
"inconsistent page found, rel %u/%u/%u, forknum %u, blkno %u",
@@ -2301,7 +2301,7 @@ CalculateCheckpointSegments(void)
23012301
* a) we keep WAL for only one checkpoint cycle (prior to PG11 we kept
23022302
* WAL for two checkpoint cycles to allow us to recover from the
23032303
* secondary checkpoint if the first checkpoint failed, though we
2304-
* only did this on the master anyway, not on standby. Keeping just
2304+
* only did this on the primary anyway, not on standby. Keeping just
23052305
* one checkpoint simplifies processing and reduces disk space in
23062306
* many smaller databases.)
23072307
* b) during checkpoint, we consume checkpoint_completion_target *
@@ -3770,7 +3770,7 @@ XLogFileReadAnyTLI(XLogSegNo segno, int emode, XLogSource source)
37703770
* however, unless we actually find a valid segment. That way if there is
37713771
* neither a timeline history file nor a WAL segment in the archive, and
37723772
* streaming replication is set up, we'll read the timeline history file
3773-
* streamed from the master when we start streaming, instead of recovering
3773+
* streamed from the primary when we start streaming, instead of recovering
37743774
* with a dummy history generated here.
37753775
*/
37763776
if (expectedTLEs)
@@ -6057,7 +6057,7 @@ SetRecoveryPause(bool recoveryPause)
60576057

60586058
/*
60596059
* When recovery_min_apply_delay is set, we wait long enough to make sure
6060-
* certain record types are applied at least that interval behind the master.
6060+
* certain record types are applied at least that interval behind the primary.
60616061
*
60626062
* Returns true if we waited.
60636063
*
@@ -6239,7 +6239,7 @@ do { \
62396239
if ((currValue) < (minValue)) \
62406240
ereport(ERROR, \
62416241
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), \
6242-
errmsg("hot standby is not possible because %s = %d is a lower setting than on the master server (its value was %d)", \
6242+
errmsg("hot standby is not possible because %s = %d is a lower setting than on the primary server (its value was %d)", \
62436243
param_name, \
62446244
currValue, \
62456245
minValue))); \
@@ -6275,8 +6275,8 @@ CheckRequiredParameterValues(void)
62756275
{
62766276
if (ControlFile->wal_level < WAL_LEVEL_REPLICA)
62776277
ereport(ERROR,
6278-
(errmsg("hot standby is not possible because wal_level was not set to \"replica\" or higher on the master server"),
6279-
errhint("Either set wal_level to \"replica\" on the master, or turn off hot_standby here.")));
6278+
(errmsg("hot standby is not possible because wal_level was not set to \"replica\" or higher on the primary server"),
6279+
errhint("Either set wal_level to \"replica\" on the primary, or turn off hot_standby here.")));
62806280

62816281
/* We ignore autovacuum_max_workers when we make this test. */
62826282
RecoveryRequiresIntParameter("max_connections",
@@ -6502,7 +6502,7 @@ StartupXLOG(void)
65026502
* alignment, whereas palloc() will provide MAXALIGN'd storage.
65036503
*/
65046504
replay_image_masked = (char *) palloc(BLCKSZ);
6505-
master_image_masked = (char *) palloc(BLCKSZ);
6505+
primary_image_masked = (char *) palloc(BLCKSZ);
65066506

65076507
if (read_backup_label(&checkPointLoc, &backupEndRequired,
65086508
&backupFromStandby))
@@ -6631,7 +6631,7 @@ StartupXLOG(void)
66316631
* know how far we need to replay the WAL before we reach consistency.
66326632
* This can happen for example if a base backup is taken from a
66336633
* running server using an atomic filesystem snapshot, without calling
6634-
* pg_start/stop_backup. Or if you just kill a running master server
6634+
* pg_start/stop_backup. Or if you just kill a running primary server
66356635
* and put it into archive recovery by creating a recovery signal
66366636
* file.
66376637
*
@@ -6829,7 +6829,7 @@ StartupXLOG(void)
68296829
* ourselves - the history file of the recovery target timeline covers all
68306830
* the previous timelines in the history too - a cascading standby server
68316831
* might be interested in them. Or, if you archive the WAL from this
6832-
* server to a different archive than the master, it'd be good for all the
6832+
* server to a different archive than the primary, it'd be good for all the
68336833
* history files to get archived there after failover, so that you can use
68346834
* one of the old timelines as a PITR target. Timeline history files are
68356835
* small, so it's better to copy them unnecessarily than not copy them and
@@ -7065,7 +7065,7 @@ StartupXLOG(void)
70657065

70667066
/*
70677067
* If we're beginning at a shutdown checkpoint, we know that
7068-
* nothing was running on the master at this point. So fake-up an
7068+
* nothing was running on the primary at this point. So fake-up an
70697069
* empty running-xacts record and use that here and now. Recover
70707070
* additional standby state for prepared transactions.
70717071
*/
@@ -7233,7 +7233,7 @@ StartupXLOG(void)
72337233
}
72347234

72357235
/*
7236-
* If we've been asked to lag the master, wait on latch until
7236+
* If we've been asked to lag the primary, wait on latch until
72377237
* enough time has passed.
72387238
*/
72397239
if (recoveryApplyDelay(xlogreader))
@@ -7348,7 +7348,7 @@ StartupXLOG(void)
73487348
/*
73497349
* If rm_redo called XLogRequestWalReceiverReply, then we wake
73507350
* up the receiver so that it notices the updated
7351-
* lastReplayedEndRecPtr and sends a reply to the master.
7351+
* lastReplayedEndRecPtr and sends a reply to the primary.
73527352
*/
73537353
if (doRequestWalReceiverReply)
73547354
{
@@ -9949,7 +9949,7 @@ xlog_redo(XLogReaderState *record)
99499949

99509950
/*
99519951
* If we see a shutdown checkpoint, we know that nothing was running
9952-
* on the master at this point. So fake-up an empty running-xacts
9952+
* on the primary at this point. So fake-up an empty running-xacts
99539953
* record and use that here and now. Recover additional standby state
99549954
* for prepared transactions.
99559955
*/
@@ -10663,7 +10663,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
1066310663
"since last restartpoint"),
1066410664
errhint("This means that the backup being taken on the standby "
1066510665
"is corrupt and should not be used. "
10666-
"Enable full_page_writes and run CHECKPOINT on the master, "
10666+
"Enable full_page_writes and run CHECKPOINT on the primary, "
1066710667
"and then try an online backup again.")));
1066810668

1066910669
/*
@@ -10811,7 +10811,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
1081110811
appendStringInfo(labelfile, "BACKUP METHOD: %s\n",
1081210812
exclusive ? "pg_start_backup" : "streamed");
1081310813
appendStringInfo(labelfile, "BACKUP FROM: %s\n",
10814-
backup_started_in_recovery ? "standby" : "master");
10814+
backup_started_in_recovery ? "standby" : "primary");
1081510815
appendStringInfo(labelfile, "START TIME: %s\n", strfbuf);
1081610816
appendStringInfo(labelfile, "LABEL: %s\n", backupidstr);
1081710817
appendStringInfo(labelfile, "START TIMELINE: %u\n", starttli);
@@ -11246,7 +11246,7 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
1124611246
"during online backup"),
1124711247
errhint("This means that the backup being taken on the standby "
1124811248
"is corrupt and should not be used. "
11249-
"Enable full_page_writes and run CHECKPOINT on the master, "
11249+
"Enable full_page_writes and run CHECKPOINT on the primary, "
1125011250
"and then try an online backup again.")));
1125111251

1125211252

@@ -11928,7 +11928,7 @@ XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr, int reqLen,
1192811928
Assert(readFile != -1);
1192911929

1193011930
/*
11931-
* If the current segment is being streamed from master, calculate how
11931+
* If the current segment is being streamed from the primary, calculate how
1193211932
* much of the current page we have received already. We know the
1193311933
* requested record has been received, but this is for the benefit of
1193411934
* future calls, to allow quick exit at the top of this function.
@@ -11989,8 +11989,8 @@ XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr, int reqLen,
1198911989
* example, imagine a scenario where a streaming replica is started up,
1199011990
* and replay reaches a record that's split across two WAL segments. The
1199111991
* first page is only available locally, in pg_wal, because it's already
11992-
* been recycled in the master. The second page, however, is not present
11993-
* in pg_wal, and we should stream it from the master. There is a recycled
11992+
* been recycled on the primary. The second page, however, is not present
11993+
* in pg_wal, and we should stream it from the primary. There is a recycled
1199411994
* WAL segment present in pg_wal, with garbage contents, however. We would
1199511995
* read the first page from the local WAL segment, but when reading the
1199611996
* second page, we would read the bogus, recycled, WAL segment. If we
@@ -12150,7 +12150,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
1215012150
* Failure while streaming. Most likely, we got here
1215112151
* because streaming replication was terminated, or
1215212152
* promotion was triggered. But we also get here if we
12153-
* find an invalid record in the WAL streamed from master,
12153+
* find an invalid record in the WAL streamed from the primary,
1215412154
* in which case something is seriously wrong. There's
1215512155
* little chance that the problem will just go away, but
1215612156
* PANIC is not good for availability either, especially
@@ -12511,7 +12511,7 @@ StartupRequestWalReceiverRestart(void)
1251112511
* we're retrying the exact same record that we've tried previously, only
1251212512
* complain the first time to keep the noise down. However, we only do when
1251312513
* reading from pg_wal, because we don't expect any invalid records in archive
12514-
* or in records streamed from master. Files in the archive should be complete,
12514+
* or in records streamed from the primary. Files in the archive should be complete,
1251512515
* and we should never hit the end of WAL because we stop and wait for more WAL
1251612516
* to arrive before replaying it.
1251712517
*

src/backend/access/transam/xlogutils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,8 @@ XLogTruncateRelation(RelFileNode rnode, ForkNumber forkNum,
654654
*
655655
* We care about timelines in xlogreader when we might be reading xlog
656656
* generated prior to a promotion, either if we're currently a standby in
657-
* recovery or if we're a promoted master reading xlogs generated by the old
658-
* master before our promotion.
657+
* recovery or if we're a promoted primary reading xlogs generated by the old
658+
* primary before our promotion.
659659
*
660660
* wantPage must be set to the start address of the page to read and
661661
* wantLength to the amount of the page that will be read, up to
@@ -878,7 +878,7 @@ read_local_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr,
878878
* we actually read the xlog page, we might still try to read from the
879879
* old (now renamed) segment and fail. There's not much we can do
880880
* about this, but it can only happen when we're a leaf of a cascading
881-
* standby whose master gets promoted while we're decoding, so a
881+
* standby whose primary gets promoted while we're decoding, so a
882882
* one-off ERROR isn't too bad.
883883
*/
884884
XLogReadDetermineTimeline(state, targetPagePtr, reqLen);

src/backend/catalog/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3969,7 +3969,7 @@ InitTempTableNamespace(void)
39693969
* Do not allow a Hot Standby session to make temp tables. Aside from
39703970
* problems with modifying the system catalogs, there is a naming
39713971
* conflict: pg_temp_N belongs to the session with BackendId N on the
3972-
* master, not to a hot standby session with the same BackendId. We
3972+
* primary, not to a hot standby session with the same BackendId. We
39733973
* should not be able to get here anyway due to XactReadOnly checks, but
39743974
* let's just make real sure. Note that this also backstops various
39753975
* operations that allow XactReadOnly transactions to modify temp tables;

src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3676,7 +3676,7 @@ AlterTableInternal(Oid relid, List *cmds, bool recurse)
36763676
* and does not travel through this section of code and cannot be combined with
36773677
* any of the subcommands given here.
36783678
*
3679-
* Note that Hot Standby only knows about AccessExclusiveLocks on the master
3679+
* Note that Hot Standby only knows about AccessExclusiveLocks on the primary
36803680
* so any changes that might affect SELECTs running on standbys need to use
36813681
* AccessExclusiveLocks even if you think a lesser lock would do, unless you
36823682
* have a solution for that also.

0 commit comments

Comments
 (0)