Re: Allow "snapshot too old" error, to prevent bloat

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>, Ants Aasma <ants(at)cybertec(dot)at>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Magnus Hagander <magnus(at)hagander(dot)net>, Andres Freund <andres(at)2ndquadrant(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Allow "snapshot too old" error, to prevent bloat
Date: 2015-02-19 20:52:31
Message-ID: 54E64D0F.2030108@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 02/19/2015 03:31 PM, Kevin Grittner wrote:

>> What about having the long running snapshots declare their working
>> set, and then only take them into account for global xmin for
>> relations that are in the working set? Like a SET TRANSACTION WORKING
>> SET command. This way the error is deterministic, vacuum on the high
>> churn tables doesn't have to wait for the old transaction delay to
>> expire and we avoid a hard to tune GUC (what do I need to set
>> old_snapshot_threshold to, to reduce bloat while not having "normal"
>> transactions abort).
> Let me make sure I understand your suggestion. You are suggesting
> that within a transaction you can declare a list of tables which
> should get the "snapshot too old" error (or something like it) if a
> page is read which was modified after the snapshot was taken?
> Snapshots within that transaction would not constrain the effective
> global xmin for purposes of vacuuming those particular tables?

I thought it meant that the declared tables would only be vacuumed
conservatively, so the transaction would expect not to see "snapshot too
old" from them.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2015-02-19 21:05:04 Re: CATUPDATE confusion?
Previous Message Peter Eisentraut 2015-02-19 20:50:38 Re: Enforce creation of destination folders for source files in pg_regress (Was: pg_regress writes into source tree)