[#1] Add frostfs backend #1
No reviewers
Labels
No labels
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/restic#1
Loading…
Reference in a new issue
No description provided.
Delete branch "KurlesHS/restic:feature/add-frostfs-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Aleksey Kravchenko al.kravchenko@yadro.com
f9c3130c1b
to0eda218df2
[#XX] Add frostfs backendto [#1] Add frostfs backend@ -0,0 +93,4 @@
return nil // nil is valid value
}
func (b *Backend) Test(ctx context.Context, h backend.Handle) (bool, error) {
Maybe we can simplify
Test
function. If I understand correctly,Test
is called to check if connection to the backend is active. Correct me if I am wrong.To perform healthcheck we can call NetmapSnapshot. Searches are quite expensive, so it would be nice to avoid them if we can.
Moreover, in this version of restic, we can simplify it even more by completely removing this method, since its definition has been removed from the
backend.Backend
intreface.But in the original implementation, this method was used to check for the presence of a specific file.
Let's remove all unused methods including
Test
.@ -0,0 +312,4 @@
return strings.Contains(err.Error(), "not found")
}
func (b *Backend) Delete(ctx context.Context) error {
Can you provide some details when this call happens? As far as I see, container ID is provided by restic config. So it feels a bit wrong to delete this container in runtime somehow.
This method is used in two other methods, and these methods are not called anywhere else. I looked into the s3 backend implementation of this method: all archive files are deleted there, but the bucket itself is not deleted. I can do the same in the FrostFS backend.
Can you elaborate what is arhive object that S3 removes in
Delete
method?Maybe we decided to optimize clean-up stage with this code in the past. S3 protocol does not allow to remove bucket until all objects are removed. FrostFS allows to remove container.
If it is not called at all, I guess we can keep current implementation for now.
If I understood the question correctly, the s3 backend, when executing the Delete method, deletes all files generated within the backup from the package, after which there are no files left in it. The bucket itself is not deleted. The implementation of this method is shown below:
The util.DefaultDelete function accepts an interface implementing a particular backend as input and deletes all backup files generated by this backend.
Under the hood, util.DefaultDelete reads the list of files from the "config" file, deletes these files, and then also deletes the aforementioned "config" file
So we can implement our Delete method in the same way as it is done in s3 backend.
Or we can leave the current implementation.
Remove unused
Test
backend function and check if there are any more function that are unused.0eda218df2
to6939e0353f
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.