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

   ## Description
   
   ### Problem
   
   Persisting a newly submitted procedure can serialize and deserialize it 
through the consensus layer. If deserialization marks the procedure as `FAILED` 
before it is added to the executor, the root rollback stack is empty. The 
worker then skips execution because the procedure is not `RUNNABLE`, but the 
procedure remains in the active map. `waitingProcedureFinished()` eventually 
reports `OVERLAP_WITH_EXISTING_TASK`, causing the DataNode to retry 
indefinitely and leaving the CLI request blocked.
   
   ### Fix
   
   Initialize the root rollback stack with a newly submitted procedure when it 
is already failed. This lets the executor follow its normal rollback and 
cleanup path, transition the procedure to `ROLLEDBACK`, remove it from the 
active map, and expose the original failure to the caller.
   
   ### Tests
   
   Added a unit test that simulates the first procedure-store update marking 
the procedure as failed and verifies that:
   
   - `execute()` is not invoked.
   - `rollback()` is invoked exactly once.
   - the procedure reaches `ROLLEDBACK`.
   - the executor removes the procedure from its active map.
   
   Validation:
   
   - `mvn spotless:apply -pl iotdb-core/confignode`
   - `mvn test -pl iotdb-core/confignode -Dtest=TestProcedureExecutor 
-DfailIfNoTests=false`
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining the why and intent of the code.
   - [x] added or updated unit tests to cover the new code path.
   
   <hr>
   
   ##### Key changed/added classes
   
   - `ProcedureExecutor`
   - `TestProcedureExecutor`


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