diff options
author | Andres Freund <andres@anarazel.de> | 2016-03-27 23:46:25 +0200 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2016-03-27 23:46:25 +0200 |
commit | 408f0438531eec17ac62f91fc23f72bcfc48dd36 (patch) | |
tree | 937662049f1a171ddcf63048bdcadb87da8da260 /src/bin/pg_rewind/file_ops.c | |
parent | 9f7c527af308dcdaba2f0ff9d362d672e8886fb1 (diff) | |
download | postgresql-408f0438531eec17ac62f91fc23f72bcfc48dd36.tar.gz postgresql-408f0438531eec17ac62f91fc23f72bcfc48dd36.zip |
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.iuqgvpmg5qmnxtkz@alap3.anarazel.de
CAB7nPqSytVG1o4S3S2pA1O=692ekurJ+fckW2PywEG3sNw54Ow@mail.gmail.com
Backpatch: 9.5, where pg_rewind was introduced
Diffstat (limited to 'src/bin/pg_rewind/file_ops.c')
-rw-r--r-- | src/bin/pg_rewind/file_ops.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/bin/pg_rewind/file_ops.c b/src/bin/pg_rewind/file_ops.c index 32eab3abc51..e88cf629b40 100644 --- a/src/bin/pg_rewind/file_ops.c +++ b/src/bin/pg_rewind/file_ops.c @@ -79,7 +79,6 @@ close_target_file(void) dstpath, strerror(errno)); dstfd = -1; - /* fsync? */ } void |