pgsql: Don't allow walsender to send WAL data until it's been safely

Lists: pgsql-committers
From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't allow walsender to send WAL data until it's been safely
Date: 2010-06-17 16:41:25
Message-ID: 20100617164125.CAF097541D4@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers

Log Message:
-----------
Don't allow walsender to send WAL data until it's been safely fsync'd on the
master. Otherwise a subsequent crash could cause the master to lose WAL that
has already been applied on the slave, resulting in the slave being out of
sync and soon corrupt. Per recent discussion and an example from Robert Haas.

Fujii Masao

Modified Files:
--------------
pgsql/src/backend/access/transam:
xlog.c (r1.424 -> r1.425)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.424&r2=1.425)
pgsql/src/backend/replication:
walsender.c (r1.26 -> r1.27)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/replication/walsender.c?r1=1.26&r2=1.27)
pgsql/src/include/access:
xlog.h (r1.112 -> r1.113)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/xlog.h?r1=1.112&r2=1.113)