HomePhabricator
Diffusion Comm d441d146d478

[backup] Revoke holders on upload error

Description

[backup] Revoke holders on upload error

Summary:
Part of ENG-4501

If upload fails at some point we want to revoke holders for blobs so they don't hang around forever. For this purpose I've added a general purpose Defer struct that will defer a given command until an end of scope. If everything succeeds we cancel them (=> don't revoke the holders for blobs).

Depends on D8966

Test Plan:
cargo run -- --localstack-endpoint 'dummy url'
Check in logs if there was a blob upload (for both user keys and data). Check in db if there are no blob or backup rows present after the request ended.
Run service normally, check if upload still works.

Reviewers: bartek, patryk, kamil, jon

Reviewed By: bartek

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D8967

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Aug 25 2023, 7:15 AM
Reviewer
bartek
Differential Revision
D8967: [backup] Revoke holders on upload error
Parents
rCOMMdccc36586f2d: [backup] Add integration and performance tests
Branches
Unknown
Tags
Unknown