Skip to content

Add sync hardlink preserve support for local->NFS#3383

Open
dphulkar-msft wants to merge 77 commits intodphulkar/NFSOverRESTSupportfrom
dphulkar/hardlinkSync
Open

Add sync hardlink preserve support for local->NFS#3383
dphulkar-msft wants to merge 77 commits intodphulkar/NFSOverRESTSupportfrom
dphulkar/hardlinkSync

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!

dphulkar-msft and others added 5 commits March 16, 2026 11:28
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>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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

Adds hardlink preservation support for sync/copy Local → Azure Files NFS, introducing inode-based hardlink grouping so sync can detect/maintain hardlink relationships (including group merges/splits and anchor changes).

Changes:

  • Introduces an on-disk, per-job InodeStore and plumbs it through traversers and sync/copy execution paths.
  • Extends StoredObject with Inode and refactors NFS hardlink metadata handling via NFSMetadataContext.
  • Updates sync comparator to defer destination hardlink processing and reconcile hardlink group structure; adds substantial unit/e2e coverage.

Reviewed changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
traverser/zc_traverser_s3.go Updates NewStoredObject call signature for NFS metadata context.
traverser/zc_traverser_local.go Adds inode store plumbing and emits inode/hardlink context during local enumeration.
traverser/zc_traverser_gcp.go Updates NewStoredObject call signature for NFS metadata context.
traverser/zc_traverser_file.go Adds inode store usage for Azure Files hardlink grouping and passes inode context into StoredObject.
traverser/zc_traverser_blob_versions.go Updates NewStoredObject call signature for NFS metadata context.
traverser/zc_traverser_blob.go Updates NewStoredObject call signature for NFS metadata context across blob enumeration paths.
traverser/zc_traverser_benchmark.go Updates benchmark traverser to new NewStoredObject signature.
traverser/zc_enumerator.go Adds Inode to StoredObject, introduces NFSMetadataContext, updates NewStoredObject signature, extends traverser init options with InodeStore.
ste/xfer-remoteToLocal-hardlink.go Adjusts hardlink download flow for updated downloader interface and prologue usage.
ste/xfer-anyToRemote-hardlink_test.go Adds unit tests for upload hardlink target path computation.
ste/xfer-anyToRemote-hardlink.go Computes upload hardlink target path based on source-root-relative suffix and uses it for CreateHardlink.
ste/testJobPartTransferManager_test.go Extends test JPTM to satisfy new GetSourceRoot() interface method.
ste/mgr-JobPartTransferMgr.go Adds GetSourceRoot() to JPTM interface and implementation (sourced from plan).
ste/mgr-JobMgr.go Ensures queued hardlink-only parts can be dispatched even when no mixed parts complete.
ste/downloader.go Updates hardlink downloader interface signature.
ste/downloader-blobFS.go Removes stale/incorrect hardlink stub method.
ste/downloader-azureFiles_linux_test.go Adds unit tests for download hardlink target path computation on Linux.
ste/downloader-azureFiles_linux.go Implements local hardlink creation using computed anchor target path; adds computeDownloadHardlinkTarget.
e2etest/zt_newe2e_nfs_scenarios_test.go Improves NFS cleanup behavior and adjusts scenario logic for sync/hardlink preserve.
e2etest/zt_newe2e_nfs_hardlink_sync_test.go Adds extensive e2e coverage for hardlink-preserve sync/copy scenarios.
e2etest/newe2e_task_validation.go Adjusts validation to avoid content validation for preserved hardlinks.
common/inodeStore_test.go Adds comprehensive unit test suite for new inode store behavior (rehydration, concurrency, edge cases).
common/inodeStore.go Replaces singleton inode store with per-job on-disk indexed store supporting anchor tracking and resume rehydration.
cmd/zt_sync_file_file_test.go Updates sync comparator construction for new comparator signature.
cmd/zt_generic_processor_test.go Updates NewStoredObject call to new NFS options signature.
cmd/removeEnumerator.go Updates remove enumerator to new NewStoredObject signature.
azcopy/syncProcessor.go Treats hardlinks similarly to files in deletion logging behavior.
azcopy/syncOptions.go Removes prior validation blocking --hardlinks=preserve for sync.
azcopy/syncEnumerator.go Plumbs inode store into traversers; adds pending-hardlink post-processing in sync finalize.
azcopy/syncComparator.go Adds hardlink-aware sync comparison, including deferred processing and group structure reconciliation.
azcopy/sync.go Creates per-job inode store for sync execution and passes it through syncer.
azcopy/output.go Adds “Hardlinks Transferred” to sync job summary output.
azcopy/copyEnumerator.go Plumbs inode store into copy enumerator traverser initialization.
azcopy/copy.go Creates per-job inode store for copy execution and passes it through transfer executor.
Comments suppressed due to low confidence (1)

traverser/zc_enumerator.go:416

  • InitResourceTraverserOptions.PerformChecks currently doesn’t enforce the documented invariant that InodeStore must be non-nil when HardlinkHandling == Preserve. Several traversers now return runtime errors when inodeStore is nil; it would be safer to fail fast here with a clear validation error.
func (o *InitResourceTraverserOptions) PerformChecks() error {
	if o.IncrementEnumeration == nil {
		o.IncrementEnumeration = enumerationCounterFuncNoop
	}

	return nil

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

dphulkar-msft and others added 4 commits March 16, 2026 13:34
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>
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>
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 16, 2026

@dphulkar-msft I've opened a new pull request, #3411, to work on those changes. Once the pull request is ready, I'll request review from you.

dphulkar-msft and others added 6 commits March 16, 2026 13:43
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>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nfs-support Adding support for NFS in azcopy pr-ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants