X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/707bd7579fca316f258c60d3b473c8021d74ae41..bd63b8da0009075761535690e4fd9a270906b1f5:/cookbooks/planet/files/default/replication-bin/replicate-changesets?ds=sidebyside diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index 74cd53caa..e71d4c548 100644 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -225,6 +225,15 @@ class Replicator fh.write(YAML.dump(@state)) end + # fsync the files in their old locations. + fsync(tmp_data) + fsync(tmp_state) + + # sync the directory as well, to ensure that the file is reachable + # from the dirent and has been updated to account for any allocations. + fdirsync(File.dirname(tmp_data)) + fdirsync(File.dirname(tmp_state)) + # sanity check: the files we're moving into place # should be non-empty. raise "Temporary gzip file should exist, but doesn't." unless File.exist?(tmp_data)