pg_rewind: fsync target data directory. Previously pg_rewind did not fsync any files. That's problematic, given that the target directory is modified. If the database was started afterwards, 2ce439f33 luckily already caused the data directory to be synced to disk at postmaster startup; reducing the scope of the problem.
To fix, use initdb -S, at the end of the pg_rewind run. It doesn't seem worthwhile to duplicate the code into pg_rewind, and initdb -S is already used that way by pg_upgrade. Reported-By: Andres Freund Author: Michael Paquier, somewhat edited by me Discussion: [email protected] CAB7nPqSytVG1o4S3S2pA1O=692ekurj+fckw2pyweg3snw5...@mail.gmail.com Backpatch: 9.5, where pg_rewind was introduced Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/408f0438531eec17ac62f91fc23f72bcfc48dd36 Modified Files -------------- src/bin/pg_rewind/file_ops.c | 1 - src/bin/pg_rewind/pg_rewind.c | 57 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) -- Sent via pgsql-committers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers
