hongzhi-gao opened a new pull request, #19049: URL: https://github.com/apache/iotdb/pull/19049
## Description DataRegion snapshot creation currently fails when the filesystem rejects hard links, preventing IoTConsensus from adding a peer. Fall back to copying TsFiles and resource files when linking fails. Apply the same fallback to snapshot recovery with a snapshot log; the recovery path without a log already supports copying. The shared helper forces copied files to storage before reporting success. It never replaces an existing destination and preserves the original link failure as a suppressed exception if copying or syncing fails. Existing file locks and snapshot completion/cleanup rules remain in place. Hard-link success has no additional I/O; fallback requires extra space, file I/O, and time holding the existing snapshot locks. Snapshot failure logs now include database and region context. The IoTConsensus failure includes the consensus group and snapshot directory and points to state-machine logs for the underlying error. The boolean state-machine API remains unchanged, so the upper exception does not carry the underlying errno; the lower log retains the full exception and any suppressed link failure. English and Chinese messages are included. ## Validation - `mvn spotless:apply -o -pl iotdb-core/datanode,iotdb-core/consensus -Ddevelocity.off=true`: passed. - `mvn test -o -pl iotdb-core/datanode -am -Dtest=SnapshotFileUtilsTest,IoTDBSnapshotTest -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -Ddevelocity.off=true`: passed; 14 tests, zero failures/errors, one pre-existing ignored test requiring manually configured disks. This was rerun after adding file syncing. - Manual Linux cross-filesystem check of the shared helper: `/tmp` to `/dev/shm` rejects `Files.createLink` with `Invalid cross-device link`; fallback copies 1 MiB, and all bytes remain identical after deleting the source. - Added English/Chinese message key and placeholder parity: passed. - `mvn test-compile -o -DskipTests -Ddevelocity.off=true` and `mvn test-compile -o -DskipTests -Pwith-zh-locale -Ddevelocity.off=true`: both compile Consensus and DataNode successfully, then fail in unchanged ConfigNode code. `AlterTopicProcedure` (lines 282/356) and `DropTopicProcedure` (lines 220/287) assign `pushSingleConsumerGroupOnDataNode()`'s `Map<Integer, TPushConsumerGroupMetaResp>` return value to `List<TSStatus>`. These files and the method declaration are unchanged from the base `e616dc50c1`. - `git diff --cached --check`: passed. No new cluster migration or crash-injection test was run. The change preserves existing file formats, wire contracts, and snapshot publication ordering. - [x] Self-reviewed, including source-file locking, partial-copy failures, retry cleanup, and snapshot durability. - [x] Independently reviewed; added force(true) before snapshot completion in response to the durability finding. - [x] Added tests for hard-link success, unsupported links, failure causes, and existing destination protection. -- 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]
