Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a9a4a7a

Browse files
committed
code: replace most remaining uses of 'master'.
Author: Andres Freund Reviewed-By: David Steele Discussion: https://postgr.es/m/20200615182235.x7lch5n6kcjq4aue@alap3.anarazel.de
1 parent 7c89f8a commit a9a4a7a

File tree

13 files changed

+37
-33
lines changed

13 files changed

+37
-33
lines changed

src/backend/access/transam/xlog.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,12 @@ typedef struct XLogCtlInsert
562562
char pad[PG_CACHE_LINE_SIZE];
563563

564564
/*
565-
* fullPageWrites is the master copy used by all backends to determine
566-
* whether to write full-page to WAL, instead of using process-local one.
567-
* This is required because, when full_page_writes is changed by SIGHUP,
568-
* we must WAL-log it before it actually affects WAL-logging by backends.
569-
* Checkpointer sets at startup or after SIGHUP.
565+
* fullPageWrites is the authoritative value used by all backends to
566+
* determine whether to write full-page image to WAL. This shared value,
567+
* instead of the process-local fullPageWrites, is required because, when
568+
* full_page_writes is changed by SIGHUP, we must WAL-log it before it
569+
* actually affects WAL-logging by backends. Checkpointer sets at startup
570+
* or after SIGHUP.
570571
*
571572
* To read these fields, you must hold an insertion lock. To modify them,
572573
* you must hold ALL the locks.
@@ -8366,8 +8367,9 @@ GetRedoRecPtr(void)
83668367

83678368
/*
83688369
* The possibly not up-to-date copy in XlogCtl is enough. Even if we
8369-
* grabbed a WAL insertion lock to read the master copy, someone might
8370-
* update it just after we've released the lock.
8370+
* grabbed a WAL insertion lock to read the authoritative value in
8371+
* Insert->RedoRecPtr, someone might update it just after we've released
8372+
* the lock.
83718373
*/
83728374
SpinLockAcquire(&XLogCtl->info_lck);
83738375
ptr = XLogCtl->RedoRecPtr;

src/backend/catalog/index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3765,7 +3765,7 @@ reindex_relation(Oid relid, int flags, int options)
37653765

37663766
/*
37673767
* If the relation has a secondary toast rel, reindex that too while we
3768-
* still hold the lock on the master table.
3768+
* still hold the lock on the main table.
37693769
*/
37703770
if ((flags & REINDEX_REL_PROCESS_TOAST) && OidIsValid(toast_relid))
37713771
result |= reindex_relation(toast_relid, flags, options);

src/backend/catalog/toasting.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
345345
table_close(class_rel, RowExclusiveLock);
346346

347347
/*
348-
* Register dependency from the toast table to the master, so that the
349-
* toast table will be deleted if the master is. Skip this in bootstrap
348+
* Register dependency from the toast table to the main, so that the
349+
* toast table will be deleted if the main is. Skip this in bootstrap
350350
* mode.
351351
*/
352352
if (!IsBootstrapProcessingMode())

src/backend/commands/vacuum.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,7 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params)
18971897

18981898
/*
18991899
* If the relation has a secondary toast rel, vacuum that too while we
1900-
* still hold the session lock on the master table. Note however that
1900+
* still hold the session lock on the main table. Note however that
19011901
* "analyze" will not get done on the toast table. This is good, because
19021902
* the toaster always uses hardcoded index access and statistics are
19031903
* totally unimportant for toast relations.
@@ -1906,7 +1906,7 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params)
19061906
vacuum_rel(toast_relid, NULL, params);
19071907

19081908
/*
1909-
* Now release the session-level lock on the master table.
1909+
* Now release the session-level lock on the main table.
19101910
*/
19111911
UnlockRelationIdForSession(&onerelid, lmode);
19121912

src/backend/libpq/hba.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static List *tokenize_inc_file(List *tokens, const char *outer_filename,
145145
static bool parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline,
146146
int elevel, char **err_msg);
147147
static bool verify_option_list_length(List *options, const char *optionname,
148-
List *masters, const char *mastername, int line_num);
148+
List *comparelist, const char *comparename, int line_num);
149149
static ArrayType *gethba_options(HbaLine *hba);
150150
static void fill_hba_line(Tuplestorestate *tuple_store, TupleDesc tupdesc,
151151
int lineno, HbaLine *hba, const char *err_msg);
@@ -1648,20 +1648,22 @@ parse_hba_line(TokenizedLine *tok_line, int elevel)
16481648

16491649

16501650
static bool
1651-
verify_option_list_length(List *options, const char *optionname, List *masters, const char *mastername, int line_num)
1651+
verify_option_list_length(List *options, const char *optionname,
1652+
List *comparelist, const char *comparename,
1653+
int line_num)
16521654
{
16531655
if (list_length(options) == 0 ||
16541656
list_length(options) == 1 ||
1655-
list_length(options) == list_length(masters))
1657+
list_length(options) == list_length(comparelist))
16561658
return true;
16571659

16581660
ereport(LOG,
16591661
(errcode(ERRCODE_CONFIG_FILE_ERROR),
16601662
errmsg("the number of %s (%d) must be 1 or the same as the number of %s (%d)",
16611663
optionname,
16621664
list_length(options),
1663-
mastername,
1664-
list_length(masters)
1665+
comparename,
1666+
list_length(comparelist)
16651667
),
16661668
errcontext("line %d of configuration file \"%s\"",
16671669
line_num, HbaFileName)));

