Overpass API developpement

Text archives Help


Re: [overpass] apply_osc_to_db.sh transactions


Chronological Thread 
  • From: Roland Olbricht <roland.olbricht@gmx.de>
  • To: overpass@listes.openstreetmap.fr
  • Subject: Re: [overpass] apply_osc_to_db.sh transactions
  • Date: Mon, 21 Nov 2016 06:04:23 +0100

Hi,

the write process is designed to be transactional. It's implemented and basically tested.

However, as this is an activity highly prone to race conditions, I don't claim that every possible flow of events has been tested.

That said, I would like to tell the idea how it is intended:

a) The update_from_dir process can be killed at any time. This will stop further updates from taking place. These runs will find the .lock file with a PID other then theirs and therefore freeze.

b) You can kill the update_from_dir and restart the dispatcher. On restart, the dispatcher drops the .shadow and .lock files of any previous failed update. This is on database level a rollback. In detail, the algorithm is a little bit more complicated because it does something different in case it was interrupted during copying of the index files. But the idea is to be atomic on commit.

Essentially, scenario a) is designed to stop things if a bug in update_from_dir has been hit. Scenario b) is a safe response to a computer reboot for reasons unrelated to Overpass API.

Both scenarios are somewhat but surely not exhaustively tested.

Best regards,
Roland




Archive powered by MHonArc 2.6.18.

Top of page