Re: Re: [COMMITTERS] pgsql: Reduce spurious Hot Standby conflicts from never-visible records

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Reduce spurious Hot Standby conflicts from never-visible records
Date: 2011-01-05 20:08:13
Message-ID: AANLkTimKVVeH3Lu7Ar=mG4e+KzSvuxFeuRpn1UJu84fh@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Jan 5, 2011 at 3:06 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Wed, Jan 5, 2011 at 3:00 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>> On Mon, 2011-01-03 at 23:13 -0500, Robert Haas wrote:
>>
>>> > Hmmm, my earlier code took xmax only if xmax > xmin. That was wrong;
>>> > what I have now is better, but your point is there may be an even better
>>> > truth. I'll think on that a little more.
>>
>> I remember that I thought some more on this and decided that I couldn't
>> see a problem. I also see I didn't update the list to say that.
>>
>>> I guess the problem case here is something like:
>>>
>>> 1. T1 begins.  T1 writes a tuple A (so it gets an XID).
>>> 2. T2 begins.  T2 writes a tuple B (so it gets a later XID).
>>> 3. T1 takes a new snapshot that can see B and deletes B.
>>> 4. T2 commits.
>>> 5. T1 commits.
>>
>> How is step (3) possible before step (4)?
>
> At read committed isolation level, which is the default, we take a new
> snapshot after every command.

Oh, I'm a dork. You're saying T2 hasn't committed yet. Let me think
about this some more...

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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2011-01-06 01:15:32 pgsql: Rename pg_upgrade variables, for clarity.
Previous Message Robert Haas 2011-01-05 20:06:31 Re: Re: [COMMITTERS] pgsql: Reduce spurious Hot Standby conflicts from never-visible records

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Krogh 2011-01-05 20:22:54 Re: crash-safe visibility map, take three
Previous Message Jeff Davis 2011-01-05 20:07:32 Re: WIP: Range Types