Re: Repeatable read and serializable transactions see data committed after tx start - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Repeatable read and serializable transactions see data committed after tx start
Date
Msg-id 27900.1415285763@sss.pgh.pa.us
Whole thread Raw
In response to Re: Repeatable read and serializable transactions see data committed after tx start  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: Repeatable read and serializable transactions see data committed after tx start  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-hackers
Kevin Grittner <kgrittn@ymail.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



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: REINDEX CONCURRENTLY 2.0
Next
From: Bernd Helmle
Date:
Subject: Re: Amazon Redshift