Re: Repeatable read and serializable transactions see data committed after tx start

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Greg Sabino Mullane <greg(at)turnstep(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Repeatable read and serializable transactions see data committed after tx start
Date: 2014-11-06 14:56:03
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

Kevin Grittner <kgrittn(at)ymail(dot)com> writes:
> Why? This "fix" might not deal with the bigger issues that I
> discussed, like that the later-to-start and
> later-to-acquire-a-snapshot transaction might logically be first in
> the apparent order of execution. You can't "fix" that without a
> lot of blocking -- that most of us don't want. Depending on *why*
> they think this is important, they might need to be acquiring
> various locks to prevent behavior they don't want, in which case
> having acquired a snapshot at BEGIN would be exactly the *wrong*
> thing to do. The exact nature of the problem we're trying to solve
> here does matter.

Another thing that I think hasn't been mentioned in this thread is
that we used to have severe problems with client libraries that like
to issue BEGIN and then go idle until they have something to do.
Which, for some reason, is a prevalent behavior. That used to result
in problems like VACUUM not being able to clean up dead rows promptly.
We fixed that some time ago by making sure we didn't acquire an XID until
the first actual statement after BEGIN. Snapshots as such were never a
problem for this, because we've never acquired a snapshot immediately at
BEGIN ... but if we did so, this problem would come right back.

regards, tom lane

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Bernd Helmle 2014-11-06 15:26:28 Re: Amazon Redshift
Previous Message Peter Eisentraut 2014-11-06 14:50:58 Re: REINDEX CONCURRENTLY 2.0