0

The Area Creation process can take up to 24 hours. If something happens during that time which causes the process to stop, will it resume when I run it again or does it start back over from the beginning?

We can assume for this question that the files in $DB_DIR remain in place throughout the running/stopping/starting process.

James Chevalier
  • 10,604
  • 5
  • 48
  • 74

1 Answers1

2

It will start over from the beginning, assuming you're using areas.osm3s to define the area creation rules. This file contains a number of queries which are being executed to generate the areas. If you restart the process, it will execute those very same queries again from the beginning.

For performance reasons, we use areas_delta.osm3s and the accompanying rules_delta_loop.sh script on the production servers. This way, we can limit the workload to those areas, which have been changed since the last area creation run.

mmd
  • 3,423
  • 1
  • 16
  • 23
  • Thanks! Now I'm curious about general server stop/start - if I run `nohup $EXEC_DIR/bin/dispatcher --areas --db-dir=$DB_DIR &` and let it complete ... then some time after that stop & start the server ... I assume that I'll have to run the same command again so that the minutely updates can also update the area, but will it also have to start over from scratch at that point? – James Chevalier Aug 10 '19 at 15:18
  • Area updates runs via a dedicated script `rules_loop.sh`, which is completely independent of the minutely diff process. `dispatcher --areas` is a process to synchronize access to the files on disk only, so that minutely updates and osm3s_query and interpreter don't step on each other. Besides, it does *not* create any areas, this is done via osm3s_query, which is being called from rules_loop.sh. – mmd Aug 10 '19 at 19:34
  • Oh, I misunderstood what was doing what. So `nohup $EXEC_DIR/bin/rules_loop.sh $DB_DIR &` is the command that's creating areas ... I'm still unsure if _every_ time this is run it's starting from scratch e.g. deleting any areas it may have previously created in creating them all over again. – James Chevalier Aug 18 '19 at 15:45
  • 1
    Once the area creation runs the second time, it will only add new areas or replace existing ones with the current version of a way/relation. It will not start out deleting all areas, as you would be left without any areas for several hours otherwise. – mmd Aug 19 '19 at 06:18