pgsql: Fix replay of XLOG_HEAP_NEWPAGE WAL records to pay attention to

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix replay of XLOG_HEAP_NEWPAGE WAL records to pay attention to
Дата
Msg-id 20100502222811.B7AA57541D2@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Fix replay of XLOG_HEAP_NEWPAGE WAL records to pay attention to the forknum
field of the WAL record.  The previous coding always wrote to the main fork,
resulting in data corruption if the page was meant to go into a non-default
fork.

At present, the only operation that can produce such WAL records is
ALTER TABLE/INDEX SET TABLESPACE when executed with archive_mode = on.
Data corruption would be observed on standby slaves, and could occur on the
master as well if a database crash and recovery occurred after committing
the ALTER and before the next checkpoint.  Per report from Gordon Shannon.

Back-patch to 8.4; the problem doesn't exist in earlier branches because
we didn't have a concept of multiple relation forks then.

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/access/heap:
        heapam.c (r1.277.2.1 -> r1.277.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/heap/heapam.c?r1=1.277.2.1&r2=1.277.2.2)

В списке pgsql-committers по дате отправления:

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix replay of XLOG_HEAP_NEWPAGE WAL records to pay attention to
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Improve printing of XLOG_HEAP_NEWPAGE records to include the