Skip to content

Add hardlink preserve support for Download and S2S sync operation#3412

Open
dphulkar-msft wants to merge 90 commits intodphulkar/NFSOverRESTSupportfrom
dphulkar/hardlinkSyncDwldAndS2S
Open

Add hardlink preserve support for Download and S2S sync operation#3412
dphulkar-msft wants to merge 90 commits intodphulkar/NFSOverRESTSupportfrom
dphulkar/hardlinkSyncDwldAndS2S

Conversation

@dphulkar-msft
Copy link
Copy Markdown
Member

Description

  • Feature / Bug Fix: (Brief description of the feature or issue being addressed)

  • Related Links:

  • Issues

  • Team thread

  • Documents

  • [Email Subject]

Type of Change

  • Bug fix
  • New feature
  • Documentation update required
  • Code quality improvement
  • Other (describe):

How Has This Been Tested?

Thank you for your contribution to AzCopy!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dphulkar-msft dphulkar-msft changed the base branch from dphulkar/hardlinkSync to dphulkar/NFSOverRESTSupport March 26, 2026 18:49
@dphulkar-msft dphulkar-msft marked this pull request as ready for review March 27, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants