pgsql: Don't try to set InvalidXid as page pruning hint

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't try to set InvalidXid as page pruning hint
Date: 2013-11-28 15:02:30
Message-ID: E1Vm36s-00022S-9u@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't try to set InvalidXid as page pruning hint

If a transaction updates/deletes a tuple just before aborting, and a
concurrent transaction tries to prune the page concurrently, the pruner
may see HeapTupleSatisfiesVacuum return HEAPTUPLE_DELETE_IN_PROGRESS,
but a later call to HeapTupleGetUpdateXid() return InvalidXid. This
would cause an assertion failure in development builds, but would be
otherwise Mostly Harmless.

Fix by checking whether the updater Xid is valid before trying to apply
it as page prune point.

Reported by Andres in 20131124000203(dot)GA4403(at)alap2(dot)anarazel(dot)de

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c235a6a589bbd0a24e54fdb0df28979c9fb09463

Modified Files
--------------
src/backend/access/heap/pruneheap.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2013-11-28 16:02:38 pgsql: Unbreak buildfarm
Previous Message Peter Eisentraut 2013-11-28 03:42:26 pgsql: doc: Set chunk.first.sections in XSLT, for consistency with DSSS