[ISSUE #10375] Fix race condition between deleteTopic and FlushConsumeQueueService by removing getLifeCycle indirection#10376
Merged
lizhimins merged 1 commit intoMay 25, 2026
Conversation
98772b0 to
c72194d
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10376 +/- ##
=============================================
- Coverage 48.90% 48.79% -0.12%
+ Complexity 13460 13422 -38
=============================================
Files 1376 1376
Lines 100539 100527 -12
Branches 12983 12983
=============================================
- Hits 49169 49051 -118
- Misses 45370 45466 +96
- Partials 6000 6010 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c72194d to
74ad874
Compare
…eueService by removing getLifeCycle indirection - Remove getLifeCycle() which delegates to findOrCreateConsumeQueue(), eliminating the risk of recreating a deleted topic's ConsumeQueue during concurrent flush operations - Call ConsumeQueueInterface methods directly on the instance instead of re-looking up through findOrCreateConsumeQueue - Deprecate delegate methods (load, recover, checkSelf, flush, deleteExpiredFile, truncateDirtyLogicFiles, swapMap, cleanSwappedMap, isFirstFileAvailable, isFirstFileExist) that previously used getLifeCycle indirection - Remove unnecessary RocksDBException from getDispatchFromPhyOffset signature - Fix maps.values().size() to maps.size() in recoverConcurrently
74ad874 to
ec92ad5
Compare
lizhimins
approved these changes
May 25, 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.
Which Issue(s) This PR Fixes
Brief Description
This PR fixes a race condition in ConsumeQueueStore where a deleted topic could be unintentionally recreated in consumeQueueTable.
Root Cause: Methods like flush, recover, deleteExpiredFile, etc. delegated to getLifeCycle(topic, queueId) which internally called findOrCreateConsumeQueue. When FlushConsumeQueueService iterated consumeQueueTable and flushed a ConsumeQueue whose topic had just been removed by deleteTopic on another thread, findOrCreateConsumeQueue would recreate the deleted topic entry.
Fix: Remove the getLifeCycle indirection and invoke ConsumeQueueInterface methods directly on the already-held instance, eliminating any possibility of recreating a deleted topic. The old delegate methods are preserved with @deprecated for binary compatibility.
How Did You Test This Change?
Unit Test