start-os icon indicating copy to clipboard operation
start-os copied to clipboard

Add indicator to backup page informing user how much data is being backed up

Open kn0wmad opened this issue 3 years ago • 11 comments

so they know whether it's frozen or just backing up a ton of data

Reported by: @chrisguida

kn0wmad avatar Nov 19 '21 16:11 kn0wmad

Add PackageProcedure to backup api such that a service can estimate how much data to back up. Ideally, allow it to mount read-only to the backup target so it can exclude data that has already been backed up (for incremental backups).

dr-bonez avatar May 13 '22 21:05 dr-bonez

Add PackageProcedure to backup api such that a service can estimate how much data to back up. Ideally, allow it to mount read-only to the backup target so it can exclude data that has already been backed up (for incremental backups).

I find it difficult to believe anyone will use this feature. Perhaps we ought to just inform the user a moving window totaling how much data has been written to the backup drive in the last N minutes. This will make it clear that shit is still going but prevents us or the package developer from having to predict these things at the outset.

ProofOfKeags avatar May 17 '22 20:05 ProofOfKeags

Some kind of display saying "you are about to backup X GB of data" seems eminently useful, and not all that difficult, especially in the case where we don't have to calculate the diff

chrisguida avatar May 19 '22 14:05 chrisguida

No I am not challenging that it is useful to the user, I'm challenging that devs will opt to do the work of computing how much data will need to be backed up in the presence of diffing. Saying "[this is] not all that difficult" misunderstands the problem. If we implement an available package procedure to compute this, my hypothesis is that external devs will opt to implement it correctly.

ProofOfKeags avatar May 19 '22 19:05 ProofOfKeags

Right, i mentioned that calculating the diff would be the more difficult case.

In the base case, it seems to me like this could be implemented at the OS level, just take du of the whole datadir and subtract the size of whatever's in .backupignore.

I suppose where this gets complicated is if the package has some kind of custom backup mechanism that doesn't use compat or duplicity

chrisguida avatar May 19 '22 22:05 chrisguida

That's my point exactly. While it is unlikely that any backup action will expand the volume data during the backup process, it is technically possible to do so. Due to Turing Completeness, this can only be computed by the package itself, the OS CANNOT do it on its own. The heuristic above may serve as an upper bound estimate but that's all it would be.

ProofOfKeags avatar May 20 '22 21:05 ProofOfKeags

For all our current services, this would be easy.

I would definitely implement this for all our current services, I assume it will be pretty much all boilerplate

chrisguida avatar May 21 '22 01:05 chrisguida

How would you go about implementing it? I'm curious.

ProofOfKeags avatar May 23 '22 16:05 ProofOfKeags

In the base case, it seems to me like this could be implemented at the OS level, just take du of the whole datadir and subtract the size of whatever's in .backupignore.

^

chrisguida avatar May 23 '22 18:05 chrisguida

@dr-bonez and I discussed that, in the absence of a package procedure, the OS would naively measure the entire volume and report that as the estimate along with a warning that it might not be accurate.

MattDHill avatar May 24 '22 19:05 MattDHill

No I am not challenging that it is useful to the user, I'm challenging that devs will opt to do the work of computing how much data will need to be backed up in the presence of diffing. Saying "[this is] not all that difficult" misunderstands the problem. If we implement an available package procedure to compute this, my hypothesis is that external devs will opt to implement it correctly.

If we offer easy, off the shelf ways to do this, then I don't think it will be an issue. So as long as we can figure out a way to do this in duplicity, I think it will be used, as long as it can be a quick shorthand to invoke that procedure.

dr-bonez avatar May 24 '22 20:05 dr-bonez