yuqi1129 opened a new pull request, #12680: URL: https://github.com/apache/gravitino/pull/12680
### What changes were proposed in this pull request? - Use `topic_meta.current_version` as the OCC token for topic alters and direct deletes. - Run the root topic CAS and dependent metadata cleanup in one transaction. - Classify stale writes as either `OptimisticLockException` or `NoSuchEntityException`. - Lock the parent schema during topic creation. - Preserve monotonic versions and persisted topic IDs during overwrite across H2, MySQL, and PostgreSQL. - Invalidate the entity cache after overwrite because the database may preserve existing identity. - Add SQL-provider, service, converter, and cache tests for the OCC behavior. ### Why are the changes needed? Concurrent topic writes could overwrite newer metadata, and a stale delete could remove relationships belonging to a newer topic. Overwrite could also reset the OCC version or cache an entity whose ID differed from the row retained by the database. Fix: #12651 ### Does this PR introduce _any_ user-facing change? Yes. Concurrent stale topic writes now fail with an optimistic-lock conflict, while writes against a topic that was deleted or renamed report that the topic no longer exists. No public API or property key is changed. ### How was this patch tested? - `./gradlew --no-daemon :core:spotlessApply` - `SKIP_DOCKER_TESTS=true ./gradlew --no-daemon :core:check -PskipITs -PskipDockerTests=true` - Targeted Topic service, SQL-provider, PO converter, and relational entity-store tests -- 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]
