yuqi1129 opened a new issue, #12020:
URL: https://github.com/apache/gravitino/issues/12020
### Describe the subtask
Add an optional `redis` entity cache behind the same SPI for deployments
that want strong (read-your-writes) consistency by keeping one cluster-wide
copy instead of one copy per node. It is selected by
`gravitino.cache.impl=redis`; the default stays `caffeine`. Because relation
data is no longer cached (#11961), the shared cache only needs to store
single-entity entries, which keeps this implementation simple.
This subtask should:
- Add `RedisEntityCache` with `coherence() = SHARED`: store entity values as
`D:{key}` strings, plus an `IDX` ZSet forward index used only for the
hierarchical-drop prefix range (`ZRANGEBYLEX`); no reverse index.
- Implement get / put / invalidate / clear, and run a container drop plus
the delete-then-stale-write guard as a version-checked Lua script, so a reader
never sees a half-done drop and a stale write cannot overwrite a newer value.
- Register `"redis" -> RedisEntityCache.class` in `CacheFactory` and add the
config keys (`address`, `namespace`, `ttl`, `serializer`); callers do not
change.
- Add integration tests with a Redis container: cross-node freshness,
container drop via `ZRANGEBYLEX`, and rejection of a stale write after a
committed newer value.
This delivers Phase 2 of #11737. If the change grows beyond a comfortably
reviewable size, the integration tests can be split into a follow-up.
### Parent issue
https://github.com/apache/gravitino/issues/11737
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]