You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "yuqi1129 (via GitHub)" <gi...@apache.org> on 2026/06/18 13:24:42 UTC

[I] [Improvement] Make entity store cache usable in multi-node deployments [gravitino]

yuqi1129 opened a new issue, #11737:
URL: https://github.com/apache/gravitino/issues/11737

   ### What would you like to be improved?
   
   The entity store cache (`gravitino.cache.enabled`, default `true`) only invalidates **locally**. In a multi-node deployment it must be set to `false`, which significantly hurts some catalogs (Iceberg especially). The jcasbin cache already solves cross-node invalidation via `entity_change_log` and `EntityChangeLogPoller`; the entity store cache is simply not wired into that channel.
   
   This tracks a design to make `enabled=true` usable in multi-node by invalidating the entity store cache across nodes through the existing change-log mechanism.
   
   ### How should we improve?
   
   A design doc is proposed (see linked PR). It covers:
   
   - **Consistency model**: writes stay strongly consistent (DB plus optimistic lock); single-entity and relation reads become cross-node eventually consistent (within one poll interval).
   - **The relation-cache difficulty**: relations are cached bidirectionally, so a remote node cannot always derive the reverse keys to invalidate.
   - **Two options**: (A, main) coarse invalidation by metalake, a small change that reuses the schema; (B, alternative) precise per-endpoint invalidation, more code but no stampede.
   - **Coverage gap**: auth and metadata entities (role/user/group/tag/policy) emit no change-log today and must gain emit points.
   
   Related: #11736 (poller reliability issues found while designing this).
   


-- 
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: commits-unsubscribe@gravitino.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Make entity store cache usable in multi-node deployments [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on issue #11737:
URL: https://github.com/apache/gravitino/issues/11737#issuecomment-5757868540

   Status as of 2026-09-21.
   
   **Done:** #11923, #11961, #12151 (which also delivered #12018 / #12019), #12416, #12418, #12440.
   **In review:** #13099 (`expireAfterWrite`, part of #12377), #13106 (Redis, #12020).
   **Closed as done:** #12018, #12019, #12149.
   
   Order for the rest:
   1. #13099 — bounded TTL backstop.
   2. #12376 — `batchGet` write-back race (authorization hot path).
   3. #12150 — fresh-read channel and the action-sensitive call sites.
   4. #12377 — `exists()` short-circuit and conditional updates in `PolicyManager` / `JobManager`.
   5. #12419 — poller and cache metrics before recommending `gravitino.cache.enabled=true` for multi-node.
   6. #12152 — tag/policy inheritance batching.
   7. #12377 — poller cursor re-evaluation and backlog drain.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Make entity store cache usable in multi-node deployments [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on issue #11737:
URL: https://github.com/apache/gravitino/issues/11737#issuecomment-5043031282

   Tracking refinement after reviewing the design and the current implementation.
   
   New subtasks:
   
   - #12149 defines a shared, default-deny cache eligibility policy and audits action-sensitive and connector-backed entities.
   - #12150 adds explicit fresh/cache-bypass reads for consistency-sensitive operations.
   - #12151 makes change-log emission transactionally complete across cacheable entity types and mutation paths.
   - #12152 batches tag/policy inheritance relation reads and adds executable database-performance acceptance criteria.
   
   Existing implementation subtasks remain:
   
   - #11961 removes generic relation-list caching.
   - #12018 implements an entity-type allowlist. Its decisions must be reconciled with the broader policy audit in #12149 before either issue closes, especially for metalake state, policy/job data, and connector-backed schema/table data.
   - #12019 wires Caffeine to cross-node change-log invalidation.
   - #12020 provides the optional Redis implementation, subject to an explicit DB/cache failure contract.
   
   Correctness dependencies:
   
   - #11736 must not be treated as fully resolved by listener retry alone. PR #11739 explicitly leaves the auto-increment commit-order gap as a known limitation; the entity-cache design needs either prevention or a documented fail-safe/bounded-staleness contract.
   - #10739 / #10740 fixed invalidation-before-write ordering. A load that starts before a post-commit invalidation can still finish and refill stale data afterward, so `get`, `batchGet`, rename/drop, and hierarchical invalidation need a deterministic late-fill test and a fence if the race remains.
   
   The epic should close only when Caffeine's bounded-eventual semantics, fresh-read paths, mutation-event coverage, poller failure behavior, late-fill behavior, and multi-node tests are all explicit and verified. A shared Redis copy should not be described as strongly consistent with the database unless write ordering and failure behavior make that guarantee precise.
   


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improvement] Make entity store cache usable in multi-node deployments [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 closed issue #11737: [Improvement] Make entity store cache usable in multi-node deployments
URL: 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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org