pg_rewind: should do fsync after writing the recovery conf information.
Did not remember why I forgot to do that (I did do that in the PG version).
@@ -459,14 +459,14 @@ main(int argc, char **argv)
ControlFile_new.state = DB_IN_ARCHIVE_RECOVERY;
update_controlfile(datadir_target, &ControlFile_new, do_sync);
- if (showprogress)
- pg_log_info("syncing target data directory");
- syncTargetDirectory();
-
if (writerecoveryconf)
WriteRecoveryConfig(conn, datadir_target,
GenerateRecoveryConfig(conn, replication_slot));
+ if (showprogress)
+ pg_log_info("syncing target data directory");
+ syncTargetDirectory();
+
pg_log_info("Done!");
return 0;
