Skip to content

Hackport "backup: read extended metadata from snapshot"#5099

Merged
MichaelEischer merged 7 commits intorestic:patch-releasefrom
MichaelEischer:hackport-fix-vss-metadata
Oct 22, 2024
Merged

Hackport "backup: read extended metadata from snapshot"#5099
MichaelEischer merged 7 commits intorestic:patch-releasefrom
MichaelEischer:hackport-fix-vss-metadata

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer commented Oct 18, 2024

What does this PR change? What problem does it solve?

Backport #5097 to the patch-release branch. The main different to that PR is that the commit "fs/vss: properly create node from vss path" is reimplemented using a horrible hack. This is necessary as a clean solution requires the FS interface refactoring from #5021.

internal/fs cannot import internal/restic as the latter already imports the former. Thus NodeFromFileInfo cannot be easily moved to internal/fs as in #5097. The call to MapFilename could in principle also be integrated into NodeFromFileInfo, however, this requires more test fixes.

The majority of the remaining commits are just cherry-picked from #5097.

P.S. The "hackport" typo is intentional.

Was the change previously discussed in an issue or on the forum?

Related to #5063

Checklist

  • I have read the contribution guidelines.
  • I have enabled maintainer edits.
  • I have added tests for all code changes.
  • [ ] I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I have run gofmt on the code in all commits.
  • All commit messages are formatted in the same style as the other commits in the repo.
  • I'm done! This pull request is ready for review.

Previously, NodeFromFileInfo used the original file path to create the
node, which also meant that extended metadata was read from there
instead of within the vss snapshot.

This change is a temporary solution for restic 0.17.2 and will be
replaced with a clean fix in restic 0.18.0.
When using the VSS FS, then `f.Name()` contained the filename in the
snapshot. This caused a double mapping when calling NodeFromFileInfo.
The only user was archiver.fileSaver.
@MichaelEischer MichaelEischer force-pushed the hackport-fix-vss-metadata branch from d79fd11 to ee9a5cd Compare October 18, 2024 20:52
Copy link
Copy Markdown
Member Author

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

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

LGTM.

@MichaelEischer MichaelEischer merged commit f72febb into restic:patch-release Oct 22, 2024
@MichaelEischer MichaelEischer deleted the hackport-fix-vss-metadata branch October 22, 2024 17:24
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.

1 participant