Add hardlink preserve support for Download and S2S sync operation#3412
Open
dphulkar-msft wants to merge 90 commits intodphulkar/NFSOverRESTSupportfrom
Open
Add hardlink preserve support for Download and S2S sync operation#3412dphulkar-msft wants to merge 90 commits intodphulkar/NFSOverRESTSupportfrom
dphulkar-msft wants to merge 90 commits intodphulkar/NFSOverRESTSupportfrom
Conversation
…Azure/azure-storage-azcopy into dphulkar/hardlinkDesignPOC
…e/azure-storage-azcopy into dphulkar/hardlinkDesignPOC
…e/azure-storage-azcopy into dphulkar/hardlinkDesignPOC
…/azure-storage-azcopy into dphulkar/hardlinkNFSToLocal
…e/azure-storage-azcopy into dphulkar/hardlinkNFSToLocal
…e-storage-azcopy into dphulkar/hardlinkSync
…e-storage-azcopy into dphulkar/hardlinkSyncDwldAndS2S
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends AzCopy’s hardlink preserve behavior to cover Download and S2S sync flows by teaching the source-side sync comparator to defer and then reconcile hardlink objects, and by tightening inode population for Azure Files/NFS traversals to avoid false hardlink grouping.
Changes:
- Populate NFS inode IDs only for true hardlinks (link count > 1) during Azure Files traversal.
- Add deferred hardlink reconciliation to the sync source comparator (used for Download and S2S sync) and ensure it runs during sync finalization.
- Update/expand NFS hardlink sync E2E scenarios and adjust sync comparator constructor call sites/tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| traverser/zc_traverser_file.go | Avoids setting inode on non-hardlinked NFS files to prevent incorrect grouping during sync comparisons. |
| azcopy/syncEnumerator.go | Wires up the updated sync source comparator and calls hardlink post-processing during finalize. |
| azcopy/syncComparator.go | Implements deferred processing for source hardlinks and adds group-structure/anchor logic for Download/S2S sync. |
| azcopy/syncProcessor.go | Ensures mirror-mode deletions treat hardlinks like deletable “files” on local targets. |
| cmd/zt_sync_file_file_test.go | Updates unit tests for the new sync comparator constructor signature. |
| e2etest/zt_newe2e_nfs_scenarios_test.go | Adjusts NFS scenario auth variations (OAuth commented out) and related scenario coverage. |
| e2etest/zt_newe2e_nfs_hardlink_sync_test.go | Adds fromTo-variant support and helpers for hardlink sync E2Es; OAuth commented out in variations. |
Comments suppressed due to low confidence (1)
e2etest/zt_newe2e_nfs_scenarios_test.go:1597
- This scenario still includes OAuth as a destination credential type (line 1596) while OAuth is commented out elsewhere. If OAuth is intentionally disabled for NFS scenarios, remove it consistently here too; otherwise re-enable OAuth in the other variation lists so auth coverage is consistent across src/dst.
src.(RemoteResourceManager).WithSpecificAuthType(
ResolveVariation(svm, []ExplicitCredentialTypes{
EExplicitCredentialType.SASToken(),
//EExplicitCredentialType.OAuth(),
}), svm, CreateAzCopyTargetOptions{}),
dst.(RemoteResourceManager).WithSpecificAuthType(
ResolveVariation(svm, []ExplicitCredentialTypes{
EExplicitCredentialType.SASToken(),
EExplicitCredentialType.OAuth(),
}), svm, CreateAzCopyTargetOptions{}),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…Azure/azure-storage-azcopy into dphulkar/hardlinkSyncDwldAndS2S
…e-storage-azcopy into dphulkar/hardlinkSyncDwldAndS2S
…e/azure-storage-azcopy into dphulkar/hardlinkSyncDwldAndS2S
…e/azure-storage-azcopy into dphulkar/hardlinkSync
…e-storage-azcopy into dphulkar/hardlinkSyncDwldAndS2S
…e-storage-azcopy into dphulkar/hardlinkSyncDwldAndS2S
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
Feature / Bug Fix: (Brief description of the feature or issue being addressed)
Related Links:
Issues
Team thread
Documents
[Email Subject]
Type of Change
How Has This Been Tested?
Thank you for your contribution to AzCopy!