fsync the pgdata directory itself after pg_rewind.
commit does fsync affected files after
pg_rewind. It forgets to fsync the pgdata directory itself since we write a new
file backup_label under the directory.
@@ -878,6 +878,7 @@ syncTargetDirectory(void)
fsync_fname("global/pg_control", false);
fsync_fname("backup_label", false);
fsync_fname("postgresql.auto.conf", false);
+ fsync_fname(".", true); /* due to new file backup_label. */
}
/*
