-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The automatic parent selection of cmd_backup is not smart enough. #856
Comments
You can set your own hostname for each and every backup, if that helps. |
Good idea for improving parent snapshot detection! Unfortunately I think you've got a tiny bit wrong:
Suppose I have a backup of
Is there a bug that I'm not aware of? |
Aww, shoot. I completely missed that. <ponders> ...but there was something wrong with the code when I went over it yesterday... Ah. its
PS. Why does that function not take a Snapshot receiver, like |
Oh, interesting. And we can certainly make |
Currently the code sets the current hostname as default. This is then used in FindLatestSnapshot to discover the latest snapshot for that host.
However, what if I make 2 snapshots for a host, because I have different retention policies for them? E.g. each night the host makes backups of /etc and of /home. The next night backup runs for /etc again and picks the /home backup as parent, as it is the most recent one. Consequently the /home backup picks the just made /etc as parent...
So none of this would be especially worrisome as
restic
would still dedup files at file and blob level, but as you (@fd0) explained so eloquently in in #652, picking the wrong parentID will result in lots of compute cycles as it cannot determine if the file has changed upfront.So, I think the way forward would be to create a
FindOptimalParentSnapshot(repo, tags, paths, host)
function, which uses host as a hard constraint, but the tag and paths ones as soft constraints. Bonus points if it would notice supersets. If I created a backup of /etc,/home and later on do a backup of just /home, it could pick the /etc,/home backup as it's parent. (unless there is a more recent single /home of course). Then of course making a new backup of /etc,/home becomes hairy. what do we pick, the most recent one of /home or the most recent one of /etc,/home ? My bet is on the later as they will have the most overlap.The text was updated successfully, but these errors were encountered: