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 12:17:44 +0100

Hi mmd,

can you maybe also elaborate a bit what happens if: :copy_shadows_to_mains()
gets aborted somewhere in the middle?

The steps are as follows:
- The lock file "osm_base_shadow" is created
- copy_shadows_to_mains() runs
- The lock file "osm_base_shadow" is deleted
- The .shadow files are deleted

The semantics are:
- if "osm_base_shadow" is present, then the ".shadow" files are authorative
- otherwise the standard index files are authorative. If .shadow files exist then they are only authorative for the write process.

In particular the database is never invalid. A file can have no other state then "present" or "absent". And the state of the (very shortlived) file "osm_base_shadow" determines which of the two sets of index files are valid.

From this one can conclude the right approach on restart:
- if "osm_base_shadow" is present then first copy_shadows_to_mains(), afterwards delete "osm_base_shadow"
- if .shadow files are (still) present, then delete them

The dispatcher does that for you. Hence, it should be impossible to get the database corrupted this way.

Best regards,

Roland




Archive powered by MHonArc 2.6.18.

Top of page