diff options
author | Tom Lane | 2020-05-15 18:28:19 +0000 |
---|---|---|
committer | Tom Lane | 2020-05-15 18:28:25 +0000 |
commit | 5da14938f7bfb96b648ee3c47e7ea2afca5bcc4a (patch) | |
tree | a637e548f3a39f0ebaef513f870964eb5dcecec9 /src/include | |
parent | 756abe2bc7608b38c579c510eb66f2bd80d10785 (diff) |
Rename SLRU structures and associated LWLocks.
Originally, the names assigned to SLRUs had no purpose other than
being shmem lookup keys, so not a lot of thought went into them.
As of v13, though, we're exposing them in the pg_stat_slru view and
the pg_stat_reset_slru function, so it seems advisable to take a bit
more care. Rename them to names based on the associated on-disk
storage directories (which fortunately we *did* think about, to some
extent; since those are also visible to DBAs, consistency seems like
a good thing). Also rename the associated LWLocks, since those names
are likewise user-exposed now as wait event names.
For the most part I only touched symbols used in the respective modules'
SimpleLruInit() calls, not the names of other related objects. This
renaming could have been taken further, and maybe someday we will do so.
But for now it seems undesirable to change the names of any globally
visible functions or structs, so some inconsistency is unavoidable.
(But I *did* terminate "oldserxid" with prejudice, as I found that
name both unreadable and not descriptive of the SLRU's contents.)
Table 27.12 needs re-alphabetization now, but I'll leave that till
after the other LWLock renamings I have in mind.
Discussion: https://postgr.es/m/28683.1589405363@sss.pgh.pa.us
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/multixact.h | 4 | ||||
-rw-r--r-- | src/include/access/transam.h | 2 | ||||
-rw-r--r-- | src/include/commands/async.h | 2 | ||||
-rw-r--r-- | src/include/storage/lwlock.h | 14 | ||||
-rw-r--r-- | src/include/storage/predicate.h | 4 |
5 files changed, 13 insertions, 13 deletions
diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h index af4aac08bd1..6d729008c60 100644 --- a/src/include/access/multixact.h +++ b/src/include/access/multixact.h @@ -29,8 +29,8 @@ #define MaxMultiXactOffset ((MultiXactOffset) 0xFFFFFFFF) /* Number of SLRU buffers to use for multixact */ -#define NUM_MXACTOFFSET_BUFFERS 8 -#define NUM_MXACTMEMBER_BUFFERS 16 +#define NUM_MULTIXACTOFFSET_BUFFERS 8 +#define NUM_MULTIXACTMEMBER_BUFFERS 16 /* * Possible multixact lock modes ("status"). The first four modes are for diff --git a/src/include/access/transam.h b/src/include/access/transam.h index 9a808f64ebe..a91a0c7487d 100644 --- a/src/include/access/transam.h +++ b/src/include/access/transam.h @@ -197,7 +197,7 @@ typedef struct VariableCacheData * aborted */ /* - * These fields are protected by CLogTruncationLock + * These fields are protected by XactTruncationLock */ TransactionId oldestClogXid; /* oldest it's safe to look up in clog */ diff --git a/src/include/commands/async.h b/src/include/commands/async.h index d8814e9fec6..4c35394f818 100644 --- a/src/include/commands/async.h +++ b/src/include/commands/async.h @@ -18,7 +18,7 @@ /* * The number of SLRU page buffers we use for the notification queue. */ -#define NUM_ASYNC_BUFFERS 8 +#define NUM_NOTIFY_BUFFERS 8 extern bool Trace_notify; extern volatile sig_atomic_t notifyInterruptPending; diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h index 8fda8e4f783..19ff265a4d4 100644 --- a/src/include/storage/lwlock.h +++ b/src/include/storage/lwlock.h @@ -195,13 +195,13 @@ extern void LWLockInitialize(LWLock *lock, int tranche_id); */ typedef enum BuiltinTrancheIds { - LWTRANCHE_CLOG_BUFFERS = NUM_INDIVIDUAL_LWLOCKS, - LWTRANCHE_COMMITTS_BUFFERS, - LWTRANCHE_SUBTRANS_BUFFERS, - LWTRANCHE_MXACTOFFSET_BUFFERS, - LWTRANCHE_MXACTMEMBER_BUFFERS, - LWTRANCHE_ASYNC_BUFFERS, - LWTRANCHE_OLDSERXID_BUFFERS, + LWTRANCHE_XACT_BUFFER = NUM_INDIVIDUAL_LWLOCKS, + LWTRANCHE_COMMITTS_BUFFER, + LWTRANCHE_SUBTRANS_BUFFER, + LWTRANCHE_MULTIXACTOFFSET_BUFFER, + LWTRANCHE_MULTIXACTMEMBER_BUFFER, + LWTRANCHE_NOTIFY_BUFFER, + LWTRANCHE_SERIAL_BUFFER, LWTRANCHE_WAL_INSERT, LWTRANCHE_BUFFER_CONTENT, LWTRANCHE_BUFFER_IO_IN_PROGRESS, diff --git a/src/include/storage/predicate.h b/src/include/storage/predicate.h index 9df44ed0dc7..86e756d5fb6 100644 --- a/src/include/storage/predicate.h +++ b/src/include/storage/predicate.h @@ -27,8 +27,8 @@ extern int max_predicate_locks_per_relation; extern int max_predicate_locks_per_page; -/* Number of SLRU buffers to use for predicate locking */ -#define NUM_OLDSERXID_BUFFERS 16 +/* Number of SLRU buffers to use for Serial SLRU */ +#define NUM_SERIAL_BUFFERS 16 /* * A handle used for sharing SERIALIZABLEXACT objects between the participants |