mod_tile icon indicating copy to clipboard operation
mod_tile copied to clipboard

Corrupt meta tiles not refreshed

Open woodpeck opened this issue 4 years ago • 2 comments

If for any reason a meta tile on disk is broken, mod_tile will return a 404 error to the client and not attempt to re-render the broken tile (unless/until it is considered "old"). It might make sense to change that, and instead attempt a re-render if encountering a broken meta tile.

woodpeck avatar May 28 '20 09:05 woodpeck

Sounds like a good idea.

I assume we have no idea on how meta tiles got corrupted in the beginning. Is there a way to scan the tile store for broken tiles?

stephankn avatar May 28 '20 14:05 stephankn

The place where such a call should be made is probably https://github.com/openstreetmap/mod_tile/blob/50afe3e35161786c890d5fab5b8c3b6c4444eb5e/src/mod_tile.c#L1550

Most broken tiles I have witnessed were the result of a disk full condition. In 95% of cases they would be 0-byte files which can easily be cleaned up with a "find" operation, but at least for the tirex backend it is possible that a truncated meta tile gets created (https://github.com/openstreetmap/tirex/issues/51). It is possible that the problem does not exist for renderd at all but still people could copy meta tiles from one box to the other or find other means to create broken meta tiles.

woodpeck avatar May 19 '22 08:05 woodpeck