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

   ## Description
   
   ### Restore cleanup after a migration child fails
   
   After #18909, the executor skips rollback for procedures whose 
`isRollbackSupported()` returns false. `RemoveDataNodesProcedure` always 
returned false even though its `STOP_DATA_NODE` rollback performs necessary 
node cleanup. If a migration child exhausts its metadata-removal retries, the 
root procedure finishes without restoring the original statuses of nodes that 
still host Regions or unregistering and stopping drained nodes. Removal targets 
can therefore remain in `Removing`.
   
   Allow rollback at `STOP_DATA_NODE` so the existing cleanup runs while 
preserving the child failure and completed Region migrations. Keep execution 
retries independent of rollback eligibility: a transient error during normal 
cleanup must still retry instead of immediately failing the procedure.
   
   ### Tests
   
   - Modified UT: strengthen 
`RemoveDataNodePersistenceTest.testProcedureExecutorCanActuallyRetryCompensationCommitFailure`
 to assert that a transient cleanup failure and its successful retry leave no 
procedure failure.
   - Existing regression: 
`RemoveDataNodesProcedureTest.metadataRetryExhaustionRetriesFailedNodeStatusCleanup`
 now passes, including node-status restoration, stopping drained nodes, and 
delayed retry after an injected cleanup failure.
   - Passed all 31 UT cases in `RemoveDataNodesProcedureTest` (3), 
`RemoveDataNodePersistenceTest` (23), and `StateMachineProcedureTest` (5), with 
no failures, errors, or skipped tests. Spotless passed.
   - No ITs added, modified, or run for this change. The failure and 
cleanup-retry paths are covered by the existing ProcedureExecutor-based UT.
   
   ### Side effects and risks
   
   A failed removal can now remain active while its existing rollback cleanup 
retries. Completed Region migrations are retained, and the original child 
failure remains reported. Rollback eligibility changes only at 
`STOP_DATA_NODE`; normal execution retains its existing retry threshold. No 
procedure-state IDs or serialization formats change.
   
   <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] added unit tests or modified existing tests to cover new code paths.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   - `RemoveDataNodesProcedure`: allow failure cleanup at `STOP_DATA_NODE` and 
preserve normal execution retries.
   - `RemoveDataNodePersistenceTest`: verify transient cleanup failures remain 
retryable without leaving a procedure failure.
   


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