Write temporary data file to same disk as real one
authorTom Hughes <tom@compton.nu>
Wed, 7 Sep 2016 10:08:59 +0000 (11:08 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 7 Sep 2016 10:08:59 +0000 (11:08 +0100)
This avoids needing to sync data again when renaming it.

cookbooks/planet/files/default/replication-bin/replicate-changesets

index 45e1a4a..8132fa6 100644 (file)
@@ -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.