pgsql: Fix WAL replay of locking an updated tuple

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix WAL replay of locking an updated tuple
Date: 2014-02-27 14:32:03
Message-ID: E1WJ20J-00080D-7Z@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix WAL replay of locking an updated tuple

We were resetting the tuple's HEAP_HOT_UPDATED flag as well as t_ctid on
WAL replay of a tuple-lock operation, which is incorrect when the tuple
is already updated.

Back-patch to 9.3. The clearing of both header elements was there
previously, but since no update could be present on a tuple that was
being locked, it was harmless.

Bug reported by Peter Geoghegan and Greg Stark in
CAM3SWZTMQiCi5PV5OWHb+bYkUcnCk=O67w0cSswPvV7XfUcU5g(at)mail(dot)gmail(dot)com and
CAM-w4HPTOeMT4KP0OJK+mGgzgcTOtLRTvFZyvD0O4aH-7dxo3Q(at)mail(dot)gmail(dot)com
respectively; diagnosis by Andres Freund.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/9a57858f1103b89a5674f0d50c5fe1f756411df6

Modified Files
--------------
src/backend/access/heap/heapam.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-02-27 14:41:03 Re: pgsql: Fix WAL replay of locking an updated tuple
Previous Message Andres Freund 2014-02-27 14:31:18 Re: pgsql: Introduce replication slots.