fsync and wal_sync_method - Mailing list pgsql-general

From ascot.moss@gmail.com
Subject fsync and wal_sync_method
Date
Msg-id A3705D4E-F5CD-4FD3-891F-60C1D01218D7@gmail.com
Whole thread Raw
In response to invalid resource manager ID in primary checkpoint record  ("ascot.moss@gmail.com" <ascot.moss@gmail.com>)
Responses Re: fsync and wal_sync_method
List pgsql-general
Hi,

I am using pg 9.2.4 and ubuntu 12.04 to set up a pair of pg-Master and pg-Slave with streaming replication.

The archive_command is enabled and the "rsync" is used in pg-Master to save all its archived WAL files to the 3rd
machinefor backup purpose,  by default, both fsync and wal_sync_method are commented out in postgresql.conf: 

archive_command = '(cp %p /usr/pg_arcxlog/%f && rsync -aq  %p pg@pg_slave:/usr/pg_arcxlog/%f'
#fsync = on                        # turns forced synchronization on or off
#wal_sync_method = fsync        # the default is the first option

Thus I think the latest WAL might not be flushed to disk from time to time in pg-Master, therefore the WAL saved in the
3rdserver might not contain the latest WAL. In order to avoid possible data lost, should 'fsync" be turned ON in
pg-Masterand pg-Slave?  if yes what would be the best settings of "wal_sync_method" for these two servers respectively? 

Please advise.
regards

pgsql-general by date:

Previous
From: James Sewell
Date:
Subject: Re: pg_largeobjects
Next
From: David Johnston
Date:
Subject: Re: Odd behavior in functions w/ anyarray & anyelement