pgsql: Fix some serious bugs in archive recovery, now that bgwriter is

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix some serious bugs in archive recovery, now that bgwriter is
Date: 2009-06-25 21:36:01
Message-ID: 20090625213601.0ABF6753336@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Fix some serious bugs in archive recovery, now that bgwriter is active
during it:

When bgwriter is active, the startup process can't perform mdsync() correctly
because it won't see the fsync requests accumulated in bgwriter's private
pendingOpsTable. Therefore make bgwriter responsible for the end-of-recovery
checkpoint as well, when it's active.

When bgwriter is active (= archive recovery), the startup process must not
accumulate fsync requests to its own pendingOpsTable, since bgwriter won't
see them there when it performs restartpoints. Make startup process drop its
pendingOpsTable when bgwriter is launched to avoid that.

Update minimum recovery point one last time when leaving archive recovery.
It won't be updated by the end-of-recovery checkpoint because XLogFlush()
sees us as out of recovery already.

This fixes bug #4879 reported by Fujii Masao.

Modified Files:
--------------
pgsql/src/backend/access/transam:
xlog.c (r1.343 -> r1.344)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.343&r2=1.344)
pgsql/src/backend/postmaster:
bgwriter.c (r1.60 -> r1.61)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/bgwriter.c?r1=1.60&r2=1.61)
pgsql/src/backend/storage/smgr:
md.c (r1.146 -> r1.147)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/smgr/md.c?r1=1.146&r2=1.147)
pgsql/src/include/access:
xlog.h (r1.91 -> r1.92)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/xlog.h?r1=1.91&r2=1.92)
pgsql/src/include/storage:
smgr.h (r1.67 -> r1.68)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/smgr.h?r1=1.67&r2=1.68)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-06-25 23:07:16 pgsql: Add __attribute__((format_arg(1))) to the declaration of
Previous Message Peter Eisentraut 2009-06-25 21:15:38 pgsql: Man pages back to lowercase names, with additional fixup to make