JackieTien97 opened a new pull request, #18679:
URL: https://github.com/apache/iotdb/pull/18679
## Description
A cancelled or timed-out fragment can keep loading overlapping file metadata
inside a single operator call. Its Driver retains its execution lock, so the
fragment cleanup callback waits for Driver destruction and delays other
callbacks sharing the notification executor.
Check the fragment's terminal state at file-scan entry and immediately
before and after loading each sequential or unsequential file's metadata. The
scan exits on the Driver thread and preserves the original failure cause. The
check is shared by non-aligned and aligned scans, skips compaction contexts
without a state machine, and uses matching English/Chinese message constants.
This provides cooperative cancellation between metadata reads. An in-flight
I/O operation or monitor acquisition must still return before cancellation is
observed; the reader locking and notification executor lifecycle are unchanged.
## Validation
- Clean DataNode reactor build and **59 targeted tests passed**, including
24 new parameterized cases for non-aligned, aligned tree, and aligned table
scans. Coverage includes terminal states, ascending/descending seq/unseq scans,
cancellation during the final or missing metadata read, cached metadata, active
and compaction contexts, and concurrent Driver close followed by the memory
cleanup callbacks.
- Full reactor English and Chinese test compilation passed (50 modules
each); the compiled Chinese message and its use in the scanner bytecode were
also verified.
- Checkstyle, Spotless, diff whitespace checks, and
message-key/hash/placeholder parity checks passed.
```sh
mvn clean test -pl iotdb-core/datanode -am \
-Dtest=SeriesScanUtilCancellationTest,DataDriverTest,FragmentInstanceExecutionTest,SeriesScanLimitOffsetPushDownTest,AlignedSeriesScanLimitOffsetPushDownTest,SeriesScanPredicatePushDownTest,AlignedSeriesScanPredicatePushDownTest
\
-Dsurefire.failIfNoSpecifiedTests=false
mvn test-compile -DskipTests
mvn test-compile -DskipTests -P with-zh-locale
```
- [x] Self-reviewed, including concurrent scan and close behavior.
- [x] Added regression tests and comments explaining the cancellation
boundary.
- [x] Included the Apache license header in the new test file.
--
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]