Caideyipi commented on PR #19021: URL: https://github.com/apache/iotdb/pull/19021#issuecomment-6418817789
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: 1. **[P1] Recovery could reinitialize a live new-region queue.** A queue created by the new-DataRegion callback is initialized from the beginning of that region, but the later full-topic recovery path could run the tail-proposal initialization again. That could make the queue pending or change its startup frontier. Recovery now skips live region bindings and only repairs missing regions ([SubscriptionConsumerAgent.java:286](https://github.com/apache/iotdb/blob/0d2ef238dd6/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/agent/SubscriptionConsumerAgent.java#L286), [ConsensusSubscriptionSetupHandler.java:630](https://github.com/apache/iotdb/blob/0d2ef238dd6/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusSubscriptionSetupHandler.java#L630)). 2. **[P1] A later setup failure could remove healthy queues and rewind concurrent commits.** The original rollback unbound every attempted topic and restored the complete setup snapshot, including regions that were already active before recovery. It now records existing region bindings, removes only queues added by the failed setup, and preserves existing queue/state objects, current commit progress, initialization markers, and WAL retention ([ConsensusSubscriptionSetupHandler.java:425](https://github.com/apache/iotdb/blob/0d2ef238dd6/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusSubscriptionSetupHandler.java#L425), [ConsensusSubscriptionCommitManager.java:283](https://github.com/apache/iotdb/blob/0d2ef238dd6/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/consensus/ConsensusSubscriptionCommitManager.java#L283)). Metadata reconciliation also performs this setup once instead of repeating it for newly subscribe d topics. 3. **[P1] The new handshake test did not compile.** `SubscriptionReceiverV1Test#testHandshakeRepairsMissingBrokerWithoutChangingConsumerMetadata` called a request builder that throws `IOException` without handling or declaring it. The test now declares the checked exception ([SubscriptionReceiverV1Test.java:225](https://github.com/apache/iotdb/blob/0d2ef238dd6/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/subscription/receiver/SubscriptionReceiverV1Test.java#L225)). 4. **[P2] Two new pipe-queue tests lacked required topic metadata.** The provider-replacement and canceled-topic fixtures used subscribed topics without registering topic metadata, so both failed before their queue assertions. The fixtures now register and clean up real topic metadata ([SubscriptionConsumerAgentBrokerRecoveryTest.java:177](https://github.com/apache/iotdb/blob/0d2ef238dd6/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/subscription/agent/SubscriptionConsumerAgentBrokerRecoveryTest.java#L177), [line 207](https://github.com/apache/iotdb/blob/0d2ef238dd6/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/subscription/agent/SubscriptionConsumerAgentBrokerRecoveryTest.java#L207)). The fixes are pushed in commit `0d2ef238dd6`. Validation performed locally on JDK 17 with bounded heap, `-DforkCount=0`, and clean source dependency rebuilds with the build cache disabled: - `mvn spotless:apply -P with-integration-tests -pl iotdb-core/datanode`: passed. - English focused reactor run: **44 tests passed, 0 failures/errors/skips**. - `with-zh-locale` focused reactor run: **44 tests passed, 0 failures/errors/skips**. - The run included `SubscriptionConsumerAgentBrokerRecoveryTest`, all `SubscriptionReceiverV1Test` methods, `SubscriptionConsumerAgentTest`, `ConsensusSubscriptionSetupHandlerTest`, and the two setup-rollback cases in `ConsensusSubscriptionCommitStateTest`. - An isolated comparison reproduced the queue-loss regression with the original setup handler (one expected failure) and passed with the fixed handler. The remote attempt did not reach test execution; the reported results are from the local fallback. Integration and full-distribution tests were not run. -- 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]
