From: | bricklen <bricklen(at)gmail(dot)com> |
---|---|
To: | "ascot(dot)moss(at)gmail(dot)com" <ascot(dot)moss(at)gmail(dot)com> |
Cc: | pgsql-general general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: fsync and wal_sync_method |
Date: | 2013-09-12 03:05:05 |
Message-ID: | CAGrpgQ-MxOmkAiGUh-b_j=mfXpx0+p2Gk3OBBybPoyhOWx6pkA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Sep 11, 2013 at 6:11 PM, ascot(dot)moss(at)gmail(dot)com
<ascot(dot)moss(at)gmail(dot)com>wrote:
> 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 machine for 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(at)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 3rd server might not contain
> the latest WAL. In order to avoid possible data lost, should 'fsync" be
> turned ON in pg-Master and pg-Slave? if yes what would be the best
> settings of "wal_sync_method" for these two servers respectively?
>
> Please advise.
> regards
>
I think you are confusing fsync and switching WAL segments for archiving
purposes. Here's a link to the docs to get you started:
http://www.postgresql.org/docs/9.2/static/runtime-config-wal.html#GUC-ARCHIVE-TIMEOUT
fsync is enabled unless you disable it, the fact that it is commented out
means that it is set to its default ("on"). wal_sync_method at its default
is probably fine, but if you are interested, look at the pg_test_fsync
tool: http://www.postgresql.org/docs/9.2/static/pgtestfsync.html
From | Date | Subject | |
---|---|---|---|
Next Message | arohi | 2013-09-12 04:49:47 | Re: Need help with Inet type |
Previous Message | David Johnston | 2013-09-12 01:51:13 | Re: Odd behavior in functions w/ anyarray & anyelement |