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

   ### What changes were proposed in this pull request?
   
   Add optimistic concurrency control to the complete alter and delete 
operations for roles.
   
   - Increment the role version on every alter and update by id plus the 
expected current version.
   - Delete roles by id plus the expected current version.
   - Abort the transaction on a stale CAS before changing user-role, 
group-role, securable-object, or owner relationships.
   - Report stale operations with `OptimisticLockException`.
   
   This PR depends on #12349.
   
   ### Why are the changes needed?
   
   Concurrent role changes must not silently overwrite newer state or partially 
update authorization relationships after the role CAS fails.
   
   Fix: #12344
   
   ### Does this PR introduce _any_ user-facing change?
   
   Concurrent alter and delete conflicts for roles are reported as HTTP 409 
through the shared conflict contract from #12349.
   
   ### How was this patch tested?
   
   Added version increment, stale delete, typed conflict, and securable-object 
rollback tests. Ran:
   
   `./gradlew :core:test --tests 
'org.apache.gravitino.storage.relational.mapper.provider.base.TestAuthMappers' 
--tests 'org.apache.gravitino.storage.relational.utils.TestPOConverters' 
--tests 'org.apache.gravitino.storage.relational.service.TestRoleMetaService' 
-PskipITs -PskipDockerTests=true`
   


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