diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2020-05-14 11:10:31 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2020-05-14 11:10:31 -0400 |
commit | 29c3e2dd5a6aeaf1a23d7d83d665501e2dcc6955 (patch) | |
tree | d855391c63c8464375e49e962c3cc3ee9e171da6 /src/backend/storage/buffer/buf_init.c | |
parent | 07451e1f1adc4ff832196f1f47def13e49d2ed38 (diff) | |
download | postgresql-29c3e2dd5a6aeaf1a23d7d83d665501e2dcc6955.tar.gz postgresql-29c3e2dd5a6aeaf1a23d7d83d665501e2dcc6955.zip |
Collect built-in LWLock tranche names statically, not dynamically.
There is little point in using the LWLockRegisterTranche mechanism for
built-in tranche names. It wastes cycles, it creates opportunities for
bugs (since failing to register a tranche name is a very hard-to-detect
problem), and the lack of any centralized list of names encourages
sloppy nonconformity in name choices. Moreover, since we have a
centralized list of the tranches anyway in enum BuiltinTrancheIds, we're
certainly not buying any flexibility in return for these disadvantages.
Hence, nuke all the backend-internal LWLockRegisterTranche calls,
and instead provide a const array of the builtin tranche names.
(I have in mind to change a bunch of these names shortly, but this
patch is just about getting them into one place.)
Discussion: https://postgr.es/m/9056.1589419765@sss.pgh.pa.us
Diffstat (limited to 'src/backend/storage/buffer/buf_init.c')
-rw-r--r-- | src/backend/storage/buffer/buf_init.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/backend/storage/buffer/buf_init.c b/src/backend/storage/buffer/buf_init.c index af62d48c323..895485698a2 100644 --- a/src/backend/storage/buffer/buf_init.c +++ b/src/backend/storage/buffer/buf_init.c @@ -87,9 +87,6 @@ InitBufferPool(void) NBuffers * (Size) sizeof(LWLockMinimallyPadded), &foundIOLocks); - LWLockRegisterTranche(LWTRANCHE_BUFFER_IO_IN_PROGRESS, "buffer_io"); - LWLockRegisterTranche(LWTRANCHE_BUFFER_CONTENT, "buffer_content"); - /* * The array used to sort to-be-checkpointed buffer ids is located in * shared memory, to avoid having to allocate significant amounts of |