1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-04 02:28:27 +00:00
restic/internal
Gilbert Gilb's 536ebefff4
feat(backends/s3): add warmup support before repacks and restores (#5173)
* feat(backends/s3): add warmup support before repacks and restores

This commit introduces basic support for transitioning pack files stored
in cold storage to hot storage on S3 and S3-compatible providers.

To prevent unexpected behavior for existing users, the feature is gated
behind new flags:

- `s3.enable-restore`: opt-in flag (defaults to false)
- `s3.restore-days`: number of days for the restored objects to remain
  in hot storage (defaults to `7`)
- `s3.restore-timeout`: maximum time to wait for a single restoration
  (default to `1 day`)
- `s3.restore-tier`: retrieval tier at which the restore will be
  processed. (default to `Standard`)

As restoration times can be lengthy, this implementation preemptively
restores selected packs to prevent incessant restore-delays during
downloads. This is slightly sub-optimal as we could process packs
out-of-order (as soon as they're transitioned), but this would really
add too much complexity for a marginal gain in speed.

To maintain simplicity and prevent resources exhautions with lots of
packs, no new concurrency mechanisms or goroutines were added. This just
hooks gracefully into the existing routines.

**Limitations:**

- Tests against the backend were not written due to the lack of cold
  storage class support in MinIO. Testing was done manually on
  Scaleway's S3-compatible object storage. If necessary, we could
  explore testing with LocalStack or mocks, though this requires further
  discussion.
- Currently, this feature only warms up before restores and repacks
  (prune/copy), as those are the two main use-cases I came across.
  Support for other commands may be added in future iterations, as long
  as affected packs can be calculated in advance.
- The feature is gated behind a new alpha `s3-restore` feature flag to
  make it explicit that the feature is still wet behind the ears.
- There is no explicit user notification for ongoing pack restorations.
  While I think it is not necessary because of the opt-in flag, showing
  some notice may improve usability (but would probably require major
  refactoring in the progress bar which I didn't want to start). Another
  possibility would be to add a flag to send restores requests and fail
  early.

See https://github.com/restic/restic/issues/3202

* ui: warn user when files are warming up from cold storage

* refactor: remove the PacksWarmer struct

It's easier to handle multiple handles in the backend directly, and it
may open the door to reducing the number of requests made to the backend
in the future.
2025-02-01 18:26:27 +00:00
..
archiver repository: restrict SaveUnpacked and RemoveUnpacked 2025-01-13 22:39:57 +01:00
backend feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
bloblru Fix typos 2024-07-03 20:02:06 +02:00
checker repository: restrict SaveUnpacked and RemoveUnpacked 2025-01-13 22:39:57 +01:00
crypto crypto: cleanup ciphertext verification error 2024-06-05 22:33:20 +02:00
debug improve fprintf related error handling 2024-11-01 17:07:43 +01:00
dump Merge pull request #5054 from phillipp/dump-compress-zip 2024-10-16 19:17:47 +00:00
errors errors, fs: Replace CombineErrors with stdlib Join 2024-10-05 10:56:40 +02:00
feature feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
filter move include/exclude options to filter package 2024-08-31 18:04:07 +02:00
fs fix: Windows VSS Event ID 8194 (#5170) 2025-01-26 15:25:38 +00:00
fuse fuse: test that the same fs.Node is used for the same file 2024-09-14 18:11:44 +02:00
migrations repository: restrict SaveUnpacked and RemoveUnpacked 2025-01-13 22:39:57 +01:00
options backend, options: Prefer strings.Cut to SplitN 2022-12-02 19:19:14 +01:00
repository feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
restic feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
restorer feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
selfupdate Replace lots of unused parameters with _ 2023-05-18 21:17:53 +02:00
test use consistent alias for interal/test package 2024-03-29 00:24:03 +01:00
textfile Replace most usages of ioutil with the underlying function 2022-12-02 19:36:43 +01:00
ui ui/termstatus: Remove unused bytes.Buffer 2025-02-01 08:21:40 +01:00
walker ls: proper error handling if output is not possible 2024-11-01 17:07:43 +01:00