@@ -357,6 +357,7 @@ backup_data_file(const char *from_root, const char *to_root,
357
357
strerror (errno_tmp ));
358
358
}
359
359
360
+ fsync (fileno (out ));
360
361
fclose (in );
361
362
fclose (out );
362
363
@@ -470,6 +471,7 @@ restore_file_partly(const char *from_root,const char *to_root, pgFile *file)
470
471
strerror (errno_tmp ));
471
472
}
472
473
474
+ fsync (fileno (out ));
473
475
fclose (in );
474
476
fclose (out );
475
477
}
@@ -605,6 +607,7 @@ restore_data_file(const char *from_root,
605
607
strerror (errno_tmp ));
606
608
}
607
609
610
+ fsync (fileno (out ));
608
611
fclose (in );
609
612
fclose (out );
610
613
}
@@ -732,6 +735,7 @@ copy_file(const char *from_root, const char *to_root, pgFile *file)
732
735
strerror (errno_tmp ));
733
736
}
734
737
738
+ fsync (fileno (out ));
735
739
fclose (in );
736
740
fclose (out );
737
741
@@ -832,9 +836,9 @@ copy_wal_file(const char *from_path, const char *to_path)
832
836
strerror (errno_tmp ));
833
837
}
834
838
839
+ fsync (fileno (out ));
835
840
fclose (in );
836
841
fclose (out );
837
-
838
842
}
839
843
840
844
/*
@@ -957,6 +961,7 @@ copy_file_partly(const char *from_root, const char *to_root,
957
961
/* add meta information needed for recovery */
958
962
file -> is_partial_copy = true;
959
963
964
+ fsync (fileno (out ));
960
965
fclose (in );
961
966
fclose (out );
962
967