autoCAT6 opened a new pull request, #14045:
URL: https://github.com/apache/gravitino/pull/14045

   ### What changes were proposed in this pull request?
   
   Coalesce role-policy reloads across requests for the same role version and 
clear generation. Each request completes all loads it owns before waiting for 
other requests, preserving batch reads without introducing overlapping-batch 
deadlocks. Failed loads reach every waiter, completed flights are removed, and 
interrupting a waiter does not cancel shared work.
   
   Keep a bounded active-call version floor so a late older load cannot 
overwrite a newer partial policy state. Reject obsolete results explicitly when 
no complete current replacement exists. Clear-generation snapshots and 
publication checks also prevent a pre-invalidation load from republishing 
cleared policies.
   
   Add deterministic concurrency regressions and an H2/MyBatis fixture that 
exercises public authorization with separate request contexts and persisted 
role entities, including privilege revocation.
   
   ### Why are the changes needed?
   
   Concurrent requests currently duplicate role entity reads and metadata 
resolution after cache eviction or privilege changes. Serializing the final 
policy replacement alone does not coalesce that work. A complete-load marker 
also cannot protect a newer partial load from an older in-progress result.
   
   Fixes #13612
   
   ### Does this PR introduce _any_ user-facing change?
   
   Role reloads share work across requests while retaining request-local role 
membership. No public API or configuration changes.
   
   ### How was this patch tested?
   
   ```sh
   ./gradlew :server-common:test :core:coreH2Test \
     -PskipITs -PskipWeb=true -PskipTrinoConnector=true \
     --no-daemon --no-parallel --max-workers=2 --console=plain
   ```
   
   - `server-common`: 517 tests passed; `coreH2Test`: 596 passed; no skipped 
tests.
   - Controlled baseline/fix comparison: eight stale request contexts make 8 
versus 1 role batch reads; four real H2-backed authorization requests make 4 
versus 1. These count `EntityStore` calls/entities, not total SQL queries or 
production throughput.
   - Regressions cover failure fanout/retry, independent roles and versions, 
overlapping batches, interruption, resolver exceptions/errors, incomplete 
batches, clear-generation pruning, partial-version ordering, and cache-expiry 
lock/probe boundaries.
   - Spotless checks passed. One unchanged mutual-TLS test initially received a 
different `IOException` classification; the full rerun above passed without 
source changes.
   
   MySQL, PostgreSQL and Docker integration suites were not run.
   


-- 
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]

Reply via email to