hongzhi-gao opened a new pull request, #19192: URL: https://github.com/apache/iotdb/pull/19192
## Description Taking a snapshot captures the TsFile resource lists before closing working files. If an unflushed row has been deleted, closing its empty file marks the resource DELETED and removes the file, but the snapshot's copied list still retains it. Snapshot creation then attempts to capture files that no longer exist. Separately, a missing hard-link source is silently ignored, and deserializing a missing resource file can throw a NullPointerException instead of the declared IOException. - Remove DELETED resources from the captured lists and release their snapshot read locks. Continue to capture all live resources; missing files for a live resource fail the snapshot. - Propagate a missing hard-link source as FileNotFoundException so an incomplete snapshot cannot be marked complete. - Report a null resource input stream as FileNotFoundException, and update the existing English/Chinese log message to remove the claim that missing files are ignored. No snapshot format or RPC changes. ## Validation Executed against base `c6e229aef50608cb67bfb4fd94717d05f4ef3d0f`: - Targeted DataNode reactor tests: `IoTDBSnapshotTest`, `TsFileResourceTest`, and `DataRegionTest#testSnapshotAfterDeletingUnflushedData`: 20 passed, 1 existing manual multi-disk test skipped. - `IoTDBRemoveDataNodeAfterDeleteIT` with `ClusterIT` and `with-integration-tests`: 2 passed on 1 ConfigNode + 3 DataNodes with replication factor 1. Both the empty-data and retained-data cases verify node removal, process exit, and query results after migration. - Before the fix, the new missing-resource deserialization test fails with NPE, and the missing-resource snapshot rejection test fails because snapshot creation reports success. - Spotless, Checkstyle, and focused DataNode reactor test compilation with `with-zh-locale` passed. Local validation limitations: an existing undefined `walFlushListeners` reference in `WALNodeTest.java:366` blocks test compilation on the base revision. That class was temporarily excluded from test compilation for the focused checks; the exclusion was restored and is not part of this PR. Whole-root Chinese test compilation stopped at distribution because required ZIP artifacts were unavailable in the offline cache; the affected DataNode reactor compiled successfully. ## Review - [x] Self-reviewed resource-list ownership, read-lock release, and snapshot failure handling. - [x] Added unit/component regression coverage. - [x] Added and executed cluster integration tests. Key classes: `SnapshotTaker`, `TsFileResource`, `IoTDBRemoveDataNodeAfterDeleteIT`. -- 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]
