restic/changelog/unreleased
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
..
.gitignore Add gitignore to changelog/unreleased 2020-11-05 09:01:32 +01:00
issue-1843 fs: fix restoring timestamps on Windows for long paths 2024-09-15 18:28:11 +02:00
issue-2165 archiver: ignore files removed in the meantime 2024-11-30 15:30:42 +01:00
issue-2511 generate: allow passing `-` for stdout output 2024-09-16 10:54:00 +03:00
issue-3202 feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
issue-3697 backup: allow excluding online-only cloud files 2025-01-13 21:11:23 +01:00
issue-4433 Issue 4433: Ability to define sort order for output of find command (#5184) 2025-01-29 20:44:16 +00:00
issue-4521 azure: add support for hot, cool, or cool access tiers 2024-10-20 15:27:21 +05:30
issue-4948 main: format exit errors as JSON when using --json 2024-08-11 12:52:50 -04:00
issue-4983 changelog: update to indicate change applies only for GHCR images. 2024-12-02 01:11:26 +05:30
issue-5081 add config retry changelog 2024-11-01 15:22:55 +01:00
issue-5089 xattrs - restore all by default, doc/chglog update 2025-01-10 15:25:09 -05:00
issue-5092 ui: restore --delete indicates number of deleted files (#5100) 2024-12-01 15:29:11 +01:00
issue-5131 build dragonflybsd binaries 2024-11-30 15:47:39 +01:00
issue-5137 tag: output the original ID and new snapshotID (#5144) 2025-01-14 18:57:47 +01:00
issue-5174 Update changelog, for issue 5174 (Enable xattr support, on NetBSD 10+) 2024-12-19 14:32:16 +00:00
pull-4938 bump required go version to 1.21 2024-08-10 19:16:10 +02:00
pull-5054 dump: compress zip archives 2024-09-15 21:04:54 +02:00
pull-5119 backup: include start and end time in json output 2024-11-01 16:31:34 +01:00
pull-5141 Add changelog info 2024-11-15 14:46:34 -07:00
pull-5153 Do not skip root tree when searching for trees (#5153) 2025-01-13 21:08:38 +00:00
pull-5162 Stabilize `explicit-s3-anonymous-auth` and `safe-forget-keep-tags` flags 2024-11-30 21:22:51 +01:00
pull-5170 fix: Windows VSS Event ID 8194 (#5170) 2025-01-26 15:25:38 +00:00
pull-5212 prune: correctly account for duplicates in max-unused check 2025-01-19 17:47:49 +01:00