Skip to content

Vector tile db needs repair #577

Closed
Closed

Description

@jeffreyameyer

Bug description
It appears that a variety of vector tiles aren't getting refreshed properly.

See here: https://vtiles.openhistoricalmap.org/#11.06/37.6923/-121.942
Cool pattern. Uncool tiles.

Monosnap Vue App 2023-08-08 08-37-09

You can see this effect in the rendered tiles, where admin boundaries just stop at a tile edge:
https://www.openhistoricalmap.org/#map=13/37.3822/-122.0754&layers=O&date=1846-12-05&daterange=1800-01-01,2023-12-31
Monosnap OpenHistoricalMap 2023-08-08 08-44-18

and... https://www.openhistoricalmap.org/#map=14/37.4242/-122.1331&layers=O&date=1846-12-05&daterange=1800-01-01,2023-12-31 shows that the missing tiles aren't always in the same tile pyramid...
Monosnap OpenHistoricalMap 2023-08-08 08-45-13

I am suspicious of how long ago this may have started - perhaps long before our K8s upgrade? See #539 for an example of where existing data is dense enough to possibly obfuscate missing tiles.

For example, with all layers except land_ohm removed, at https://vtiles.openhistoricalmap.org/#12.17/37.40724/-122.05192, you can see that the tile on the right that appears to have much less data still has a few features, but a random, uncorrelated with when the features were created, subset.
tile_compare

What should be happening?
All tiles should be consistently refreshed and have complete representation of the data in the database.

Activity

  1. batpad commented on Aug 9, 2023

    @batpad
  2. geohacker commented on Aug 9, 2023

    @geohacker

    @jeffreyameyer thank you for the ticket. This is weird but I'm pretty sure it's because of the size of the 10/165/397 tile — it's 10MB. MVT should ideally be less than 500k
    image

    In this particular case, I'm pretty sure it's because we try to surface San Jose all the way to admin 8.
    It may be a good moment to revisit our admin area tiling schema.

  3. geohacker commented on Aug 9, 2023

    @geohacker

    That theory doesn't hold well for 11/330/792 for example.

    image

  4. Rub21 commented on Aug 9, 2023

    @Rub21
    Member

    @jeffreyameyer @geohacker, the issue seems to have originated from the cache cleaner. I've manually cleared the cache, and everything is functioning properly now. It appears that since we transitioned to a smaller node compared to our previous infrastructure, the cache cleaning process is taking longer. but server and database is working fine, A potential solution would be to add an additional cache-clenaer pod during periods of increased workload.

  5. jeffreyameyer commented on Aug 9, 2023

    @jeffreyameyer
    MemberAuthor
  6. geohacker commented on Aug 10, 2023

    @geohacker

    Thank you for trying the cache @Rub21! Perfect. Let's make sure the cache cleaner pod has more resources and can perform the tile invalidations minutely.

    a) do we have any way of monitoring when tiles exceed size limits?

    @jeffreyameyer not really. This will be case by case. It will be mostly because of admin boundaries — those are large polygons that affect multiple zooms

    are we limited in tile size by our tile server & if so, do other servers
    have higher limits?

    The tile size limit is not specific to a tile server. It's at the tile specification level. Mapbox Vector Tiles are expected to be 500kb. We do have larger tiles and style them but at some point they will be problematic.

  7. jeffreyameyer commented on Aug 17, 2023

    @jeffreyameyer
    MemberAuthor

    Vtiles not updating again. Is this cache-related, as well? @1ec5

  8. jeffreyameyer commented on Aug 30, 2023

    @jeffreyameyer
    MemberAuthor

    Hi @Rub21 - it looks like the vtiles are not updating again. Did we get any monitoring alerts?

  9. Rub21 commented on Aug 31, 2023

    @Rub21
    Member

    @batpad @jeffreyameyer , I have just deployed our latest approach of removing tegola process when there are a lot concurrency of tegola cache cleaner and remove the s3 files direct form the bucket, until we find a better approach for this issue. the tiles should be updated soon enough.

  10. geohacker commented on Sep 1, 2023

    @geohacker

    @Rub21 @batpad I think we should change our approach to tile cache clearance and scale that reliably. My recommendation is to move away from single tile clearance to using the batch option. This means:

    15/0/0
    15/0/1
    15/1/1
    

    I think the imposm expire list should be in the same format but we should confirm @Rub21.
    Then we can provide more resources for the pod and the cache clearance should be more reliable.

    @Rub21 are you able to start a PR for this change? Thank you!

  11. Rub21 commented on Sep 4, 2023

    @Rub21
    Member

    @geohacker , We are currently utilizing the tegola cache purge tile-list command to manage cache purging. The script can be found in the OHM-Deploy repository, OHM-Deploy GitHub Link.

    The issue of high concurrency isn't constant but occurs only when there are large and many editions. Scaling resources vertically would be a more expensive for this issue Therefore, Sanjay and I we have been talking about to implement horizontal pod autoscaling using the Elastic File System (EFS). This will allow it to synchronize the tile list is managed by a separate cache-cleaner pod. By doing so, we can dynamically increase the number of nodes and pods during peak periods. Like we are doing for the web container.

  12. added theissue type on Mar 16, 2025
  13. Rub21 commented on Mar 26, 2025

    @Rub21
    Member

    Closing this issue, since this is not happening any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions