Skip to content

Commit 5ffbbcf

Browse files
committed
Drop "Lock" suffix from LWLock wait event names
Commit da952b4 unintentially reverted the SQL-visible part of commit 14a9101, which breaks queries joining pg_wait_events with pg_stat_acivity. Remove the suffix again. Backpatch to 17. Reported-by: Christophe Courtois <christophe.courtois@dalibo.com> Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com> Discussion: https://postgr.es/m/18728-450924477056a339%40postgresql.org Discussion: https://postgr.es/m/Z01w1+LihtRiS0Te@ip-10-97-1-34.eu-west-3.compute.internal
1 parent 7a35052 commit 5ffbbcf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/backend/storage/lmgr/generate-lwlocknames.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
$lastlockidx = $lockidx;
108108
$continue = ",\n";
109109

110+
# Add a "Lock" suffix to each lock name, as the C code depends on that
110111
print $h "#define ${lockname}Lock (&MainLWLockArray[$lockidx].lock)\n";
111112
}
112113

src/backend/storage/lmgr/lwlock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ StaticAssertDecl(LW_VAL_EXCLUSIVE > (uint32) MAX_BACKENDS,
111111
/*
112112
* There are three sorts of LWLock "tranches":
113113
*
114-
* 1. The individually-named locks defined in lwlocknames.h each have their
114+
* 1. The individually-named locks defined in lwlocklist.h each have their
115115
* own tranche. We absorb the names of these tranches from there into
116116
* BuiltinTrancheNames here.
117117
*
@@ -127,7 +127,7 @@ StaticAssertDecl(LW_VAL_EXCLUSIVE > (uint32) MAX_BACKENDS,
127127
* ... and do not forget to update the documentation's list of wait events.
128128
*/
129129
static const char *const BuiltinTrancheNames[] = {
130-
#define PG_LWLOCK(id, lockname) [id] = CppAsString(lockname) "Lock",
130+
#define PG_LWLOCK(id, lockname) [id] = CppAsString(lockname),
131131
#include "storage/lwlocklist.h"
132132
#undef PG_LWLOCK
133133
[LWTRANCHE_XACT_BUFFER] = "XactBuffer",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy