Repository navigation
Repair missing subscription brokers from consumer metadata - #19021
Conversation
|
Self-review passed; no confirmed code issues were found. The change adds serialized, idempotent broker and consensus-subscription recovery for non-empty consumer-group metadata during metadata reconciliation and handshake. Empty metadata remains non-recovering, canceled topics are not restored, existing queues are preserved, and provider replacement remains session-only without a subscription CLOSE or commit replay. Verification:
|
|
Independent review of the full diff and the related subscription broker, consumer metadata, handshake, provider replacement, and ConfigNode procedure paths found and fixed these issues:
The fixes are pushed in commit Validation performed locally on JDK 17 with bounded heap,
The remote attempt did not reach test execution; the reported results are from the local fallback. Integration and full-distribution tests were not run. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #19021 +/- ##
============================================
- Coverage 47.78% 47.78% -0.01%
Complexity 604 604
============================================
Files 5559 5559
Lines 407605 407714 +109
Branches 53583 53602 +19
============================================
+ Hits 194783 194812 +29
- Misses 212822 212902 +80 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Independent re-review of the complete diff and the related broker, consumer metadata, handshake, provider replacement, and ConfigNode procedure paths found a remaining P1 concurrency gap between broker repair and new-region callbacks. At the previous head, the pre-setup queue snapshot could miss a queue created by a concurrent callback. Repair could then apply tail-proposal initialization to that queue, or its rollback could remove the callback's queue and progress after another topic failed. Repair could also bind an already-visible new peer before its callback initialized it from the beginning, risking skipped initial writes. Fixed and pushed in 50008fb:
Actual verification this round:
No integration tests or distribution packaging were run. This round's newly added tests were executed remotely, not locally. |
|
| SubscriptionAgent.topic() | ||
| .getTopicConfigs(java.util.Collections.singleton(topicName), isTableModel); |




Summary
When a DataNode still has non-empty consumer-group metadata but its local subscription broker was removed by inactivity cleanup or a metadata race, the next handshake or metadata push now recreates the broker and repairs consensus subscriptions instead of leaving the provider at broker-missing status 1904.
Implementation
SubscriptionConsumerAgent.ensureConsumerGroupBrokerpath serialized by the existing per-consumer-group lock.createPipeBrokerIfNotExistandsetupConsensusSubscriptions; duplicate brokers and consensus queues are prevented by the existing broker and queue guards.ConsumerGroupMetaempty. A group cleared before a later handshake is not guessed back into its previous topics; explicit subscription metadata remains authoritative.Tests
mvn spotless:apply -P with-integration-tests -pl iotdb-core/datanodepassed.-DforkCount=0retry failed in the Maven Checkstyle phase for the same system commit-memory limitation.with-zh-localeincremental compiles reached javac but were blocked by pre-existing generated-source and dependency inconsistencies (IFill/IFillFilter/LinearFill,commons-collections4, and unrelated pipe/query API mismatches).