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

Commit 1e5ef3a

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 4cc2a44 commit 1e5ef3a

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
@@ -108,7 +108,7 @@ StaticAssertDecl(LW_VAL_EXCLUSIVE > (uint32) MAX_BACKENDS,
108108
/*
109109
* There are three sorts of LWLock "tranches":
110110
*
111-
* 1. The individually-named locks defined in lwlocknames.h each have their
111+
* 1. The individually-named locks defined in lwlocklist.h each have their
112112
* own tranche. We absorb the names of these tranches from there into
113113
* BuiltinTrancheNames here.
114114
*
@@ -124,7 +124,7 @@ StaticAssertDecl(LW_VAL_EXCLUSIVE > (uint32) MAX_BACKENDS,
124124
* ... and do not forget to update the documentation's list of wait events.
125125
*/
126126
static const char *const BuiltinTrancheNames[] = {
127-
#define PG_LWLOCK(id, lockname) [id] = CppAsString(lockname) "Lock",
127+
#define PG_LWLOCK(id, lockname) [id] = CppAsString(lockname),
128128
#include "storage/lwlocklist.h"
129129
#undef PG_LWLOCK
130130
[LWTRANCHE_XACT_BUFFER] = "XactBuffer",

0 commit comments

Comments
 (0)