yuqi1129 opened a new issue, #13828: URL: https://github.com/apache/gravitino/issues/13828
### Describe the proposal Improve Caffeine entity and catalog cache correctness across Gravitino servers, and establish reproducible performance and regression coverage. Four deterministic regression tests fail against Apache Gravitino main at `1edfaf53999f8469c577c08ad12155a6ca8769c8`: 1. **Commit ordering:** a lower change-log ID that commits after a higher ID has been consumed is skipped by the `id > cursor` query. Auto-increment allocation order does not guarantee commit order. 2. **Invalidation versus cache fill:** a point read can load a child before ancestor invalidation, then publish that stale child after the ancestor's index scan has completed. 3. **Identifier collisions:** distinct names such as `[lake, catalog, schema, a.b]` and `[lake, catalog, schema.a, b]` share the flattened index key, leaving a stale entry after cascading invalidation. 4. **Catalog mutation markers:** polling can consume a local change before its marker is registered; the leftover marker can then suppress a later remote change for the same identifier. Validation used targeted Java tests; the commit-order test used H2. These are deterministic implementation-level reproductions, not a full multi-host REST or performance benchmark. Performance improvements will be evaluated against the current upstream implementation before selecting changes or thresholds. Coordinate with #10252 (cache inventory), #13594 (performance stabilization), and #13621 (transaction-aware EntityStore APIs). Reuse existing subtasks where applicable. Keep optional Redis support in #12020 separate. ### Task list - [ ] Implement lossless change consumption across out-of-order commits, rollbacks, startup, disconnects, and retention gaps; preserve bounded database and log-retention costs. Revisit the remaining commit-order case discussed in #11736. - [ ] Prevent stale point-read and batch-read publication after ancestor invalidation or transaction completion; coordinate with #13820 rather than introduce a competing transaction protocol. - [ ] Preserve identifier segment boundaries in cache indexes; cover dots, separators, prefixes, hierarchy, and entity-type isolation. - [ ] Replace timing-sensitive catalog local-mutation suppression with unambiguous change attribution; test hot catalogs and configurations with TTL disabled. - [ ] Define a cache-eligibility matrix for every entity type, including rationale for excluded types and dependent authorization/derived-cache invalidation. Cover create, update, rename, drop/recreate, and ancestor deletion. - [ ] Maintain regression coverage for asynchronous removal/reinsertion (#13136) and cache cleanup deadlocks (#13580). Current main has relevant guards; verify them and reconcile issue status instead of duplicating implemented fixes. - [ ] Benchmark current backlog draining (#13581), polling/database work, hierarchy invalidation, lock contention, and cold/warm cache behavior. Adopt changes only with reproducible before/after results and no correctness regression. - [ ] Add three-server REST tests using shared MySQL/PostgreSQL, including ordinary users, authorization changes, concurrent writers, restart, network recovery, and retention recovery. Run deterministic unit coverage on H2 as well. - [ ] Publish workload/configuration and repeated-run artifacts: throughput, p50/p95/p99 latency, errors, SQL/pool activity, invalidation lag, allocations, GC, and memory. Define workload-specific regression thresholds and document the eventual-consistency contract and recovery behavior. -- 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]
