1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-04 18:48:39 +00:00
restic/internal/backend
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
..
azure feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
b2 feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
cache feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
dryrun feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
gs feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
layout backend/layout: unexport fields and simplify rest layout 2024-08-31 17:25:24 +02:00
limiter CI: enable bodyclose linter 2024-01-19 21:17:18 +01:00
local feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
location move Backend interface to backend package 2023-10-25 23:00:18 +02:00
logger move Backend interface to backend package 2023-10-25 23:00:18 +02:00
mem feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
mock feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
rclone feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
rest feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
retry feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
s3 feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
sema move Backend interface to backend package 2023-10-25 23:00:18 +02:00
sftp feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
swift feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
test replace deprecated usages of math/rand 2024-08-10 19:34:49 +02:00
testdata drop support for s3legacy layout 2024-08-31 17:25:24 +02:00
util bump required go version to 1.21 2024-08-10 19:16:10 +02:00
backend.go feat(backends/s3): add warmup support before repacks and restores (#5173) 2025-02-01 18:26:27 +00:00
backend_test.go move Backend interface to backend package 2023-10-25 23:00:18 +02:00
doc.go
file.go move Backend interface to backend package 2023-10-25 23:00:18 +02:00
file_test.go move Backend interface to backend package 2023-10-25 23:00:18 +02:00
http_transport.go make timeout for slow requests configurable 2024-08-26 14:14:43 +02:00
httpuseragent_roundtripper.go http: allow custom User-Agent for outgoing HTTP requests 2024-05-30 15:38:06 +02:00
httpuseragent_roundtripper_test.go http: allow custom User-Agent for outgoing HTTP requests 2024-05-30 15:38:06 +02:00
readerat.go move Backend interface to backend package 2023-10-25 23:00:18 +02:00
rewind_reader.go move Backend interface to backend package 2023-10-25 23:00:18 +02:00
rewind_reader_test.go move Backend interface to backend package 2023-10-25 23:00:18 +02:00
shell_split.go Fix typos 2023-12-06 13:11:55 +01:00
shell_split_test.go
watchdog_roundtriper.go backend: return correct error on upload/request timeout 2024-08-10 18:06:24 +02:00
watchdog_roundtriper_test.go Merge pull request #4993 from MichaelEischer/fix-timeout-error 2024-08-15 22:07:37 +02:00