Triggered assertion "!(tp.t_data->t_infomask & HEAP_XMAX_INVALID)" in heap_delete() on HEAD [PATCH] - Mailing list pgsql-hackers

From Florian Pflug
Subject Triggered assertion "!(tp.t_data->t_infomask & HEAP_XMAX_INVALID)" in heap_delete() on HEAD [PATCH]
Date
Msg-id 483B0E69-1218-4AF7-AA3B-8D6A81E91C23@phlo.org
Whole thread Raw
Responses Re: Triggered assertion "!(tp.t_data->t_infomask & HEAP_XMAX_INVALID)" in heap_delete() on HEAD [PATCH]  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi

In the process of re-verifying my serializable lock consistency patch, I ran
the fk_concurrency testsuite against *unpatched* HEAD for comparison.

My build of HEAD had asserts enabled, and I promptly triggered
    Assert(!(tp.t_data->t_infomask & HEAP_XMAX_INVALID))
in heap_delete().

The seems wrong, if result was set to HeapTupleUpdated because the tuple was invisible
to the crosscheck snapshot, its xmax may very well be invalid.

Simply removing the assert isn't an option, because right after the assert the tuple's
xmax is copied into update_xmax. Thus the attached patch takes care to set update_xmax
to InvalidTransactionId explicitly in case the update is prevented by the crosscheck snapshot.

heap_update() suffers from the same problem and is treated similarly by the patch.

Note that this patch conflicts with the serializable_lock_consistency patch, since it
changes that assert too, but in a different way.

best regards,
Florian Pflug

Attachment

pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: hstores in pl/python
Next
From: Josh Berkus
Date:
Subject: Re: ALTER TABLE ... REPLACE WITH