pgsql: Fix possible page corruption by ALTER TABLE ..

From: rhaas(at)postgresql(dot)org (Robert Haas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix possible page corruption by ALTER TABLE ..
Date: 2010-07-29 16:15:47
Message-ID: 20100729161547.91F0A7541D5@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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_0_STABLE

Modified Files:
--------------
pgsql/src/backend/access/heap:
heapam.c (r1.182.4.1 -> r1.182.4.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/heap/heapam.c?r1=1.182.4.1&r2=1.182.4.2)
pgsql/src/backend/commands:
tablecmds.c (r1.142.4.12 -> r1.142.4.13)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c?r1=1.142.4.12&r2=1.142.4.13)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-07-29 18:29:52 pgsql: Work around a documentation toolchain problem by replacing the
Previous Message Robert Haas 2010-07-29 16:15:33 pgsql: Fix possible page corruption by ALTER TABLE ..