pgsql: Simplify logic to sync target directory at the end of pg_rewind

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Simplify logic to sync target directory at the end of pg_rewind
Date: 2018-07-10 00:03:35
Message-ID: E1fcg7z-0005iT-1L@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simplify logic to sync target directory at the end of pg_rewind

The previous sync logic relied on looking for and then launching
externally initdb -S, which is a simple wrapper on top of fsync_pgdata.
There is nothing preventing pg_rewind to directly call this routine, so
remove the dependency to initdb and just call it directly.

Author: Michael Paquier
Reviewed-by: Heikki Linnakangas
Discussion: https://postgr.es/m/20180325122607.GB3707@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9a4059d4ff1100e10d2aaadb136a04a407351249

Modified Files
--------------
src/bin/pg_rewind/pg_rewind.c | 44 +++++--------------------------------------
1 file changed, 5 insertions(+), 39 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2018-07-10 09:12:30 pgsql: Fix typo
Previous Message Tom Lane 2018-07-09 23:26:45 pgsql: Avoid emitting a bogus WAL record when recycling an all-zero btr