On Thu, Nov 12, 2009 at 12:03 PM, Tom Lane <[email protected]> wrote: > Fujii Masao <[email protected]> writes: >> Should the standby also have to follow the WAL rule during recovery? >> The current patch doesn't care about the write order of the data page >> and WAL in the standby. So, after both servers fail, restarting the >> ex-standby by itself might corrupt the data. > > Surely the receiver should fsync the WAL itself to disk before > acknowledging it. Assuming you've done that, I don't see any > corruption risk.
"acknowledging it" means "letting the startup process know the arrival of WAL records"? If so, I agree that there is no risk of data corruption. The problem is that fsync needs to be issued too frequently, which would be harmless in asynchronous replication, but not in synchronous one. A transaction would have to wait for the primary's and standby's fsync before returning a "success" to a client. So I'm inclined to change the startup process and bgwriter, instead of walreceiver, so as to fsync the WAL for the WAL rule. Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center -- Sent via pgsql-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
