Re: [HACKERS] dsm.c API tweak

2017-03-28 Thread Alvaro Herrera
Thomas Munro wrote: > + if (CurrentResourceOwner) > + { > + seg->resowner = CurrentResourceOwner; > + ResourceOwnerRememberDSM(CurrentResourceOwner, seg); > + } > > You need to assign seg->resowner = CurrentResourceOwner > unconditionally here. Otherwise seg->resowner is uninit

Re: [HACKERS] dsm.c API tweak

2017-03-25 Thread Alvaro Herrera
Thomas Munro wrote: > I'd word this slightly differently: > > + * If there is a CurrentResourceOwner, the new segment is born unpinned and > the > + * resource owner is in charge of destroying it (and will be blamed if it > + * doesn't). If there's no current resource owner, then the segment st

Re: [HACKERS] dsm.c API tweak

2017-03-24 Thread Thomas Munro
On Sat, Mar 25, 2017 at 1:59 PM, Thomas Munro wrote: > On Sat, Mar 25, 2017 at 12:35 PM, Alvaro Herrera > wrote: >> Alvaro Herrera wrote: >>> Per >>> https://postgr.es/m/CAEepm=11ma_Z1HoPxPcSCANnh5ykHORa=hca1u1v1+5s_jw...@mail.gmail.com >>> it seems that the dsm.c API is a bit inconvenient right

Re: [HACKERS] dsm.c API tweak

2017-03-24 Thread Thomas Munro
On Sat, Mar 25, 2017 at 12:35 PM, Alvaro Herrera wrote: > Alvaro Herrera wrote: >> Per >> https://postgr.es/m/CAEepm=11ma_Z1HoPxPcSCANnh5ykHORa=hca1u1v1+5s_jw...@mail.gmail.com >> it seems that the dsm.c API is a bit inconvenient right now. I proposed >> in the first patch in that thread to chang

Re: [HACKERS] dsm.c API tweak

2017-03-24 Thread Alvaro Herrera
Alvaro Herrera wrote: > Per > https://postgr.es/m/CAEepm=11ma_Z1HoPxPcSCANnh5ykHORa=hca1u1v1+5s_jw...@mail.gmail.com > it seems that the dsm.c API is a bit inconvenient right now. I proposed > in the first patch in that thread to change the API so that a segment is > marked as "pinned" if created