Skip to content

Repairing

Luke Champine requested to merge renter into master

plus some other minor tweaks.

the repair function is tested and seems to do the job, but threadedRepairFiles hasn't been tested yet since it's still trying to create real hostUploaders. Some more mocking work will be necessary in order to facilitate testing. Also, repair is far too similar to upload for my liking. If I gave it some more thought I could probably reduce the overlap quite a bit.

The renter now stores a list of files that it is repairing, in the form of a map from nicknames -> paths on disk. Currently, files are repaired IFF they are uploaded by the user, and you can't disable repairing. The repair loop runs infinitely without any sort of time.Sleep delay, and it doesn't remove files even after they reach 100% redundancy (this is because we may add uptime checking later, so that if a host goes offline, those pieces will be repaired). These should probably be changed; just wanted to get some feedback first.

The renter API is going to overhauled soon to make it more RESTful. We'll also want to add an API call to toggle repairing on a file. Note that this call would require a path on disk to the original file (and we have to be careful there, because if the file doesn't actually contain the original data, you'll wind up corrupting the file pretty severely).

Merge request reports