From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: pg_rewind: fsync target data directory. |
Date: | 2016-03-27 21:51:27 |
Message-ID: | E1akIal-00066J-3O@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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: 20160310034352(dot)iuqgvpmg5qmnxtkz(at)alap3(dot)anarazel(dot)de
CAB7nPqSytVG1o4S3S2pA1O=692ekurJ+fckW2PywEG3sNw54Ow(at)mail(dot)gmail(dot)com
Backpatch: 9.5, where pg_rewind was introduced
Branch
------
REL9_5_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/c5b5168cfc5c7aa74ce95ef64b79c6633230f424
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2016-03-27 22:07:30 | pgsql: Clamp adjusted ndistinct to positive integer in estimate_hash_bu |
Previous Message | Andres Freund | 2016-03-27 21:51:24 | pgsql: pg_rewind: fsync target data directory. |