From d8d4febb3ce7cd3c9d223deb401802e3e58ce071 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 26 Sep 2025 12:15:34 -0400 Subject: [PATCH] stab in the dark to cope with LWLockNewTrancheId signature change --- contrib/pg_plan_advice/pg_plan_advice.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/contrib/pg_plan_advice/pg_plan_advice.c b/contrib/pg_plan_advice/pg_plan_advice.c index 76613c6d20..2284c25fc8 100644 --- a/contrib/pg_plan_advice/pg_plan_advice.c +++ b/contrib/pg_plan_advice/pg_plan_advice.c @@ -121,8 +121,8 @@ pgpa_init_shared_state(void *ptr) { pgpa_shared_state *state = (pgpa_shared_state *) ptr; - LWLockInitialize(&state->lock, LWLockNewTrancheId()); - state->dsa_tranche = LWLockNewTrancheId(); + LWLockInitialize(&state->lock, LWLockNewTrancheId("pg_plan_advice_lock")); + state->dsa_tranche = LWLockNewTrancheId("pg_plan_advice_dsa"); state->area = DSA_HANDLE_INVALID; state->shared_collector = InvalidDsaPointer; } @@ -154,16 +154,13 @@ pg_plan_advice_get_mcxt(void) pgpa_shared_state * pg_plan_advice_attach(void) { - pgpa_shared_state *state; - bool found; - if (pgpa_state == NULL) { - state = GetNamedDSMSegment("pg_plan_advice", sizeof(pgpa_shared_state), - pgpa_init_shared_state, &found); - LWLockRegisterTranche(state->lock.tranche, "pg_plan_advice_lock"); - LWLockRegisterTranche(state->dsa_tranche, "pg_plan_advice_dsa"); - pgpa_state = state; + bool found; + + pgpa_state = + GetNamedDSMSegment("pg_plan_advice", sizeof(pgpa_shared_state), + pgpa_init_shared_state, &found); } return pgpa_state; -- 2.39.5