Re: concurrent snapshots - Mailing list pgsql-hackers

From Robert Haas
Subject Re: concurrent snapshots
Date
Msg-id CA+TgmoY00qw-xuzHC01ztYwWKA_FeYhL-bYr=aoFxXfZRg7bOA@mail.gmail.com
Whole thread Raw
In response to concurrent snapshots  (Ants Aasma <ants.aasma@eesti.ee>)
Responses Re: concurrent snapshots
List pgsql-hackers
On Thu, Sep 8, 2011 at 9:26 AM, Ants Aasma <ants.aasma@eesti.ee> wrote:
> When go try to find the new csnmin
> and discover that a backend has a csnmin that is too old, we go through
> the snapshots of that backend and convert every snapshot under the
> desired csnmin to a traditional snapshot.

I thought about something along these lines (though I didn't flesh out
the details as much as you have here), but rejected it because the
step described above would require all snapshots to be stored in
shared memory.  That's problematic for several reasons:

1. A backend can have lots of snapshots, potentially requiring an
unbounded amount of shared memory.  We can't accommodate that.

2. You'd need to protect all of those snapshots with spinlocks or
something, which would be wicked expensive, because the owning process
would need to take and release that spinlock every time it touched the
snapshot.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Large C files
Next
From: Bruce Momjian
Date:
Subject: Re: Large C files