yuqi1129 opened a new pull request, #12349: URL: https://github.com/apache/gravitino/pull/12349
### What changes were proposed in this pull request? - Add `OptimisticLockException` as the shared optimistic-concurrency conflict contract. - Add error code 1012 and an optimistic-lock error response. - Map optimistic-lock conflicts to HTTP 409. - Add response, server utility, and REST exception-handler tests. This PR only defines the shared contract. Entity-specific CAS behavior will be implemented by the follow-up subtasks of #12166. ### Why are the changes needed? Entity write paths need a typed conflict signal instead of relying on generic exceptions or matching error-message prefixes. A shared exception and REST mapping allow later entity PRs to report lost CAS operations consistently. Fix: #12341 ### Does this PR introduce _any_ user-facing change? Yes. It introduces the public `OptimisticLockException` type and error code 1012. REST operations that throw this exception are returned as HTTP 409 Conflict. ### How was this patch tested? - `./gradlew spotlessApply` - `./gradlew :common:test --tests 'org.apache.gravitino.dto.responses.TestResponses' :server-common:test --tests 'org.apache.gravitino.server.web.TestUtils' :server:test --tests 'org.apache.gravitino.server.web.rest.TestExceptionHandlers' -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]
