Re: pg_rewind just doesn't fsync *anything*? - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_rewind just doesn't fsync *anything*?
Date
Msg-id CAB7nPqQ-UuqGKyaewY3d4xdfY=J5ssZpON=s4i-BZtTUB1wb0A@mail.gmail.com
Whole thread Raw
In response to Re: pg_rewind just doesn't fsync *anything*?  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Responses Re: pg_rewind just doesn't fsync *anything*?
List pgsql-hackers
On Thu, Mar 10, 2016 at 8:37 AM, Abhijit Menon-Sen <ams@2ndquadrant.com> wrote:
> At 2016-03-10 08:35:43 +0100, michael.paquier@gmail.com wrote:
>>
>> > I guess the easiest fix would be to shell out to initdb -s?
>>
>> What do you mean? I am not sure what initdb has to do with that as we
>> have no need for it in pg_rewind.
>
> initdb -S/--sync-only fsyncs everything in the data directory and exits.

Missed your point, good to know that initdb is not doing anything else
with -S than fsyncing everything in PGDATA. Still, I think that we had
better fsync only entries that are modified by pg_rewind, and files
that got updated, and not the whole directory, a target data folder
should be stopped properly to be able to rewind, and it is better to
avoid dependencies between utilities if that's not strictly necessary.
initdb is likely to be installed side-by-side with pg_rewind in any
distribution though.
-- 
Michael



pgsql-hackers by date:

Previous
From: Abhijit Menon-Sen
Date:
Subject: Re: pg_rewind just doesn't fsync *anything*?
Next
From: Amit Kapila
Date:
Subject: Re: POC: Cache data in GetSnapshotData()