Re: [HACKERS] [BUG FIX] Removing NamedLWLockTrancheArray - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject Re: [HACKERS] [BUG FIX] Removing NamedLWLockTrancheArray
Date
Msg-id 20170306.175357.90977772.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] [BUG FIX] Removing NamedLWLockTrancheArray  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
By the way,

At Mon, 06 Mar 2017 17:07:55 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote in
<20170306.170755.68410634.horiguchi.kyotaro@lab.ntt.co.jp>
> Ok, I think I understand the complete picture.
> 
> At Mon, 06 Mar 2017 15:58:56 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote
in<20170306.155856.198084190.horiguchi.kyotaro@lab.ntt.co.jp>
 
> > > I can guess two ways to fix this. One is change the definition of
> > > T_NAME.
> > > 
> > > | #define T_NAME(l) \
> > > |   ((l)->tranche < LWTRANCHE_FIRST_USER_DEFINED ? \
> > > |    LWLockTrancheArray[(l)->tranche] : \
> > > |    NamedLWLockTrancheArray[(l)->tranche - LWTRANCHE_FIRST_USER_DEFINED]
> > > 
> > > It makes the patch small but I don't thing the shape is
> > > desirable.
> > > 
> > > Then, the other way is registering named tranches into the main
> > > tranche array. The number and names of the requested named
> > > tranches are known to postmaster so they can be allocated and
> > > initialized at the time.
> > > 
> > > The mapping of the shared memory is inherited to backends so
> > > pointing to the addresses in shared memory will work in the
> > > !EXEC_BACKEND case. I confirmed that the behavior is ensured also
> > > in EXEC_BACKEND case.
> 
> But this doesn't work for
> LWLockNewTrancheId/LWLockRegisterTranche and it is valuable
> interface. So the measure we can take is redefining T_NAME.

I realized that *I* have used the interface
RequestNamedLWLockTranche in certain extensions but I completely
forgot that and faintly recalled after being pointed by one of my
colleagues..

Sorry for the off-topic.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center





pgsql-hackers by date:

Previous
From: Michael Banck
Date:
Subject: Re: [HACKERS] Change in "policy" on dump ordering?
Next
From: Amit Langote
Date:
Subject: Re: [HACKERS] Logical replication and inheritance