You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We observed a delay in tile updates for changeset 177843. The changes were visible in some zoom levels but missing or partially rendered in others, even after 2+ hours.
Initial assumption was that the vector tile pipeline was slow or stalled. However, investigation shows a more nuanced issue related to materialized views refresh.
What Happened
Step 1. The changeset entered the OHM database and proceeded through minute replication as expected.
Step 2. It was then picked up by Imposm and written into the vtiles database. and generated expired tiles files
Step 3. Tiler cache takes that expired tiles files and cleaning happens for the edited area.
Step 4. However, tiles were requested before the materialized views were fully refreshed. (materialized views are created from Imposm tables), This issue can often occur when a user makes edits and expects to see their changes reflected immediately.
Step 5. Tegola generated tiles using the outdated views, caching results that excluded the new data.
Step 6. As a result, cached tiles served outdated content despite the database being updated.
Step 7. Multilingual view updates may further increase the frequency of this type of issue as we expand.
Proposed Next Steps
Implement a second round of cache purge after materialized views are updated (not just after raw imports) or delay a bit more the cache cleaning.
Your feedback or ideas to improve this cache cleaning would be appreciated :).
I have implemented a mechanism that cleans the affected area twice. The first cleanup happens immediately when the Imposm expiration files are generated and uploaded in s3. The second cleanup occurs one hour later. This one-hour delay ensures that all materialized views have been fully updated.
Activity
Rub21 commentedon Jun 26, 2025
I have implemented a mechanism that cleans the affected area twice. The first cleanup happens immediately when the Imposm expiration files are generated and uploaded in s3. The second cleanup occurs one hour later. This one-hour delay ensures that all materialized views have been fully updated.
The key is that once we receive the SQS message from the expiration files, the script starts cleaning up the tiles. at same time it generates a delayed SQS message, which will be processed again after one hour by the same script.
• Generating the delayed SQS message:
https://github.com/OpenHistoricalMap/ohm-deploy/blob/fef5b2114cd6e6daf233bad75ea92256e50e5dc8/images/tiler-cache/sqs_processor.py#L125-L131
• After one hour, the same area is cleaned again using that delayed message:
https://github.com/OpenHistoricalMap/ohm-deploy/blob/fef5b2114cd6e6daf233bad75ea92256e50e5dc8/images/tiler-cache/sqs_processor.py#L87-L94
With this mechanism, we ensure that the vector tiles will show refreshed data immediately—or at most within one hour.
Rub21 commentedon Jun 26, 2025
Done