pgsql: Fix recently-identified PITR recovery hazard: the base backup

Lists: pgsql-committers
From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix recently-identified PITR recovery hazard: the base backup
Date: 2006-11-05 23:40:31
Message-ID: 20061105234031.5F6809FA186@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Log Message:
-----------
Fix recently-identified PITR recovery hazard: the base backup could contain
stale relcache init files (pg_internal.init), and there is no mechanism for
updating them during WAL replay. Easiest solution is just to delete the init
files at conclusion of startup, and let the first backend started in each
database take care of rebuilding the init file. Simon Riggs and Tom Lane.

Back-patched to 8.1. Arguably this should be fixed in 8.0 too, but it would
require significantly more code since 8.0 has no handy startup-time scan of
pg_database to piggyback on. Manual solution of the problem is possible
in 8.0 (just delete the pg_internal.init files before starting WAL replay),
so that may be a sufficient answer.

Modified Files:
--------------
pgsql/src/backend/utils/cache:
relcache.c (r1.249 -> r1.250)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/relcache.c.diff?r1=1.249&r2=1.250)
pgsql/src/backend/utils/init:
flatfiles.c (r1.22 -> r1.23)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/init/flatfiles.c.diff?r1=1.22&r2=1.23)
pgsql/src/include/utils:
relcache.h (r1.55 -> r1.56)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/relcache.h.diff?r1=1.55&r2=1.56)