From: Tom Hughes Date: Wed, 7 Sep 2016 09:40:20 +0000 (+0100) Subject: Flush changeset data to disk before making it live X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/3842b457f8c47904305387c679896e750f521929 Flush changeset data to disk before making it live --- diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6bc5812c0..343c145d3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -27,7 +27,7 @@ Metrics/LineLength: # Offense count: 23 # Configuration parameters: CountComments. Metrics/MethodLength: - Max: 28 + Max: 30 # Offense count: 1 Metrics/PerceivedComplexity: diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index fb3d6138a..45e1a4a1c 100644 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -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