mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
code: replace most remaining uses of 'master'.
Author: Andres Freund Reviewed-By: David Steele Discussion: https://postgr.es/m/20200615182235.x7lch5n6kcjq4aue@alap3.anarazel.de
This commit is contained in:
parent
7c89f8a5b8
commit
a9a4a7ad56
@ -562,11 +562,12 @@ typedef struct XLogCtlInsert
|
|||||||
char pad[PG_CACHE_LINE_SIZE];
|
char pad[PG_CACHE_LINE_SIZE];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fullPageWrites is the master copy used by all backends to determine
|
* fullPageWrites is the authoritative value used by all backends to
|
||||||
* whether to write full-page to WAL, instead of using process-local one.
|
* determine whether to write full-page image to WAL. This shared value,
|
||||||
* This is required because, when full_page_writes is changed by SIGHUP,
|
* instead of the process-local fullPageWrites, is required because, when
|
||||||
* we must WAL-log it before it actually affects WAL-logging by backends.
|
* full_page_writes is changed by SIGHUP, we must WAL-log it before it
|
||||||
* Checkpointer sets at startup or after SIGHUP.
|
* actually affects WAL-logging by backends. Checkpointer sets at startup
|
||||||
|
* or after SIGHUP.
|
||||||
*
|
*
|
||||||
* To read these fields, you must hold an insertion lock. To modify them,
|
* To read these fields, you must hold an insertion lock. To modify them,
|
||||||
* you must hold ALL the locks.
|
* you must hold ALL the locks.
|
||||||
@ -8366,8 +8367,9 @@ GetRedoRecPtr(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The possibly not up-to-date copy in XlogCtl is enough. Even if we
|
* The possibly not up-to-date copy in XlogCtl is enough. Even if we
|
||||||
* grabbed a WAL insertion lock to read the master copy, someone might
|
* grabbed a WAL insertion lock to read the authoritative value in
|
||||||
* update it just after we've released the lock.
|
* Insert->RedoRecPtr, someone might update it just after we've released
|
||||||
|
* the lock.
|
||||||
*/
|
*/
|
||||||
SpinLockAcquire(&XLogCtl->info_lck);
|
SpinLockAcquire(&XLogCtl->info_lck);
|
||||||
ptr = XLogCtl->RedoRecPtr;
|
ptr = XLogCtl->RedoRecPtr;
|
||||||
|
@ -3765,7 +3765,7 @@ reindex_relation(Oid relid, int flags, int options)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If the relation has a secondary toast rel, reindex that too while we
|
* If the relation has a secondary toast rel, reindex that too while we
|
||||||
* still hold the lock on the master table.
|
* still hold the lock on the main table.
|
||||||
*/
|
*/
|
||||||
if ((flags & REINDEX_REL_PROCESS_TOAST) && OidIsValid(toast_relid))
|
if ((flags & REINDEX_REL_PROCESS_TOAST) && OidIsValid(toast_relid))
|
||||||
result |= reindex_relation(toast_relid, flags, options);
|
result |= reindex_relation(toast_relid, flags, options);
|
||||||
|
@ -345,8 +345,8 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
|
|||||||
table_close(class_rel, RowExclusiveLock);
|
table_close(class_rel, RowExclusiveLock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register dependency from the toast table to the master, so that the
|
* Register dependency from the toast table to the main, so that the
|
||||||
* toast table will be deleted if the master is. Skip this in bootstrap
|
* toast table will be deleted if the main is. Skip this in bootstrap
|
||||||
* mode.
|
* mode.
|
||||||
*/
|
*/
|
||||||
if (!IsBootstrapProcessingMode())
|
if (!IsBootstrapProcessingMode())
|
||||||
|
@ -1897,7 +1897,7 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If the relation has a secondary toast rel, vacuum that too while we
|
* If the relation has a secondary toast rel, vacuum that too while we
|
||||||
* still hold the session lock on the master table. Note however that
|
* still hold the session lock on the main table. Note however that
|
||||||
* "analyze" will not get done on the toast table. This is good, because
|
* "analyze" will not get done on the toast table. This is good, because
|
||||||
* the toaster always uses hardcoded index access and statistics are
|
* the toaster always uses hardcoded index access and statistics are
|
||||||
* totally unimportant for toast relations.
|
* totally unimportant for toast relations.
|
||||||
@ -1906,7 +1906,7 @@ vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params)
|
|||||||
vacuum_rel(toast_relid, NULL, params);
|
vacuum_rel(toast_relid, NULL, params);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now release the session-level lock on the master table.
|
* Now release the session-level lock on the main table.
|
||||||
*/
|
*/
|
||||||
UnlockRelationIdForSession(&onerelid, lmode);
|
UnlockRelationIdForSession(&onerelid, lmode);
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ static List *tokenize_inc_file(List *tokens, const char *outer_filename,
|
|||||||
static bool parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline,
|
static bool parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline,
|
||||||
int elevel, char **err_msg);
|
int elevel, char **err_msg);
|
||||||
static bool verify_option_list_length(List *options, const char *optionname,
|
static bool verify_option_list_length(List *options, const char *optionname,
|
||||||
List *masters, const char *mastername, int line_num);
|
List *comparelist, const char *comparename, int line_num);
|
||||||
static ArrayType *gethba_options(HbaLine *hba);
|
static ArrayType *gethba_options(HbaLine *hba);
|
||||||
static void fill_hba_line(Tuplestorestate *tuple_store, TupleDesc tupdesc,
|
static void fill_hba_line(Tuplestorestate *tuple_store, TupleDesc tupdesc,
|
||||||
int lineno, HbaLine *hba, const char *err_msg);
|
int lineno, HbaLine *hba, const char *err_msg);
|
||||||
@ -1648,11 +1648,13 @@ parse_hba_line(TokenizedLine *tok_line, int elevel)
|
|||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
verify_option_list_length(List *options, const char *optionname, List *masters, const char *mastername, int line_num)
|
verify_option_list_length(List *options, const char *optionname,
|
||||||
|
List *comparelist, const char *comparename,
|
||||||
|
int line_num)
|
||||||
{
|
{
|
||||||
if (list_length(options) == 0 ||
|
if (list_length(options) == 0 ||
|
||||||
list_length(options) == 1 ||
|
list_length(options) == 1 ||
|
||||||
list_length(options) == list_length(masters))
|
list_length(options) == list_length(comparelist))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
ereport(LOG,
|
ereport(LOG,
|
||||||
@ -1660,8 +1662,8 @@ verify_option_list_length(List *options, const char *optionname, List *masters,
|
|||||||
errmsg("the number of %s (%d) must be 1 or the same as the number of %s (%d)",
|
errmsg("the number of %s (%d) must be 1 or the same as the number of %s (%d)",
|
||||||
optionname,
|
optionname,
|
||||||
list_length(options),
|
list_length(options),
|
||||||
mastername,
|
comparename,
|
||||||
list_length(masters)
|
list_length(comparelist)
|
||||||
),
|
),
|
||||||
errcontext("line %d of configuration file \"%s\"",
|
errcontext("line %d of configuration file \"%s\"",
|
||||||
line_num, HbaFileName)));
|
line_num, HbaFileName)));
|
||||||
|
@ -705,8 +705,8 @@ Setup_AF_UNIX(const char *sock_path)
|
|||||||
* server port. Set port->sock to the FD of the new connection.
|
* server port. Set port->sock to the FD of the new connection.
|
||||||
*
|
*
|
||||||
* ASSUME: that this doesn't need to be non-blocking because
|
* ASSUME: that this doesn't need to be non-blocking because
|
||||||
* the Postmaster uses select() to tell when the server master
|
* the Postmaster uses select() to tell when the socket is ready for
|
||||||
* socket is ready for accept().
|
* accept().
|
||||||
*
|
*
|
||||||
* RETURNS: STATUS_OK or STATUS_ERROR
|
* RETURNS: STATUS_OK or STATUS_ERROR
|
||||||
*/
|
*/
|
||||||
|
@ -1748,7 +1748,7 @@ inheritance_planner(PlannerInfo *root)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Put back the final adjusted rtable into the master copy of the
|
* Put back the final adjusted rtable into the original copy of the
|
||||||
* Query. (We mustn't do this if we found no non-excluded children,
|
* Query. (We mustn't do this if we found no non-excluded children,
|
||||||
* since we never saved an adjusted rtable at all.)
|
* since we never saved an adjusted rtable at all.)
|
||||||
*/
|
*/
|
||||||
@ -1757,7 +1757,7 @@ inheritance_planner(PlannerInfo *root)
|
|||||||
root->simple_rel_array = save_rel_array;
|
root->simple_rel_array = save_rel_array;
|
||||||
root->append_rel_array = save_append_rel_array;
|
root->append_rel_array = save_append_rel_array;
|
||||||
|
|
||||||
/* Must reconstruct master's simple_rte_array, too */
|
/* Must reconstruct original's simple_rte_array, too */
|
||||||
root->simple_rte_array = (RangeTblEntry **)
|
root->simple_rte_array = (RangeTblEntry **)
|
||||||
palloc0((list_length(final_rtable) + 1) * sizeof(RangeTblEntry *));
|
palloc0((list_length(final_rtable) + 1) * sizeof(RangeTblEntry *));
|
||||||
rti = 1;
|
rti = 1;
|
||||||
|
@ -15016,7 +15016,7 @@ ColLabel: IDENT { $$ = $1; }
|
|||||||
*
|
*
|
||||||
* Make sure that each keyword's category in kwlist.h matches where
|
* Make sure that each keyword's category in kwlist.h matches where
|
||||||
* it is listed here. (Someday we may be able to generate these lists and
|
* it is listed here. (Someday we may be able to generate these lists and
|
||||||
* kwlist.h's table from a common master list.)
|
* kwlist.h's table from one source of truth.)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* "Unreserved" keywords --- available for use as any kind of name.
|
/* "Unreserved" keywords --- available for use as any kind of name.
|
||||||
|
@ -22,8 +22,8 @@ At least on Linux, no platform-specific adjustment is needed.
|
|||||||
Postgres' files under src/backend/snowball/libstemmer/ and
|
Postgres' files under src/backend/snowball/libstemmer/ and
|
||||||
src/include/snowball/libstemmer/ are taken directly from the Snowball
|
src/include/snowball/libstemmer/ are taken directly from the Snowball
|
||||||
files, with only some minor adjustments of file inclusions. Note
|
files, with only some minor adjustments of file inclusions. Note
|
||||||
that most of these files are in fact derived files, not master source.
|
that most of these files are in fact derived files, not original source.
|
||||||
The master sources are in the Snowball language, and are built using
|
The original sources are in the Snowball language, and are built using
|
||||||
the Snowball-to-C compiler that is also part of the Snowball project.
|
the Snowball-to-C compiler that is also part of the Snowball project.
|
||||||
We choose to include the derived files in the PostgreSQL distribution
|
We choose to include the derived files in the PostgreSQL distribution
|
||||||
because most installations will not have the Snowball compiler available.
|
because most installations will not have the Snowball compiler available.
|
||||||
|
@ -2222,9 +2222,9 @@ RestoreSnapshot(char *start_address)
|
|||||||
* the declaration for PGPROC.
|
* the declaration for PGPROC.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
RestoreTransactionSnapshot(Snapshot snapshot, void *master_pgproc)
|
RestoreTransactionSnapshot(Snapshot snapshot, void *source_pgproc)
|
||||||
{
|
{
|
||||||
SetTransactionSnapshot(snapshot, NULL, InvalidPid, master_pgproc);
|
SetTransactionSnapshot(snapshot, NULL, InvalidPid, source_pgproc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -496,7 +496,7 @@ typedef struct ResultRelInfo
|
|||||||
/* ----------------
|
/* ----------------
|
||||||
* EState information
|
* EState information
|
||||||
*
|
*
|
||||||
* Master working state for an Executor invocation
|
* Working state for an Executor invocation
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
typedef struct EState
|
typedef struct EState
|
||||||
|
@ -153,6 +153,6 @@ extern bool HistoricSnapshotActive(void);
|
|||||||
extern Size EstimateSnapshotSpace(Snapshot snapshot);
|
extern Size EstimateSnapshotSpace(Snapshot snapshot);
|
||||||
extern void SerializeSnapshot(Snapshot snapshot, char *start_address);
|
extern void SerializeSnapshot(Snapshot snapshot, char *start_address);
|
||||||
extern Snapshot RestoreSnapshot(char *start_address);
|
extern Snapshot RestoreSnapshot(char *start_address);
|
||||||
extern void RestoreTransactionSnapshot(Snapshot snapshot, void *master_pgproc);
|
extern void RestoreTransactionSnapshot(Snapshot snapshot, void *source_pgproc);
|
||||||
|
|
||||||
#endif /* SNAPMGR_H */
|
#endif /* SNAPMGR_H */
|
||||||
|
@ -432,9 +432,9 @@ _PG_init(void)
|
|||||||
* stdout and stderr on DeleteInterp
|
* stdout and stderr on DeleteInterp
|
||||||
************************************************************/
|
************************************************************/
|
||||||
if ((pltcl_hold_interp = Tcl_CreateInterp()) == NULL)
|
if ((pltcl_hold_interp = Tcl_CreateInterp()) == NULL)
|
||||||
elog(ERROR, "could not create master Tcl interpreter");
|
elog(ERROR, "could not create dummy Tcl interpreter");
|
||||||
if (Tcl_Init(pltcl_hold_interp) == TCL_ERROR)
|
if (Tcl_Init(pltcl_hold_interp) == TCL_ERROR)
|
||||||
elog(ERROR, "could not initialize master Tcl interpreter");
|
elog(ERROR, "could not initialize dummy Tcl interpreter");
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
* Create the hash table for working interpreters
|
* Create the hash table for working interpreters
|
||||||
@ -489,14 +489,14 @@ pltcl_init_interp(pltcl_interp_desc *interp_desc, Oid prolang, bool pltrusted)
|
|||||||
char interpname[32];
|
char interpname[32];
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
* Create the Tcl interpreter as a slave of pltcl_hold_interp.
|
* Create the Tcl interpreter subsidiary to pltcl_hold_interp.
|
||||||
* Note: Tcl automatically does Tcl_Init in the untrusted case,
|
* Note: Tcl automatically does Tcl_Init in the untrusted case,
|
||||||
* and it's not wanted in the trusted case.
|
* and it's not wanted in the trusted case.
|
||||||
************************************************************/
|
************************************************************/
|
||||||
snprintf(interpname, sizeof(interpname), "slave_%u", interp_desc->user_id);
|
snprintf(interpname, sizeof(interpname), "subsidiary_%u", interp_desc->user_id);
|
||||||
if ((interp = Tcl_CreateSlave(pltcl_hold_interp, interpname,
|
if ((interp = Tcl_CreateSlave(pltcl_hold_interp, interpname,
|
||||||
pltrusted ? 1 : 0)) == NULL)
|
pltrusted ? 1 : 0)) == NULL)
|
||||||
elog(ERROR, "could not create slave Tcl interpreter");
|
elog(ERROR, "could not create subsidiary Tcl interpreter");
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
* Initialize the query hash table associated with interpreter
|
* Initialize the query hash table associated with interpreter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user