src/backend/libpq/pqcomm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,8 @@ Setup_AF_UNIX(const char *sock_path)
705705
* server port. Set port->sock to the FD of the new connection.
706706
*
707707
* ASSUME: that this doesn't need to be non-blocking because
708-
* the Postmaster uses select() to tell when the server master
709-
* socket is ready for accept().
708+
* the Postmaster uses select() to tell when the socket is ready for
709+
* accept().
710710
*
711711
* RETURNS: STATUS_OK or STATUS_ERROR
712712
*/

src/backend/optimizer/plan/planner.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ inheritance_planner(PlannerInfo *root)
17481748
else
17491749
{
17501750
/*
1751-
* Put back the final adjusted rtable into the master copy of the
1751+
* Put back the final adjusted rtable into the original copy of the
17521752
* Query. (We mustn't do this if we found no non-excluded children,
17531753
* since we never saved an adjusted rtable at all.)
17541754
*/
@@ -1757,7 +1757,7 @@ inheritance_planner(PlannerInfo *root)
17571757
root->simple_rel_array = save_rel_array;
17581758
root->append_rel_array = save_append_rel_array;
17591759

1760-
/* Must reconstruct master's simple_rte_array, too */
1760+
/* Must reconstruct original's simple_rte_array, too */
17611761
root->simple_rte_array = (RangeTblEntry **)
17621762
palloc0((list_length(final_rtable) + 1) * sizeof(RangeTblEntry *));
17631763
rti = 1;

src/backend/parser/gram.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15016,7 +15016,7 @@ ColLabel: IDENT { $$ = $1; }
1501615016
*
1501715017
* Make sure that each keyword's category in kwlist.h matches where
1501815018
* it is listed here. (Someday we may be able to generate these lists and
15019-
* kwlist.h's table from a common master list.)
15019+
* kwlist.h's table from one source of truth.)
1502015020
*/
1502115021

1502215022
/* "Unreserved" keywords --- available for use as any kind of name.

src/backend/snowball/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ At least on Linux, no platform-specific adjustment is needed.
2222
Postgres' files under src/backend/snowball/libstemmer/ and
2323
src/include/snowball/libstemmer/ are taken directly from the Snowball
2424
files, with only some minor adjustments of file inclusions. Note
25-
that most of these files are in fact derived files, not master source.
26-
The master sources are in the Snowball language, and are built using
25+
that most of these files are in fact derived files, not original source.
26+
The original sources are in the Snowball language, and are built using
2727
the Snowball-to-C compiler that is also part of the Snowball project.
2828
We choose to include the derived files in the PostgreSQL distribution
2929
because most installations will not have the Snowball compiler available.

src/backend/utils/time/snapmgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,9 +2222,9 @@ RestoreSnapshot(char *start_address)
22222222
* the declaration for PGPROC.
22232223
*/
22242224
void
2225-
RestoreTransactionSnapshot(Snapshot snapshot, void *master_pgproc)
2225+
RestoreTransactionSnapshot(Snapshot snapshot, void *source_pgproc)
22262226
{
2227-
SetTransactionSnapshot(snapshot, NULL, InvalidPid, master_pgproc);
2227+
SetTransactionSnapshot(snapshot, NULL, InvalidPid, source_pgproc);
22282228
}
22292229

22302230
/*

src/include/nodes/execnodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ typedef struct ResultRelInfo
496496
/* ----------------
497497
* EState information
498498
*
499-
* Master working state for an Executor invocation
499+
* Working state for an Executor invocation
500500
* ----------------
501501
*/
502502
typedef struct EState

src/include/utils/snapmgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ extern bool HistoricSnapshotActive(void);
153153
extern Size EstimateSnapshotSpace(Snapshot snapshot);
154154
extern void SerializeSnapshot(Snapshot snapshot, char *start_address);
155155
extern Snapshot RestoreSnapshot(char *start_address);
156-
extern void RestoreTransactionSnapshot(Snapshot snapshot, void *master_pgproc);
156+
extern void RestoreTransactionSnapshot(Snapshot snapshot, void *source_pgproc);
157157

158158
#endif /* SNAPMGR_H */

src/pl/tcl/pltcl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ _PG_init(void)
432432
* stdout and stderr on DeleteInterp
433433
************************************************************/
434434
if ((pltcl_hold_interp = Tcl_CreateInterp()) == NULL)
435-
elog(ERROR, "could not create master Tcl interpreter");
435+
elog(ERROR, "could not create dummy Tcl interpreter");
436436
if (Tcl_Init(pltcl_hold_interp) == TCL_ERROR)
437-
elog(ERROR, "could not initialize master Tcl interpreter");
437+
elog(ERROR, "could not initialize dummy Tcl interpreter");
438438

439439
/************************************************************
440440
* Create the hash table for working interpreters
@@ -489,14 +489,14 @@ pltcl_init_interp(pltcl_interp_desc *interp_desc, Oid prolang, bool pltrusted)
489489
char interpname[32];
490490

491491
/************************************************************
492-
* Create the Tcl interpreter as a slave of pltcl_hold_interp.
492+
* Create the Tcl interpreter subsidiary to pltcl_hold_interp.
493493
* Note: Tcl automatically does Tcl_Init in the untrusted case,
494494
* and it's not wanted in the trusted case.
495495
************************************************************/
496-
snprintf(interpname, sizeof(interpname), "slave_%u", interp_desc->user_id);
496+
snprintf(interpname, sizeof(interpname), "subsidiary_%u", interp_desc->user_id);
497497
if ((interp = Tcl_CreateSlave(pltcl_hold_interp, interpname,
498498
pltrusted ? 1 : 0)) == NULL)
499-
elog(ERROR, "could not create slave Tcl interpreter");
499+
elog(ERROR, "could not create subsidiary Tcl interpreter");
500500

501501
/************************************************************
502502
* Initialize the query hash table associated with interpreter

0 commit comments

Comments
 (0)