Live reloading for PostgreSQL, PMTiles and COG sources
Back in 1.8.0 we taught Martin to hot-reload MBTiles directories.
This release finishes the job: PostgreSQL, PMTiles and COG sources now reload automatically too, so Martin keeps serving fresh data without a restart.
Two reload mechanisms are used, depending on what the source can observe:
- File system events - local PMTiles and COG files reload as soon as the underlying file changes on disk (#2750, #2858).
- Fixed timer (polling) - PostgreSQL and remote PMTiles (object stores) can't watch the file system, so Martin polls them on a timer (configurable, default 10m) and reloads when it detects a change. PostgreSQL picks up new and changed tables/functions as they appear, and remote object stores now track source data versions to know when to reload (#2841, #2864).
Under the hood, every source type now shares a common ReloadDriver/Discovery mechanism, which should make future source types easier to support. (#2835, #2836, #2837, #2886, #2844, #2845, #2840, #2852, #2853, #2861, #2867).
☀️ GSoC spotlight: a new duckdb source (in martin-core)
A warm welcome to Manbhav Sugla (@manbhav234), our Google Summer of Code student!
This release lands his first PR, kicking off a brand-new DuckDB source for Martin and laying the groundwork for serving tiles from DuckDB.
It is still early and not currently entierly plumbed through the system, but it is a good start.
Done in #2831.
Static rendering core
We added the core machinery for static (single-image) rendering.
This allows you to do static rendering such as for example this OG-image showing Munich near Garching:
Done in #2804.
Fixed
- (martin) Static rendering now rejects invalid scale values and inverted bounding boxes instead of producing broken output (#2830).
- (pg) Use
ST_EstimatedExtentfor faster bounds calculation at startup (#1220). - (sprites) Ignored directories are now skipped during sprite resolution (#2815).
- (unstable-cog) Allow up to 0.1% tolerance (up to 3m of error at z0) when matching a COG's zoom level to WebMercatorQuad (#2878).
Other
- The MapLibre Native renderer is now multi-threaded and was updated to
maplibre_native@8.1(#2826, #2859). - A large refactor split the config code into dedicated
config, parsing and lifecycle modules, added tests for exactly how config parsing behaves, and moved test helpers totest_support(#2874, #2875, #2876, #2872, #2885). martin-tile-utilsnow has#![forbid(unsafe_code)], error types with multiple identical fields got names, import ordering drift was fixed, and a pre-commit hook simplifies UTF characters (#2847, #2832, #2838, #2827).- Render fixtures are now cached in CI (#2828).
- (deps) Updated
sqlxto 0.9.0 (adapting MBTiles dynamic SQL toSqlSafeStr), refreshed the lockfile, autoupdated pre-commit, and bumped npm dependencies (#2821, #2822, #2849, #2896, #2856, #2889).