OpenTopoMap icon indicating copy to clipboard operation
OpenTopoMap copied to clipboard

update_lowzoom.sh: a suggestion and a doubt

Open Roburetto opened this issue 6 years ago • 1 comments

When a connection to the database is open (mostly always) update_lowzoom.sh fails to drop the database and complains ("ERROR: database "lowzoom" is being accessed by other users" - in reality the same user running the script) but still runs partially. The result being for instance you end up with duplicate labels for cities and major towns.

I wonder if would be possible either to start the script by forcing all existing connection to the database to be closed or alternatively to add a clause aborting all operations when the mentioned error happens?

Also, how often is suggested update_lowzoom.sh should be run? Every time the main database is updated?

Thanks.

PostgreSQL version being used: 11.3 (Debian 11.3-1.pgdg90+1)

Roburetto avatar May 31 '19 09:05 Roburetto

I'm also considering solutions to update the lowzoom db. In your case, there is always the possibility to stop the renderer (tirex or renderd) and run the script. During that time, rendering requests will be refused, but allready rendered tiles will be sent by mod_tile.

I'm currently operating an OTM server and I think I'll update the lowzoom calculation scripts in order to have temporary tables like borders_tmp lakelabels_tmp etc. And when the update is done, drop old tables and rename those to the production ones. This removes the need to drop+create the db, limit the problem of connected users and reduce the downtime of the renderer.

If you are not updating minutely, update_lowzoom.sh should be run after every osm2pgsql import

sletuffe avatar Jan 21 '20 09:01 sletuffe