Re: Error: dsa_area could not attach to a segment that has been freed

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Gaddam Sai Ram <gaddamsairam(dot)n(at)zohocorp(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Error: dsa_area could not attach to a segment that has been freed
Date: 2017-09-21 02:19:21
Message-ID: CAMsr+YH4GnTSWkEOt7Eb-GYJ9hwsEa4gFWdUzh6YARFRxwFD7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 21 September 2017 at 05:50, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
wrote:

> On Thu, Sep 21, 2017 at 12:59 AM, Robert Haas <robertmhaas(at)gmail(dot)com>
> wrote:
> > On Wed, Sep 20, 2017 at 5:54 AM, Craig Ringer <craig(at)2ndquadrant(dot)com>
> wrote:
> >> By the way, dsa.c really needs a cross-reference to shm_toc.c and vice
> >> versa. With a hint as to when each is appropriate.
> >
> > /me blinks.
> >
> > Aren't those almost-entirely-unrelated facilities?
>
> I think I see what Craig means.
>
> 1. A DSM segment works if you know how much space you'll need up
> front so that you can size it. shm_toc provides a way to exchange
> pointers into it with other backends in the form of shm_toc keys
> (perhaps implicitly, in the form of well known keys or a convention
> like executor node ID -> shm_toc key). Examples: Fixed sized state
> for parallel-aware executor nodes, and fixed size parallel executor
> infrastructure.
>
> 2. A DSA area is good if you don't know how much space you'll need
> yet. dsa_pointer provides a way to exchange pointers into it with
> other backends. Examples: A shared cache, an in-memory database
> object like Gaddam Sai Ram's graph index extension, variable sized
> state for parallel-aware executor nodes, the shared record typmod
> registry stuff.
>
> Perhaps confusingly we also support DSA areas inside DSM segments,
> there are DSM segments inside DSA areas. We also use DSM segments as
> a kind of shared resource cleanup mechanism, and don't yet provide an
> equivalent for DSA. I haven't proposed anything like that because I
> feel like there may be a better abstraction of reliable scoped cleanup
> waiting to be discovered (as I think Craig was also getting at).
>

Well said, and what I would've wanted to say if I could've figured it out
well enough to express it.

Hence needing some kind of README or cross reference to help people know
which facility/facilities are suitable for their needs... and actually
discover them.

(A hint on RequestAddinShmemSpace etc pointing to DSM + DSA would be good
too)

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-09-21 02:22:00 Re: POC: Cache data in GetSnapshotData()
Previous Message Mithun Cy 2017-09-21 02:04:59 Re: POC: Cache data in GetSnapshotData()