geoserver / geoserver-cloud

Cloud Native GeoServer is GeoServer ready to use in the cloud through dockerized microservices.
http://geoserver.org/geoserver-cloud
Other
244 stars 73 forks source link

[backport] Fix GWC not storing tiles on disk when using pgconfig catalog backend #451

Closed groldan closed 4 months ago

groldan commented 4 months ago

When using the pgconfig catalog backend, it replaces the default GWC tile layer catalog with a specialized one to store the tile layers config directly on the database instead of going through the resource store.

To do so, it has to exclude the GWCInitializer bean, as it depends on a TileLayerCatalog.

By doing so, we missed the call to ConfigurableBlobStore.setChanged(...), resulting in the ConfigurableBlobStore decorator never having its configured flag set to true, and hence never calling the actual BlobStore's put(TileObject) method.

This patch introduces PgsqlGwcInitializer as a replacement for the default GWCInitializer, which takes care of that and also listens to TileEvents to maintain the non-memory-cacheable list of layers in sync at org.geowebcache.storage.blobstore.memory.CacheProvider.