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

From: Florian Pflug <fgp(at)phlo(dot)org>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Triggered assertion "!(tp.t_data->t_infomask & HEAP_XMAX_INVALID)" in heap_delete() on HEAD [PATCH]
Date: 2010-12-14 19:29:09
Message-ID: 483B0E69-1218-4AF7-AA3B-8D6A81E91C23@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
fix_assert_xmaxinvalid.v1.patch application/octet-stream 2.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2010-12-14 19:34:16 Re: ALTER TABLE ... REPLACE WITH
Previous Message David E. Wheeler 2010-12-14 19:29:04 Re: hstores in pl/python