Caideyipi opened a new pull request, #18916:
URL: https://github.com/apache/iotdb/pull/18916

   ## Description
   
   After a full DataNode restart, subscription metadata can be restored before 
IoTConsensus has any local DataRegions. The initial subscription setup 
therefore finds no regions. Recovering existing peers did not invoke the 
callback used to bind subscription queues, leaving the consumer group without a 
consensus broker even when its consumers reconnected.
   
   Notify the existing peer-availability callback after each recovered peer 
starts. Keep the pre-start recovery callback ahead of `start()` so WAL 
retention guards are installed first. Share the existing exception handling 
with peer creation so a failed notification does not prevent other peers from 
recovering.
   
   The existing subscription binding and progress recovery logic is reused. 
This change does not alter WAL durability or the commit-progress protocol.
   
   ## Regression coverage
   
   - Two consensus tests exercise real peer persistence and recovery: recovery 
notifications run after the state machine starts, and one failed notification 
does not interrupt recovery of other regions. Both tests failed before the fix 
and pass afterward.
   - A table subscription IT force-stops all ConfigNodes and DataNodes, 
recreates two consumers with the same IDs and group, and checks that 64 pending 
rows arrive before any new writes. It then verifies delivery of 16 new rows. 
SYNC WAL and flushed writes isolate subscription recovery; row-key sets allow 
redelivery around the forced shutdown.
   
   ## Validation
   
   - `mvn test -pl iotdb-core/consensus -am -Dtest=IoTConsensusRecoveryTest 
-Dsurefire.failIfNoSpecifiedTests=false`: 2 tests passed, no 
failures/errors/skips.
   - `mvn test-compile -DskipTests -P with-integration-tests`: full 54-module 
reactor passed.
   - `mvn test-compile -DskipTests -Dcheckstyle.skip=true -P 
with-integration-tests,with-zh-locale`: full 54-module Chinese reactor passed; 
Checkstyle was already covered by the English reactor.
   - `IoTDBConsensusSubscriptionRecoveryTableIT`: passed in 29 seconds in an 
isolated local 1C1D subscription-enabled runtime assembled from current reactor 
classes. The standard community runtime disables subscriptions and excludes 
subscription ITs from normal execution.
   - Spotless applied to both changed modules; `git diff --check` passed.
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] added comments explaining the recovery ordering.
   - [x] added unit and integration regression tests.
   - [x] been tested in a local IoTDB cluster.
   


-- 
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]

Reply via email to