Repository navigation
Fix snapshot recovery when hard links are unsupported - #19236
Merged
jt2594838 merged 2 commits intoNov 13, 2026
Merged
Conversation
Caideyipi
approved these changes
Nov 12, 2026
Caideyipi
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the current head. The unsupported hard-link case now uses the shared copy fallback, and the regression test checks restored contents after deleting the source. No code issues found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Snapshot recovery without
snapshot.logmaintains a separate hard-link/copy branch. If the filesystem throwsUnsupportedOperationException, recovery fails instead of copying the file. Its copy path also bypasses the force/error handling already used by logged snapshots.Use the existing
SnapshotFileUtils.createLinkOrCopyfor this path, keeping directory selection and file-target registration unchanged. Add a regression that rejects hard links, restores the bytes by copying, deletes the source, and verifies the restored contents and target mapping. Add the JDK 17 test JVM opens required by the existing PowerMock fault injection. Explicitly declare the already-transitivepowermock-api-supporttest dependency used by method replacement so dependency analysis passes.Validation:
mvn verify -o -pl iotdb-core/datanode -am -DskipTests -Ddevelocity.off=true: passed, includingdependency:analyze-onlywith no dependency problems.mvn spotless:apply -o -pl iotdb-core/datanode -Ddevelocity.off=true: passed.mvn test -o -pl iotdb-core/datanode -am '-Dtest=SnapshotFileUtilsTest,SnapshotLinkFallbackTest,IoTDBSnapshotTest' -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false -Ddevelocity.off=true: 15 passed, 1 pre-existing ignored test.This PR has:
Key changed classes:
SnapshotLoader,SnapshotLinkFallbackTest.