Skip to content

GWC in-memory distributed caching - #1612

Open
dromagnoli wants to merge 1 commit into
GeoWebCache:mainfrom
dromagnoli:gwc-memory-distributed
Open

dromagnoli wants to merge 1 commit into
GeoWebCache:mainfrom
dromagnoli:gwc-memory-distributed

Conversation

@dromagnoli

@dromagnoli dromagnoli commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Add support for In-memory tile caching and provide Hazelcast implementation.
The in-memory tile cache keeps the most requested tiles in memory, in front of the blob stores. It is meant for layers whose tiles expire quickly and are requested by many clients at once, where reading each tile from disk or from a cloud store costs more than rendering time saved.

Downstream integration failures are expected.
A dedicated GS PR is available for that:
geoserver/geoserver#10214

@aaime aaime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. The direction looks good, and the outage handling and the Hazelcast usage show a lot of care. The inline comments below fall into four themes:

  • Structure and naming. Names that collide with existing GWC concepts, and state and logic split between TileCache and CachingBlobStore. Please follow the existing GWC patterns (BlobStoreInfo as a factory) and
    pull the outage state machine into its own class.
  • Consistency of the cache. Read-through races, and truncates during an outage that leave stale tiles behind. A truncate should fail rather than half succeed.
  • Cluster locks. Not wired, and more complex than they need to be.
  • Configuration. Not reachable through REST.

In addition, What's thHazelcast bulk calls have no timeout. delete, removeAll, aggregate, keySet, addIndex and clear can wait 60 s on a member that doesn't answer, while holding the configLock read lock.
The sorted index is added to the customer's map at runtime. It's undocumented, and if it fails, every truncate fails.

I'll follow up with the corresponding geoserver review

@dromagnoli
dromagnoli force-pushed the gwc-memory-distributed branch from 25a5dc3 to 24aa2a2 Compare November 10, 2026 16:27
@dromagnoli dromagnoli closed this Nov 10, 2026
@dromagnoli dromagnoli reopened this Nov 10, 2026
@dromagnoli

Copy link
Copy Markdown
Contributor Author

All Feedbacks have been addressed.

@dromagnoli
dromagnoli force-pushed the gwc-memory-distributed branch 3 times, most recently from 20f23a6 to 3da46a2 Compare November 11, 2026 09:51
@dromagnoli
dromagnoli marked this pull request as ready for review November 11, 2026 10:11
@dromagnoli dromagnoli changed the title (WIP): GWC in-memory distributed caching GWC in-memory distributed caching Nov 11, 2026

@aaime aaime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the rework. The split into MemoryCache and GuardedStore, the KeyValueStoreInfo factories, the wired lock provider and the REST endpoint answer the first round well, and most earlier points are
resolved.

Two points still need a change before merge, both covered inline:

  • HazelcastKeyValueStore.putIfAbsent has no deadline. With passthrough on, every read-through can hold a request thread and the blob store read lock for up to 60 s on a silent member.
  • Tile and range deletes fail while the cache is down. That stops disk quota, and with passthrough on the blob store fills up during a long outage.

@dromagnoli
dromagnoli force-pushed the gwc-memory-distributed branch from 3da46a2 to 949d5a5 Compare November 12, 2026 11:53
@dromagnoli

Copy link
Copy Markdown
Contributor Author

The 2 remaining points have been covered

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants