Skip to content

perf: hard link local recovery archive - #13494

Merged
wanghe-fit2cloud merged 1 commit into
dev-v2from
perf/snapshot-recover-hard-link
Aug 6, 2026
Merged

perf: hard link local recovery archive#13494
wanghe-fit2cloud merged 1 commit into
dev-v2from
perf/snapshot-recover-hard-link

Conversation

@ssongliu

@ssongliu ssongliu commented Aug 6, 2026

Copy link
Copy Markdown
Member

Refs #13490

Copilot AI lite review requested due to automatic review settings August 6, 2026 06:04
@ssongliu ssongliu changed the title perf(snapshot): hard link local recovery archive perf: hard link local recovery archive Aug 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses LOCAL snapshot restore failures for large archives by avoiding a time-limited file copy during the “Download snapshot file” step.

Changes:

  • Add explicit error handling for NewBackupClientWithID so restore doesn’t proceed/log with an invalid backup account.
  • For LOCAL backup accounts, attempt to hard-link the snapshot archive into the recovery workspace before falling back to client.Download.

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

Comment on lines +274 to +280
func prepareSnapshotRecoverFile(accountType, sourcePath, targetPath string, download func() error) error {
if accountType == constant.Local {
if err := os.Link(sourcePath, targetPath); err == nil {
return nil
}
}
return download()
@wanghe-fit2cloud
wanghe-fit2cloud merged commit 4489641 into dev-v2 Aug 6, 2026
4 checks passed
@wanghe-fit2cloud
wanghe-fit2cloud deleted the perf/snapshot-recover-hard-link branch August 6, 2026 08:09
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.

3 participants