mirror of
https://github.com/restic/restic.git
synced 2026-08-11 08:03:17 +00:00
The treeCache in SnapshotsDir was never cleared when snapshots were reloaded. This caused the "latest" symlink to keep pointing to the previous snapshot even after new snapshots were added. Add a generation counter to SnapshotsDirStructure that is incremented whenever the directory structure is rebuilt (in makeDirs). The treeCache checks this generation on each lookup and resets itself when the generation changes, ensuring cached nodes (including symlinks) are refreshed after a snapshot reload.
11 lines
479 B
Plaintext
11 lines
479 B
Plaintext
Bugfix: Update `mount` latest symlink after snapshot reload
|
|
|
|
When `restic mount` was kept running while new snapshots were
|
|
created, the new snapshots appeared in the mountpoint, but the `latest`
|
|
symlink could still point to the previously latest snapshot. Restic now
|
|
invalidates the cached snapshot directory entries after a snapshot reload so
|
|
that `latest` points to the newest snapshot.
|
|
|
|
https://github.com/restic/restic/issues/5722
|
|
https://github.com/restic/restic/pull/21873
|