Snapshot Management
We need to be able to manage snapshots properly :
- rebase
- deletion
- transfert
- export
Rebase :
-----------
This functionality is meant to change the base of a snapshot. Let's take an example :
We have "snp3" snapshot that has been created after "snp2", so snp2 is the base of snp3. That means snp3 has been created based on the changes that have occurred since snp2 has been created. And snp2 is based on snp1. Now suppose for one reason we want to delete snp2. We need to "rebase" snp3 on snp1 so that snp3 include every changes from snp1 to snp2.
snp1 -> snp2 -> snp3 ==>> snp1 -> snp3
Delete
---------
To delete a snapshot , we need to rebase the children on the parent before deleting.
Export
----------
To export a snapshot, we can export it as is, or convert it to a full snapshot before exporting.
Blueprint information
- Status:
- Complete
- Approver:
- Oumar Aziz OUATTARA
- Priority:
- Medium
- Drafter:
- Oumar Aziz OUATTARA
- Direction:
- Needs approval
- Assignee:
- sbackup Maintainers
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- 0.2
- Started by
- Oumar Aziz OUATTARA
- Completed by
- Oumar Aziz OUATTARA
Whiteboard
First to be implemented is the Rebase functionality
Rebase principle:
snp1 -> snp2 -> snp3
rebase snp3 on snp1 :
(snp3 has the newer version of the file it contains)
remove snp3 "ver" file ( means the snapshot is being processed )
for each file in snp2 :
if included in snp3 -> pass
if not : push the file in snp3
when finished, checks and merge the includes.list and excludes.list
change the base file content to the new base
write the "ver" file
If an error is encountered -> cancel Rebase ( we shouldn't loose the snapshot !)
To be able to handle well the cancellation of a rebase, we will need to not modify the snapshot till the last moment.
This means, the infos we want to add in the SNAP file should be created as a temporary SNAR file
Same goes for the TAR file. So that to cancel, we will just have to remove those temporary files and restore the 'ver' file.
Work Items
Dependency tree
* Blueprints in grey have been implemented.