diff options
author | Álvaro Herrera <alvherre@alvh.no-ip.org> | 2024-12-03 15:50:03 +0100 |
---|---|---|
committer | Álvaro Herrera <alvherre@alvh.no-ip.org> | 2024-12-03 15:50:03 +0100 |
commit | 5ffbbcfa160b2e689dfb0542dfdbc4e16fc0dec9 (patch) | |
tree | 3b94c2d6e64faa40b677ce73bc641bc52d6ecc57 /src | |
parent | 7a35052a2b6e32fdcbe60d668509c35b747f89a8 (diff) | |
download | postgresql-5ffbbcfa160b2e689dfb0542dfdbc4e16fc0dec9.tar.gz postgresql-5ffbbcfa160b2e689dfb0542dfdbc4e16fc0dec9.zip |
Drop "Lock" suffix from LWLock wait event names
Commit da952b415f44 unintentially reverted the SQL-visible part of
commit 14a910109126, 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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/lmgr/generate-lwlocknames.pl | 1 | ||||
-rw-r--r-- | src/backend/storage/lmgr/lwlock.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/storage/lmgr/generate-lwlocknames.pl b/src/backend/storage/lmgr/generate-lwlocknames.pl index eaddd9d3b97..4eee6b47f15 100644 --- a/src/backend/storage/lmgr/generate-lwlocknames.pl +++ b/src/backend/storage/lmgr/generate-lwlocknames.pl @@ -107,6 +107,7 @@ while (<$lwlocklist>) $lastlockidx = $lockidx; $continue = ",\n"; + # Add a "Lock" suffix to each lock name, as the C code depends on that print $h "#define ${lockname}Lock (&MainLWLockArray[$lockidx].lock)\n"; } diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 4e1a4b1ef66..5df62fafbfb 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -111,7 +111,7 @@ StaticAssertDecl(LW_VAL_EXCLUSIVE > (uint32) MAX_BACKENDS, /* * There are three sorts of LWLock "tranches": * - * 1. The individually-named locks defined in lwlocknames.h each have their + * 1. The individually-named locks defined in lwlocklist.h each have their * own tranche. We absorb the names of these tranches from there into * BuiltinTrancheNames here. * @@ -127,7 +127,7 @@ StaticAssertDecl(LW_VAL_EXCLUSIVE > (uint32) MAX_BACKENDS, * ... and do not forget to update the documentation's list of wait events. */ static const char *const BuiltinTrancheNames[] = { -#define PG_LWLOCK(id, lockname) [id] = CppAsString(lockname) "Lock", +#define PG_LWLOCK(id, lockname) [id] = CppAsString(lockname), #include "storage/lwlocklist.h" #undef PG_LWLOCK [LWTRANCHE_XACT_BUFFER] = "XactBuffer", |