restic / rest-server

Rest Server is a high performance HTTP server that implements restic's REST backend API.
BSD 2-Clause "Simplified" License
922 stars 138 forks source link

Retrying an upload can fail in append-only mode #196

Open MichaelEischer opened 1 year ago

MichaelEischer commented 1 year ago

Output of rest-server --version

0.11.0

What should rest-server do differently?

As discussed in https://github.com/restic/rest-server/pull/195#issuecomment-1235918789 there is a possibility that retrying the upload for a file may fail in append-only mode:

if an upload for an append-only repository succeeds without the client learning about that fact, this will cause later retries to fail. It would be possible for the rest-server to accept a reupload iff that upload has the expected file hash.

Another option would be to return a special status code to signal to restic that the file in question already exists.

What are you trying to do? What is your use case?

Ensure uploads work reliably even when retries are necessary.