[#12651] improvement(core): add OCC for topic writes - #12680
Merged
Conversation
Code Coverage Report
Files
|
yuqi1129
force-pushed
the
feat/12651-occ-topic
branch
from
August 30, 2026 12:40
d6e32f8 to
d9ddce9
Compare
jerryshao
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
topic_meta.current_versionas the OCC token for topic alters and direct deletes.OptimisticLockExceptionorNoSuchEntityException.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:spotlessApplySKIP_DOCKER_TESTS=true ./gradlew --no-daemon :core:check -PskipITs -PskipDockerTests=true