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

   ## Description
   
   A fragment can become `FINISHED` while its driver is still scanning file 
metadata. The scan's terminal-state check currently throws an `IOException`, 
which the scheduler converts into an internal error and propagates to other 
tasks in the same query. This can mask the original scalar-subquery error (701) 
with a generic driver error (301), causing inconsistent responses across query 
entry nodes.
   
   Use an internal `FragmentInstanceFinishedException` to unwind scans of 
normally finished fragments. `Driver` handles this signal by requesting 
destruction and returning through normal task completion, so resources and 
scheduler bookkeeping are released without cascading a new failure. Other 
exceptions retain their existing failure handling.
   
   Follow-up to #18679. Observed in [Table Cluster IT - 
1C3D](https://github.com/apache/iotdb/actions/runs/35700367614/job/106656674294?pr=18694).
   
   ## Validation
   
   - JDK 17 clean reactor build and 84 targeted unit tests passed, covering 
scanning, driver cleanup, scheduling, cancellation, timeout, and failure 
propagation.
   - Deterministic concurrent tests cover FINISHED before and after the 
asynchronous driver-close request, for sequence/unsequence files and 
aligned/non-aligned scans. They also check resource release, preservation of 
semantic and real I/O failures, and isolation of sibling tasks.
   - Negative control: restoring the original scanner reproduces `already 
FINISHED` in all three scan configurations.
   - `IoTDBUncorrelatedScalarSubqueryIT`: all 6 tests passed in a real 1 
ConfigNode / 3 DataNode cluster, with reads verified across all DataNodes:
   
     ```sh
     mvn clean verify -pl integration-test -am \
       -P with-integration-tests,TableClusterIT -DskipUTs \
       -Dit.test=IoTDBUncorrelatedScalarSubqueryIT \
       -Dfailsafe.failIfNoSpecifiedTests=false \
       -DConfigNodeMaxHeapSize=1024 -DDataNodeMaxHeapSize=1024
     ```
   
   - Checkstyle, Spotless, and `git diff --check` passed.
   
   This PR has:
   
   - [x] been self-reviewed, including concurrent execution and cleanup.
   - [x] added Javadoc and comments explaining the termination signal.
   - [x] added or updated unit tests for the affected paths.
   - [x] been tested in an 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