d-wang-commit opened a new pull request, #18965:
URL: https://github.com/apache/iotdb/pull/18965

   ## Description
   
   ### Control snapshot creation after registration
   
   The snapshot recovery cases in `IoTDBNodeStatusPersistenceIT` set the 
automatic snapshot threshold to `1` before ConfigNode registration. This lets 
snapshot installation overlap Raft membership changes. In the failing run, 
concurrent Raft configuration writes failed while renaming 
`raft-meta.conf.tmp`, closing a follower's Ratis division while its JVM 
remained alive. Stopping another ConfigNode then removed the quorum, so the 
shutdown report returned status `301` before recovery was exercised.
   
   Use a high automatic snapshot threshold during setup and explicitly request 
snapshots on each surviving ConfigNode after the expected statuses have been 
persisted. Requests target the actual peer IDs and consensus endpoints, use a 
five-second RPC timeout without internal retries, and run within a bounded 
wait. Repeat snapshot creation when a follower has not yet applied the status 
update. Keep the completed snapshot content checks and restart recovery 
assertions, and include the complete shutdown RPC status in assertion failures.
   
   ### Tests
   
   - UT: none added or modified; this change is confined to integration test 
setup and control.
   - IT: updated `testStoppedNodesSurviveSnapshotRecovery` and 
`testReadOnlyReasonSurvivesSnapshotRecovery`, retaining coverage of persisted 
Stopped status and ReadOnly reasons after snapshot recovery.
   - Local validation: all five methods in `IoTDBNodeStatusPersistenceIT` 
passed, with zero failures, errors, or skipped tests, on Windows with JDK 17, 
one test fork, and 1024 MB heaps per node.
   - `mvn spotless:apply -pl integration-test -Pwith-integration-tests` passed.
   
   ### Side effects and risks
   
   The change is limited to the IT class and uses the existing Ratis snapshot 
management API. Explicit snapshot requests add bounded setup work on each live 
peer. Snapshot contents are checked before restarting the quorum to preserve 
recovery coverage. The underlying Ratis configuration persistence race remains 
outside this test-only change; production consensus behavior and persistence 
formats are unchanged.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [x] updated integration tests.
   - [x] been tested in a test IoTDB cluster.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   - `IoTDBNodeStatusPersistenceIT`: create recovery snapshots explicitly after 
registration, retain snapshot content verification, and improve shutdown report 
diagnostics.
   


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