Part of the PG19 support umbrella: #8597.
The build foundation (#8601) ships a temporary LWLockNewTrancheId()
shim in src/include/pg_version_compat.h that registers every Citus
tranche under the placeholder name "citus-deferred":
#define LWLockNewTrancheId() ((LWLockNewTrancheId) ("citus-deferred"))
#define LWLockRegisterTranche(id, name) ((void) 0)
PG19 internalised tranche registration: LWLockNewTrancheId() now takes
the tranche name directly and the public two-step
LWLockRegisterTranche(id, name) API was removed. The shim keeps Citus'
pre-PG19 two-step code compiling, but the real name (previously passed to
LWLockRegisterTranche) is dropped.
Why this needs a real fix
The tranche name is user-visible: it is the wait_event reported in
pg_stat_activity / pg_wait_events when a backend waits on the lock.
Under the shim, on PG19 every Citus lightweight-lock wait shows up as
citus-deferred regardless of subsystem — a diagnostics regression vs.
PG <= 18. It is not a correctness bug (ids stay unique; locking is
unaffected), hence its own low-priority follow-up rather than blocking
the build PR.
Scope
- Pass the real tranche name to
LWLockNewTrancheId(name) at each Citus
call site; drop the now-redundant LWLockRegisterTranche() call.
- Remove the
"citus-deferred" placeholder macros from
pg_version_compat.h.
- Remove the
pg_attribute_unused() markers the build foundation added
to silence the now-unused trancheName (shardsplit_shared_memory.c,
backend_data.c; audit for others).
- Guard with
#if PG_VERSION_NUM >= PG_VERSION_19; PG <= 18 two-step
path unchanged.
Validation
PG17.10 / PG18.4 / PG19devel build green under -Werror; on PG19
pg_stat_activity.wait_event shows the correct per-subsystem name.
Plan detail: pg19-pr-plan/10-lwlock-tranche-cleanup.md (PR10).
Part of the PG19 support umbrella: #8597.
The build foundation (#8601) ships a temporary
LWLockNewTrancheId()shim in
src/include/pg_version_compat.hthat registers every Citustranche under the placeholder name
"citus-deferred":PG19 internalised tranche registration:
LWLockNewTrancheId()now takesthe tranche name directly and the public two-step
LWLockRegisterTranche(id, name)API was removed. The shim keeps Citus'pre-PG19 two-step code compiling, but the real name (previously passed to
LWLockRegisterTranche) is dropped.Why this needs a real fix
The tranche name is user-visible: it is the
wait_eventreported inpg_stat_activity/pg_wait_eventswhen a backend waits on the lock.Under the shim, on PG19 every Citus lightweight-lock wait shows up as
citus-deferredregardless of subsystem — a diagnostics regression vs.PG <= 18. It is not a correctness bug (ids stay unique; locking is
unaffected), hence its own low-priority follow-up rather than blocking
the build PR.
Scope
LWLockNewTrancheId(name)at each Cituscall site; drop the now-redundant
LWLockRegisterTranche()call."citus-deferred"placeholder macros frompg_version_compat.h.pg_attribute_unused()markers the build foundation addedto silence the now-unused
trancheName(shardsplit_shared_memory.c,backend_data.c; audit for others).#if PG_VERSION_NUM >= PG_VERSION_19; PG <= 18 two-steppath unchanged.
Validation
PG17.10 / PG18.4 / PG19devel build green under
-Werror; on PG19pg_stat_activity.wait_eventshows the correct per-subsystem name.Plan detail:
pg19-pr-plan/10-lwlock-tranche-cleanup.md(PR10).