]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/planet/files/default/replication-bin/replicate-changesets
Flush changeset data to disk before making it live
[chef.git] / cookbooks / planet / files / default / replication-bin / replicate-changesets
index fb3d6138af0dc0686c8b19b0c2f30847ffefe4a5..45e1a4a1cf3a8139141290d519ff7697b90e8e12 100644 (file)
@@ -196,10 +196,12 @@ class Replicator
         FileUtils.mkdir_p(File.dirname(data_file))
         Zlib::GzipWriter.open(tmp_data) do |fh|
           fh.write(changeset_dump(open_changesets))
+          fh.fdatasync
         end
         @state["sequence"] = sequence
         File.open(tmp_state, "w") do |fh|
           fh.write(YAML.dump(@state))
+          fh.fdatasync
         end
 
         # sanity check: the files we're moving into place