On 27/03/2026 06:49, Sami Imseih wrote:
+/* backend-local copy of NamedLWLockTranches->num_user_defined */
+static int LocalNumUserDefinedTranches;
The comment here should reference "LWLockTranches->num_user_defined "
instead.
Also, there are a few places in lwlock.c where "named tranches" is mentioned.
Maybe we should just say "user-defined tranches" instead?
Like the attached.
@@ -460,7 +460,7 @@ LWLockShmemInit(void)
}
/*
- * Initialize LWLocks that are fixed and those belonging to named tranches.
+ * Initialize LWLocks that are fixed and those belonging to user-defined
tranches.
*/
static void
InitializeLWLocks(int numLocks)
Only tranches requested with RequestNamedLWLockTranche() have locks in
the main array, so I reworded this some more to:
/*
* Initialize LWLocks for built-in tranches and those requested with
* RequestNamedLWLockTranche().
*/
Committed with that little change, thanks!
- Heikki