yuqi1129 opened a new pull request, #12351: URL: https://github.com/apache/gravitino/pull/12351
### What changes were proposed in this pull request? Add optimistic concurrency control to the complete alter and delete operations for users and groups. - Increment the entity version on every alter and update by id plus the expected current version. - Apply the same CAS rule to user updates addressed by external id. - Delete users and groups by id plus the expected current version. - Abort the transaction on a stale CAS before changing role or owner relationships. - Report stale operations with `OptimisticLockException`. This PR depends on #12349. ### Why are the changes needed? Concurrent principal changes must not silently overwrite newer state or partially update role and owner relationships after the root entity CAS fails. Fix: #12343 ### Does this PR introduce _any_ user-facing change? Concurrent alter and delete conflicts for users and groups are reported as HTTP 409 through the shared conflict contract from #12349. ### How was this patch tested? Added version increment, stale delete, typed conflict, role-relation rollback, and external-id update 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.TestUserMetaService' --tests 'org.apache.gravitino.storage.relational.service.TestGroupMetaService' -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]
