From: Tom Hughes Date: Wed, 7 Sep 2016 10:08:59 +0000 (+0100) Subject: Write temporary data file to same disk as real one X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/8cdcbd941f99f13e2627c54d9c3efddbc946f52b Write temporary data file to same disk as real one This avoids needing to sync data again when renaming it. --- diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index 45e1a4a1c..8132fa61b 100644 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -188,7 +188,7 @@ class Replicator sequence = (@state.key?("sequence") ? @state["sequence"] + 1 : 0) data_file = @config["data_dir"] + format("/%03d/%03d/%03d.osm.gz", sequence / 1000000, (sequence / 1000) % 1000, (sequence % 1000)) tmp_state = @config["state_file"] + ".tmp" - tmp_data = "/tmp/changeset_data.osm.tmp" + tmp_data = data_file + ".tmp" # try and write the files to tmp locations and then # move them into place later, to avoid in-progress # clashes, or people seeing incomplete files.