First group of logging changes for PITR

From: "J(dot) R(dot) Nield" <jrnield(at)usol(dot)com>
To: PostgreSQL Patch List <pgsql-patches(at)postgresql(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: First group of logging changes for PITR
Date: 2002-07-09 19:56:27
Message-ID: 1026244592.11285.418.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Here's a draft patch that adds additional logging code to certain
resource managers.

Note that some operations like CREATE DATABASE are still not logged.

An example to test it might be:

<<ensure wal_debug = 16 in postgresql.conf>>

<<startup -D ./data>>
CREATE DATABASE test;
<<backup ./data/global/pg_control while dirty>>
<<shutdown -D ./data>>

<<backup all of ./data except from pg_xlog into ./data_old>>
<<startup -D ./data>>

CREATE TABLE FOO...
INSERT BUNCH OF RECORDS...
CREATE INDEX ON FOO...
etc, etc.

<<shutdown -D ./data>>

<<copy logfiles from ./data/pg_xlog into ./data_old/pg_xlog>>
<<copy backup pg_control into ./data_old/global>>
<<startup -D ./data_old and watch the recovery run>>

If you find anything that doesn't recover properly, other than
CREATE/DROP DATABASE and the rtree/GiST indexes, please let me know
about it.

This patch implements logging changes for:

=== RM_SMGR create/truncate/delete ===
Note that logging of files pending for unlink has been moved into
smgr.c from xact.c::RecordTransactionCommit, and they get logged after
the commit record. The xlog code has a 2^15 size limit on the max size
of a record we have to avoid. This will not be a problem for
correctness.

=== RM_BTREE _bt_load operations logged properly ===
See nbtree.c and nbtsort.c

=== Incomplete start of XLOG archiver ===
See xlog.c and guc.c

--
J. R. Nield
jrnield(at)usol(dot)com

Attachment Content-Type Size
20020709_01_pitr_logging.patch text/x-patch 45.5 KB

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2002-07-09 20:16:01 Re: UNIQUE predicate
Previous Message eggli 2002-07-09 10:58:00 New Full Text Index using contrib/fulltextindex which now able to processing Traditional Chinese characters(Big5 encoding)