go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.28k stars 194 forks source link

Make SQL errors prevent generation of tiles #585

Open pnorman opened 5 years ago

pnorman commented 5 years ago

Right now if you configure a map with a layer that has a SQL error, it reports the error to the terminal

2019/03/14 23:54:10 map.go:195: err fetching tile (z: 8, x: 39, y: 86) features: error running layer (rivers) SQL (  SELECT ... ): ERROR: syntax error at or near ")" (SQLSTATE 42601)

But it proceeds to generate the tile and save it to the cache. This means there are tiles missing layers in the cache, so a transient error leads to the need to drop the entire cache in order to get rid of any tiles that may be missing the layer with the transient error.

I would like, either as an option or by default, SQL errors to cause the entire tile to error.

ARolek commented 5 years ago

@pnorman I like the idea of this being configurable as I think that both approaches have their use cases.

Regarding needing to blow out the cache for a single tile, this is not necessarily true. tegola cache seed/purge has support for a single zxy tile via tegola cache seed tile-name Z/X/Y.

pnorman commented 5 years ago

Regarding needing to blow out the cache for a single tile, this is not necessarily true. tegola cache seed/purge has support for a single zxy tile via tegola cache seed tile-name Z/X/Y.

How do I know what tiles I need to remove from cache? Generally I'd expect only to know there's an error after looking into problem reports, and I won't have previous tile lists saved.

gdey commented 5 years ago

I think this is a bug, as it should not blow out that tile if it was not able to generate a good replacement, either due to misconfiguration or other errors. I agree that tiles (from the cache perspective should) should be considered as a unit, made up of all the layers generating correctly. If any subunit fails the entire tile fail and not be written to the cache. I think this should be default behavior.

marcu commented 1 month ago

Hello. Do you have any update on that topic ? Thanks a lot