Repository navigation
[Fix] Prevent consensus subscription teardown from blocking unsubscribe - #18804
Merged
jt2594838 merged 2 commits intoOct 10, 2026
Merged
Conversation
jt2594838
approved these changes
Oct 9, 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.
Description
Unsubscribing a consensus based topic can time out when queue close waits for an active prefetch read lock or consensus queue deregistration. Broker teardown now fences new queue work immediately and completes blocking cleanup on the close executor.
Uncommitted lingering tablets are discarded during close so a later queue can replay them from WAL. Prefetch task deregistration checks the task instance, preventing delayed cleanup of an old queue from removing a replacement task.
A table model cluster IT covers ongoing writes, two consumers in one group, bounded unsubscribe of the last consumer, and immediate resubscription followed by delivery of new rows. The existing
integration-test/pom.xmlexclusion keeps subscription ITs out of the Apache build; this IT is intended to run after synchronization to the Timecho repository.Verification
mvn -o -pl iotdb-core/datanode spotless:checkpassed.mvn -o -pl iotdb-core/datanode -am -P with-zh-locale -DskipTests test-compilepassed.ConsensusPrefetchingQueueTestmethods passed viamvn -o -pl iotdb-core/datanode -Dtest=ConsensusPrefetchingQueueTest#... surefire:test.mvn -o -pl integration-test -P with-integration-tests spotless:applypassed.mvn -q -o -pl integration-test -am -P with-integration-tests -DskipTests test-compilepassed across 39 modules, including the new IT source.integration-test/pom.xmlexcludes**/subscription/it/**, and subscription is disabled in this Apache checkout. It needs execution in the Timecho repository after synchronization.ConsensusPrefetchingQueueTestclass had 37 passes and 6 failures in existing tests that use the default subscription memory budget.CommonConfig.SUBSCRIPTION_ENABLED=falsemakes that budget zero in this checkout. The repository's normal Surefire configuration excludes subscription unit tests.Review
Key changed classes:
ConsensusSubscriptionBroker,ConsensusPrefetchingQueue,ConsensusSubscriptionPrefetchExecutor, andConsensusPrefetchSubtask.