Re: logical decoding - GetOldestXmin

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Peter Geoghegan <peter(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: logical decoding - GetOldestXmin
Date: 2012-12-19 02:04:01
Message-ID: CA+TgmoZK+0DHhwb+MROs=W4twS-w_50xCp2iR1HAr7oss+tNWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 18, 2012 at 7:59 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2012-12-18 19:56:18 -0500, Robert Haas wrote:
>> On Tue, Dec 18, 2012 at 5:25 PM, anarazel(at)anarazel(dot)de
>> <andres(at)anarazel(dot)de> wrote:
>> > The problem is that at the time GetSnapshotData returns the xmin horizon might have gone upwards and tuples required for decoding might get removed by other backends. That needs to be prevented while holding the procarray lock exclusively.
>>
>> Well, for the ordinary use of GetSnapshotData(), that doesn't matter,
>> because GetSnapshotData() also updates proc->xmin. If you're trying
>> to store a different value in that field then of course it matters.
>
> Absolutely right. I don't want to say there's anything wrong with it
> right now. The "problem" for me is that it sets proc->xmin to the newest
> value it can while I want/need the oldest valid value...
>
> I will go with adding a already_locked parameter to GetOldestXmin then.

Or instead of bool already_locked, maybe bool advertise_xmin? Seems
like that might be more friendly to the abstraction boundaries.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-12-19 02:24:55 Re: Support for REINDEX CONCURRENTLY
Previous Message Robert Haas 2012-12-19 02:02:20 Re: Makefiles don't seem to remember to rebuild everything anymore