Commit Graph
2904 Commits
Author SHA1 Message Date
Michael Eischer 79f17ac895 archiver: switch fileSaver to repository BlobBufferPool 2026-11-22 17:54:09 +01:00
Michael Eischer 30de2d9211 repository: change SaveBlobAsync to take a BlobBuffer
Ownership of the buffer transfers to SaveBlobAsync. Callers can now take
a buffer from the buffer pool.

Internally saveAndEncrypt now reuses pooled buffers.
2026-11-22 17:54:09 +01:00
Michael Eischer 4718be1aee repository: add BlobBufferPool to BlobSaverAsync 2026-11-22 17:54:09 +01:00
Michael Eischer 3446754c41 restic: add BlobBuffer pool types
Based on the buffer type used by the archiver. The main change is that
`Get()` now always returns a slice with length zero.
2026-11-22 17:48:20 +01:00
Hugo 8af83234f2 Add benchmark with concurrent archivers (#5764)
Current benchmarks all work with a single archiver, and are not suitable
for testing changes which might affect contention.

Add a benchmark with multiple small files and multiple concurrent
archivers.
2026-11-22 16:35:59 +00:00
joyhsia 4729a99ebf tests: allow more time for REST server startup (#22205)
The macOS failure in #22146 reaches the two-second readiness deadline. Give the test server ten seconds to start while retaining immediate readiness and context cancellation handling.
2026-11-21 13:59:31 +00:00
Alexander Neumann d66a3f4fe7 Set development version for 0.20.0 2026-11-19 12:22:31 +01:00
Alexander Neumann 9c88ff768f Add version for 0.20.0 2026-11-19 12:22:02 +01:00
00f12ea705 build(deps): bump the golang-x-deps group across 1 directory with 8 updates (#22066)
* build(deps): bump the golang-x-deps group across 1 directory with 8 updates

Bumps the golang-x-deps group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [golang.org/x/crypto](https://github.com/golang/crypto) | `0.55.0` | `0.58.0` |
| [golang.org/x/net](https://github.com/golang/net) | `0.58.0` | `0.60.0` |
| [golang.org/x/oauth2](https://github.com/golang/oauth2) | `0.36.0` | `0.37.0` |
| [golang.org/x/sync](https://github.com/golang/sync) | `0.22.0` | `0.24.0` |
| [golang.org/x/sys](https://github.com/golang/sys) | `0.47.0` | `0.49.0` |
| [golang.org/x/term](https://github.com/golang/term) | `0.45.0` | `0.47.0` |
| [golang.org/x/text](https://github.com/golang/text) | `0.41.0` | `0.43.0` |
| [golang.org/x/time](https://github.com/golang/time) | `0.15.0` | `0.16.0` |



Updates `golang.org/x/crypto` from 0.55.0 to 0.58.0
- [Commits](https://github.com/golang/crypto/compare/v0.55.0...v0.58.0)

Updates `golang.org/x/net` from 0.58.0 to 0.60.0
- [Commits](https://github.com/golang/net/compare/v0.58.0...v0.60.0)

Updates `golang.org/x/oauth2` from 0.36.0 to 0.37.0
- [Commits](https://github.com/golang/oauth2/compare/v0.36.0...v0.37.0)

Updates `golang.org/x/sync` from 0.22.0 to 0.24.0
- [Commits](https://github.com/golang/sync/compare/v0.22.0...v0.24.0)

Updates `golang.org/x/sys` from 0.47.0 to 0.49.0
- [Commits](https://github.com/golang/sys/compare/v0.47.0...v0.49.0)

Updates `golang.org/x/term` from 0.45.0 to 0.47.0
- [Commits](https://github.com/golang/term/compare/v0.45.0...v0.47.0)

Updates `golang.org/x/text` from 0.41.0 to 0.43.0
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.41.0...v0.43.0)

Updates `golang.org/x/time` from 0.15.0 to 0.16.0
- [Commits](https://github.com/golang/time/compare/v0.15.0...v0.16.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.57.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x-deps
- dependency-name: golang.org/x/net
  dependency-version: 0.59.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x-deps
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.37.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x-deps
- dependency-name: golang.org/x/sync
  dependency-version: 0.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x-deps
- dependency-name: golang.org/x/sys
  dependency-version: 0.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x-deps
- dependency-name: golang.org/x/term
  dependency-version: 0.46.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x-deps
- dependency-name: golang.org/x/text
  dependency-version: 0.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x-deps
- dependency-name: golang.org/x/time
  dependency-version: 0.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x-deps
...

Signed-off-by: dependabot[bot] <support@github.com>

* Resolve deprecations

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-11-15 21:19:58 +01:00
Michael Eischer d991764a22 Resolve deprecations 2026-11-15 21:08:57 +01:00
Dean Chen 5cda063cbb fs: fall back to numeric ids when --ownership-by-name lookup fails (#22185)
Signed-off-by: Dean Chen <862469039@qq.com>
2026-11-15 19:30:21 +00:00
xh123637andMichael Eischer 2126756613 restorer: reject trees with duplicate or out-of-order node names (#22190)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
Signed-off-by: xh123637 <3324733895@qq.com>
2026-11-15 20:16:32 +01:00
JUSHUANGHUI LI d7aa4145e0 global: reject empty repository location files (#22052)
Return a fatal error before opening or creating a repository when its location file is empty after decoding and trimming whitespace.
2026-11-15 19:03:50 +00:00
Michael Eischer 335d7e38aa Merge pull request #22130 from junkerderprovinz/fix/issue-22112
stats: keep progress counters across snapshots
2026-11-15 20:01:16 +01:00
Rob MartinandMichael Eischer 2c9b353cbf repository: do not delete config on atomic backends during upgrade rollback (#22136)
In UpgradeRepo, if upgradeRepository fails, the error handler attempts
contingency rollback by re-uploading the original config file.

However, the contingency path unconditionally executed repo.be.Remove(ctx, h)
before calling repo.be.Save. On backends supporting atomic replacement (such
as local filesystems), a failed upgrade (e.g. out-of-disk-space or permissions
error while writing the temporary file) leaves the original, valid version 1
configuration file completely intact on disk.

Unconditionally removing the config file during rollback actively deletes
the working configuration. If the subsequent Save call also fails, the
repository is left permanently corrupted without a config file.

Condition the pre-removal on !repo.be.Properties().HasAtomicReplace, matching
the forward upgrade path in upgradeRepository. Add a unit test asserting that
aborted upgrades on atomic backends preserve the intact original configuration.

---------

Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-11-15 18:57:01 +00:00
Dean Chen 4dfa381b9f restorer: don't delete files when a directory tree can't be loaded (#22189)
When loading or iterating a directory tree failed, traverseTreeInner
returned a nil file list together with the error. If the error handler
ignored the error, the caller still called leaveDir with that nil list,
and restore --delete removed every existing entry of the directory in
the target, even though the expected content was simply unknown.

Force disable deletion in that case, the same way it is already done
for invalid node names.

Signed-off-by: Dean Chen <862469039@qq.com>
2026-11-15 19:50:17 +01:00
Younes Beriane c4f9e50609 restorer: rewrite partially matching hard-linked files in full (#22086) 2026-11-15 18:40:11 +00:00
Michael Eischer 516c8d32e0 Merge pull request #22117 from Grivn/fix/legacy-null-tree
data: read empty trees from older repaired snapshots
2026-11-15 19:27:39 +01:00
ump45nose 0039a14381 global: mention the cache dir and user agent environment defaults (#22135) 2026-11-05 21:12:18 +00:00
Michael Eischer 068a324dcd Merge pull request #22124 from pujitha24/auto/issue-22120
prune: report failure to list pack files as a fatal error
2026-11-05 21:24:23 +01:00
Michael Eischer f515b862de prune: simplify test setup 2026-11-05 21:15:09 +01:00
Wei-Lun Li 9a0b9e0eb5 data: return an error for too large numbers in ParseDuration (#22163) 2026-11-05 19:36:49 +00:00
subomiandMichael Eischer 83a2726a30 s3: add option to disable AWS dual-stack endpoints (#22060)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-11-05 19:07:43 +00:00
Junker der ProvinzandWinfried Plappert 84c2d0223f stats: keep progress counters across snapshots
The file, blob and size counters were reset for every snapshot, so the
progress line only reflected the last processed snapshot.

Co-authored-by: Winfried Plappert <18740761+wplapper@users.noreply.github.com>
2026-10-21 22:44:24 +02:00
Pujitha Paladugu bba1b68082 prune: report failure to list pack files as a fatal error
Motivation: when listing pack files fails during prune (for example due
to a request timeout), the error was returned unwrapped and main printed
it with "%+v", which dumps a stack trace. As discussed in the issue, the
error needs one more level of wrapping before it can be treated as a
fatal error.

Approach: in decidePackAction, wrap an error from listing pack files
with errors.Fatalf("failed to list pack files: %v"). Errors that are
already fatal (e.g. ErrSizeNotMatching) and errors after context
cancellation are returned unchanged. The underlying error is preserved
via Unwrap. Retry log messages are unchanged; only the final error
output is shortened and says where the failure occurred.

Validation: `go test ./internal/repository/ -run Prune` and
`go test ./cmd/restic/ -run Prune` pass. The new test
TestPrunePackListError (backend whose pack list fails) fails without
the change and passes with it. I did not reproduce a real REST backend
timeout.

Report: https://github.com/restic/restic/issues/22120
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5-5 (via Claude Code)
2026-10-18 12:58:49 -07:00
MikeeI adc0284113 copy: avoid a full index scan for disabled debug output (#22103) 2026-10-18 13:50:05 +00:00
Michael Eischer 5d745e2ead windows: use os.OpenFile with O_FILE_FLAG_* instead of low-level API 2026-10-17 22:57:11 +02:00
Michael Eischer 2497d99f9f fix linter error 2026-10-17 22:57:11 +02:00
Michael Eischer 35f15c398a apply go fix ./... 2026-10-17 22:57:11 +02:00
Grivn d714e22605 data: read empty trees from older repaired snapshots
Older repair snapshots versions serialized missing subtrees as nodes:null.
The streaming decoder rejects these trees, preventing prune and other
commands from traversing snapshots that previous releases could read.

Accept null as an empty node list. Add decoder coverage and a regression
that prunes, checks and restores a snapshot with a legacy empty subtree.
2026-10-16 01:58:41 +08:00
JayandMichael Eischer 519a979107 ci: update golangci-lint to v2.14 (#22111)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-10-11 16:33:41 +00:00
Michael Eischer 5127c4abf9 Fix tar extraction errors in sandboxes (#22071) 2026-09-25 22:08:18 +02:00
Michael Eischer 8e917cf0bd Merge pull request #22069 from MichaelEischer/go-1.27
CI: Add go 1.27
2026-09-25 22:05:52 +02:00
Michael Eischer 818dd21a4f index: hash blob IDs with maphash.Bytes (#22070)
Avoid constructing a maphash.Hash on every lookup and insert.
2026-09-25 22:05:12 +02:00
Michael Eischer 6adedec6b4 repository: use synctest for lock tests (#22038)
Replace select based on context/timer with deterministic pattern.
The tests depend on timing. Thus, use synctest which provides
deterministic clock updates and also speeds up test execution by
skipping sleep times.
2026-09-20 22:05:21 +02:00
Michael Eischer 1cce3790f4 gofmt 2026-09-20 21:28:55 +02:00
Sergey Kolomiichuk ab17711e31 selfupdate: replace deprecated golang.org/x/crypto/openpgp with ProtonMail/go-crypto (#21997) 2026-09-20 18:33:24 +00:00
Michael Eischer 96188e33a3 backend/s3: switch tests from minio to seaweedfs (#22067) 2026-09-20 20:03:48 +02:00
Etienne D ba802d42b7 fix(swift): store APIKey as SecretString to prevent debug log leak (#22007) 2026-08-29 20:11:48 +00:00
Michael Eischer b593ba305b Apply go fix ./... (#22037) 2026-08-29 21:02:05 +02:00
Michael Eischer c6074f82fb Merge pull request #21978 from MichaelEischer/go-fix2
Run `go fix ./...`
2026-08-01 22:17:53 +02:00
Arpit Jain 8baffc4027 repository: reject key and config files that are too short (#21977)
Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
2026-07-22 20:38:07 +00:00
Michael Eischer f215365af9 Apply go fix -waitgroup ./... 2026-07-22 22:27:21 +02:00
Michael Eischer 14e523a1d9 Apply go fix -testingcontext ./... 2026-07-22 22:27:15 +02:00
Michael Eischer 58f92708c2 Apply go fix -stringsseq ./... 2026-07-22 22:27:07 +02:00
Michael Eischer 31e96f4ec9 Apply go fix -stringsbuilder ./... 2026-07-22 22:26:50 +02:00
Michael Eischer a2cb015591 Apply go fix -slicescontains ./... 2026-07-22 22:26:33 +02:00
Michael Eischer e2495b72bb Apply go fix -reflecttypefor ./... 2026-07-22 22:26:27 +02:00
Michael Eischer 2c169edad4 Apply go fix -rangeint ./... 2026-07-22 22:26:19 +02:00
Michael Eischer fb36a7f59b Apply go fix -omitzero ./... 2026-07-22 22:26:07 +02:00