Re: Savepoint weirdness - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Savepoint weirdness
Date
Msg-id 27938.1092590011@sss.pgh.pa.us
Whole thread Raw
In response to Savepoint weirdness  (Gavin Sherry <swm@linuxworld.com.au>)
Responses Re: Savepoint weirdness  (Gavin Sherry <swm@linuxworld.com.au>)
List pgsql-hackers
Gavin Sherry <swm@linuxworld.com.au> writes:
> Jason Godden pointed out some weird savepoint behaviour on IRC and i've
> narrowed this down to a simpler case.

The answer turns out to be that GetSnapshotData is miscomputing snapshot
xmin and RecentGlobalXmin when inside a subtransaction: it omits our own
top transaction ID from the set of open transactions.  The presence of
the unique index makes a difference because in the unique-index-check
code, we check the existing rows using the bogus data, and actually end
up concluding that the original rows being updated are globally dead,
and marking them so.

I'm surprised that we didn't find this one much earlier :-(
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [Fwd: Re: [pgsql-hackers-win32] Import from Linux to
Next
From: Gaetano Mendola
Date:
Subject: Re: will PITR in 8.0 be usable for "hot spare"/"log