Обсуждение: pgsql: Fix some serious bugs in archive recovery, now that bgwriter is

Поиск
Список
Период
Сортировка

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

От
heikki@postgresql.org (Heikki Linnakangas)
Дата:
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)