pgsql: Fix possible page corruption by ALTER TABLE .. - Mailing list pgsql-committers

From rhaas@postgresql.org (Robert Haas)
Subject pgsql: Fix possible page corruption by ALTER TABLE ..
Date
Msg-id 20100729161505.5E14E7541D5@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix possible page corruption by ALTER TABLE .. SET TABLESPACE.

If a zeroed page is present in the heap, ALTER TABLE .. SET TABLESPACE will
set the LSN and TLI while copying it, which is wrong, and heap_xlog_newpage()
will do the same thing during replay, so the corruption propagates to any
standby.  Note, however, that the bug can't be demonstrated unless archiving
is enabled, since in that case we skip WAL logging altogether, and the LSN/TLI
are not set.

Back-patch to 8.0; prior releases do not have tablespaces.

Analysis and patch by Jeff Davis.  Adjustments for back-branches and minor
wordsmithing by me.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
    pgsql/src/backend/access/heap:
        heapam.c (r1.249.2.5 -> r1.249.2.6)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/heap/heapam.c?r1=1.249.2.5&r2=1.249.2.6)

pgsql-committers by date:

Previous
From: rhaas@postgresql.org (Robert Haas)
Date:
Subject: pgsql: Fix possible page corruption by ALTER TABLE ..
Next
From: rhaas@postgresql.org (Robert Haas)
Date:
Subject: pgsql: Fix possible page corruption by ALTER TABLE ..