Caideyipi commented on PR #19019: URL: https://github.com/apache/iotdb/pull/19019#issuecomment-6414458490
Self-review passed after fixing four confirmed issues in [3a8557836b0](https://github.com/apache/iotdb/commit/3a8557836b00d7687d676476caac5618daf7d8dd). No actionable findings remain from this review. I reviewed the complete PR diff and the surrounding Pipe/broker/queue lifecycle, committed progress and uncommitted events, resubscription, consumer close, topic deletion, retain true-to-false transitions, recovery and serialization boundaries, rollback, tree/table isolation, and retain=false behavior. The findings below link to the original reviewed revision, before the fixes: 1. **[P1] Rewind multipart responses before retained redelivery** — [SubscriptionBroker.java:405–408](https://github.com/apache/iotdb/blob/f3d9020835b0145d013ba0e76967389e40064ea7/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/broker/SubscriptionBroker.java#L405-L408). The original requeue only reset the delivery timestamp. A downloaded but uncommitted TsFile/tablet event could therefore replay FILE_SEAL or the final tablet page instead of its data after resubscription. Retained redelivery now resets the response as well, without incrementing the poison-message nack count. Regression tests cover complete TsFile/tablet replay and repeated unsubscribe/close cycles. 2. **[P2] Include events owned by consumers that left earlier** — [SubscriptionConsumerAgent.java:235–239](https://github.com/apache/iotdb/blob/f3d9020835b0145d013ba0e76967389e40064ea7/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/agent/SubscriptionConsumerAgent.java#L235-L239). If A left with an uncommitted event before B became the last subscriber to leave, the old consumer loop omitted A. With automatic recycling disabled, that event stayed stranded. The last unsubscribe now resets and requeues all uncommitted deliveries for the topic. A two-consumer regression also verifies that an acknowledged event is not replayed. 3. **[P2] Prevent stale polls from reclaiming retained deliveries** — [SubscriptionConsumerAgent.java:213–214](https://github.com/apache/iotdb/blob/f3d9020835b0145d013ba0e76967389e40064ea7/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/agent/SubscriptionConsumerAgent.java#L213-L214). Requeueing before publishing the unsubscribe metadata let an already-admitted poll take a released event and strand it again. The metadata is now published first, and the broker rechecks the current subscription before delivering an initial retain=true event. A deterministic interleaving test covers unsubscribe and consumer close; retain=false keeps its existing behavior. 4. **[P2] Persist the topic snapshot even without retained groups** — [DropTopicProcedure.java:94–97](https://github.com/apache/iotdb/blob/f3d9020835b0145d013ba0e76967389e40064ea7/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/impl/subscription/topic/DropTopicProcedure.java#L94-L97). After validation, an empty retained-group/pipe list selected the old serialization format and omitted existedTopicMeta. Recovery followed by a DataNode failure then lacked the snapshot required to restore the topic during rollback. A non-null snapshot now selects the new format. The regression round-trips the procedure and verifies ConfigNode rollback for retain=false and retain=true topics without retained groups. Validation on the fix: - **PASS:** 89 focused unit tests, with 0 failures, errors, or skipped tests, including the new regressions. - **PASS:** clean 29-module ConfigNode/DataNode dependency reactor in EN through `test`, and in ZH through `test-compile` with tests skipped. All required IoTDB modules were rebuilt from source with build-output caching disabled. These runs used the local fallback after remote Maven-extension resolution prevented the remote tests from starting. - **PASS:** `mvn spotless:apply -P with-integration-tests` for the affected modules, and `git diff --check`. - **UNVERIFIED:** the repository-wide/distribution build remains limited by the previously reported dependency restrictions. The feature IT was not rerun on this commit; its prior attempt failed with **1912 (subscription disabled)** and did not validate the feature. Live-node restart recovery was not exercised; recovery coverage here is from serialization/rollback unit tests. - **CI:** checks on the pushed fix have not been evaluated. The pre-fix SonarCloud quality gate was failing; this review does not claim that gate passed. -- 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]
