Skip to content

Commit

Permalink
Merge work 0.14.0 to netapp (#2)
Browse files Browse the repository at this point in the history
* Add changelog entry for validating exclude patterns

* Update 030_preparing_a_new_repo.rst

* prune: Fix crash on empty snapshot

* prune: Don't print stack trace if snapshot can't be loaded

* Update github.com/minio/minio-go/v7 to v7.0.27

This version adds support for Cloudflare R2, as discussed in restic#3757

* Update gopkg.in/yaml

This fixes a panic in invalid input, but I think we aren't affected.

* internal/restic: Custom ID.MarshalJSON

This skips an allocation. internal/archiver benchmarks, Linux/amd64:

name                     old time/op    new time/op    delta
ArchiverSaveFileSmall-8    3.94ms ± 6%    3.91ms ± 6%    ~     (p=0.947 n=20+20)
ArchiverSaveFileLarge-8     304ms ± 3%     301ms ± 4%    ~     (p=0.265 n=18+18)

name                     old speed      new speed      delta
ArchiverSaveFileSmall-8  1.04MB/s ± 6%  1.05MB/s ± 6%    ~     (p=0.803 n=20+20)
ArchiverSaveFileLarge-8   142MB/s ± 3%   143MB/s ± 4%    ~     (p=0.421 n=18+19)

name                     old alloc/op   new alloc/op   delta
ArchiverSaveFileSmall-8    17.9MB ± 0%    17.9MB ± 0%  -0.01%  (p=0.000 n=19+19)
ArchiverSaveFileLarge-8     382MB ± 2%     382MB ± 1%    ~     (p=0.687 n=20+19)

name                     old allocs/op  new allocs/op  delta
ArchiverSaveFileSmall-8       540 ± 1%       528 ± 0%  -2.19%  (p=0.000 n=19+19)
ArchiverSaveFileLarge-8     1.93k ± 3%     1.79k ± 4%  -7.06%  (p=0.000 n=20+20)

* Fix linter check

* archiver: Remove cleanup goroutine from BufferPool

This isn't doing anything. Channels should get cleaned up by the GC when
the last reference to them disappears, just like all other data
structures. Also inlined BufferPool.Put in Buffer.Release, its only
caller.

* cmd/restic: Remove trailing "..." from progress messages

These were added after message since the last refactor of the progress
printing code. Also skips an allocation in the common case.

* migrate: Cleanup option to request repository check

* archiver: remove tomb usage

* archiver: free workers once finished

* get rid of tomb package

* backend/sftp: Support atomic rename

... if the server has [email protected].
OpenSSH introduced this extension in 2008:
openssh/openssh-portable@7c29661

* internal/repository: Fix LoadBlob + fuzz test

When given a buf that is big enough for a compressed blob but not its
decompressed contents, the copy at the end of LoadBlob would skip the
last part of the contents.

Fixes restic#3783.

* fix handling of maxKeys in SearchKey

* fix flaky key test

* tweak password test count changelog

* all: Move away from pkg/errors, easy cases

github.com/pkg/errors is no longer getting updates, because Go 1.13
went with the more flexible errors.{As,Is} function. Use those instead:
errors from pkg/errors already support the Unwrap interface used by 1.13
error handling. Also:

* check for io.EOF with a straight ==. That value should not be wrapped,
  and the chunker (whose error is checked in the cases changed) does not
  wrap it.
* Give custom Error methods pointer receivers, so there's no ambiguity
  when type-switching since the value type will no longer implement error.
* Make restic.ErrAlreadyLocked private, and rename it to
  alreadyLockedError to match the stdlib convention that error type
  names end in Error.
* Same with rest.ErrIsNotExist => rest.notExistError.
* Make s3.Backend.IsAccessDenied a private function.

* backend: Move semaphores to a dedicated package

... called backend/sema. I resisted the temptation to call the main
type sema.Phore. Also, semaphores are now passed by value to skip a
level of indirection when using them.

* restic prune: Merge three loops over the index

There were three loops over the index in restic prune, to find
duplicates, to determine sizes (in pack.Size) and to generate packInfos.
These three are now one loop. This way, prune doesn't need to construct
a set of duplicate blobs, pack.Size doesn't need to contain special
logic for prune's use case (the onlyHdr argument) and pack.Size doesn't
need to construct a map only to have it immediately transformed into a
different map.

Some quick testing on a 160GiB local repo doesn't show running time or
memory use of restic prune --dry-run changing significantly.

* cmd/restic, limiter: Move config knowledge to internal packages

The GlobalOptions struct now embeds a backend.TransportOptions, so it
doesn't need to construct one in open and create. The upload and
download limits are similarly now a struct in internal/limiter that is
embedded in GlobalOptions.

* Revert "restic prune: Merge three loops over the index"

This reverts commit 8bdfcf7.
Should fix restic#3809. Also needed to make restic#3290 apply cleanly.

* repository: index saving belongs into the MasterIndex

* repository: add Save method to MasterIndex interface

* repository: make flushPacks private

* repository: remove unused index.Store

* repository: inline index.encode

* repository: remove unused index.ListPack

* repository: remove unused (Master)Index.Count

* repository: Properly set id for finalized index

As MergeFinalIndex and index uploads can occur concurrently, it is
necessary for MergeFinalIndex to check whether the IDs for an index were
already set before merging it. Otherwise, we'd loose the ID of an index
which is set _after_ uploading it.

* repository: remove MasterIndex.All()

* repository: hide MasterIndex.FinalizeFullIndexes / FinalizeNotFinalIndexes

* repository: simplify CreateIndexFromPacks

* repository: remove unused packIDToIndex field

* repository: cleanup

* drop unused repository.Loader interface

* redact http authorization header in debug log output

* redacted keys/token in backend config debug log

* redact swift auth token in debug output

* Return real size from SaveBlob

* Print number of bytes added to the repo

This includes optional compression and crypto overhead.

* stats: return storage size for raw-data mode

raw-data summed up the size of the blob plaintexts. However, with
compression this makes little sense as the storage size in the
repository is lower due to compression. Thus sum up the actual size each
blob takes in the repository.

* Account for pack header overhead at each entry

This will miss the pack header crypto overhead and the length field,
which only amount to a few bytes per pack file.

* extend compression feature changelog entry

* rebuild-index: correctly rebuild index for mixed packs

For mixed packs, data and tree blobs were stored in separate index
entries. This results in warning from the check command and maybe other
problems.

* check: Print full ids

The short ids are not always unique. In addition, recovering from
damages is easier when having the full ids as that makes it easier to
access the corresponding files.

* check: remove dead code

* Don't crash if SecretString is uninitialized

* tag: Remove unnecessary flush call

* repository: Rework blob saving to use an async pack uploader

Previously, SaveAndEncrypt would assemble blobs into packs and either
return immediately if the pack is not yet full or upload the pack file
otherwise. The upload will block the current goroutine until it
finishes.

Now, the upload is done using separate goroutines. This requires changes
to the error handling. As uploads are no longer tied to a SaveAndEncrypt
call, failed uploads are signaled using an errgroup.

To count the uploaded amount of data, the pack header overhead is no
longer returned by `packer.Finalize` but rather by
`packer.HeaderOverhead`. This helper method is necessary to continue
returning the pack header overhead directly to the responsible call to
`repository.SaveBlob`. Without the method this would not be possible,
as packs are finalized asynchronously.

* archiver: Limit blob saver count to GOMAXPROCS

Now with the asynchronous uploaders there's no more benefit from using
more blob savers than we have CPUs. Thus use just one blob saver for
each CPU we are allowed to use.

* archiver: Reduce tree saver concurrency

Large amount of tree savers have no obvious benefit, however they can
increase the amount of (potentially large) trees kept in memory.

* repository: Limit to a single pending pack file

Use only a single not completed pack file to keep the number of open and
active pack files low. The main change here is to defer hashing the pack
file to the upload step. This prevents the pack assembly step to become
a bottleneck as the only task is now to write data to the temporary pack
file.

The tests are cleaned up to no longer reimplement packer manager
functions.

* Document connections and compression option

* Add changelog for async pack uploads

* adapt workers based on whether an operation is CPU or IO-bound

Use runtime.GOMAXPROCS(0) as worker count for CPU-bound tasks,
repo.Connections() for IO-bound task and a combination if a task can be
both. Streaming packs is treated as IO-bound as adding more worker
cannot provide a speedup.

Typical IO-bound tasks are download / uploading / deleting files.
Decoding / Encoding / Verifying are usually CPU-bound. Several tasks are
a combination of both, e.g. for combined download and decode functions.
In the latter case add both limits together. As the backends have their
own concurrency limits restic still won't download more than
repo.Connections() files in parallel, but the additional workers can
decode already downloaded data in parallel.

* Document automatic CPU/IO-concurrency

* Fix data race in blob_saver

After the `BlobSaver` job is submitted, the buffer can be released and
reused by another `FileSaver` even before `BlobSaver.Save` returns. That
FileSaver will the change `buf.Data` leading to wrong backup statistics.

Found by `go test -race ./...`:

WARNING: DATA RACE
Write at 0x00c0000784a0 by goroutine 41:
  github.com/restic/restic/internal/archiver.(*FileSaver).saveFile()
      /home/michael/Projekte/restic/restic/internal/archiver/file_saver.go:176 +0x789
  github.com/restic/restic/internal/archiver.(*FileSaver).worker()
      /home/michael/Projekte/restic/restic/internal/archiver/file_saver.go:242 +0x2af
  github.com/restic/restic/internal/archiver.NewFileSaver.func2()
      /home/michael/Projekte/restic/restic/internal/archiver/file_saver.go:88 +0x5d
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /home/michael/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57 +0x91

Previous read at 0x00c0000784a0 by goroutine 29:
  github.com/restic/restic/internal/archiver.(*BlobSaver).Save()
      /home/michael/Projekte/restic/restic/internal/archiver/blob_saver.go:57 +0x1dd
  github.com/restic/restic/internal/archiver.(*BlobSaver).Save-fm()
      <autogenerated>:1 +0xac
  github.com/restic/restic/internal/archiver.(*FileSaver).saveFile()
      /home/michael/Projekte/restic/restic/internal/archiver/file_saver.go:191 +0x855
  github.com/restic/restic/internal/archiver.(*FileSaver).worker()
      /home/michael/Projekte/restic/restic/internal/archiver/file_saver.go:242 +0x2af
  github.com/restic/restic/internal/archiver.NewFileSaver.func2()
      /home/michael/Projekte/restic/restic/internal/archiver/file_saver.go:88 +0x5d
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /home/michael/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57 +0x91

* Fix minor typo in docs

* Wording: change repo to repository

* Restore: validate provided patterns

* Add testRunRestoreAssumeFailure function

* Test restore fails when using invalid patterns

* Fix wording in changelog template

* Add changelog entry

* Added hint for --compression max in migration process

Added hint for --compression max in migration process. Since this is a onetime process users should be aware of this and consider this step.

* Wording: replace further repo occurrences with repository

* doc: update sample help output

* doc: Rework hint to repack with max compression

* doc: Add note about using rclone for Google Drive

It wasn't clear that Google Cloud Storage and Google Drive are two different services and that one should use the rclone backend for the latter. This commit adds a note with this information.

* azure: add SAS authentication option

* azure: Strip ? prefix from sas token

* backup: clarify usage string

Using the `--files-from` options it is possible to run `backup` without
specifying any source paths directly on the command line.

* prune: Enhance treatment of duplicates

* prune: handle very high duplication of some blobs

Suggested-By: Alexander Weiss <[email protected]>

* prune: code cleanups

* repository: extract LoadTree/SaveTree

The repository has no real idea what a Tree is. So these methods never
belonged there.

* repository: extract Load/StoreJSONUnpacked

A Load/Store method for each data type is much clearer. As a result the
repository no longer needs a method to load / store json.

* mock: move to internal/backend

* limiter: move to internal/backend

* crypto: move crypto buffer helpers

* restorer: extract hardlinks index from restic package

* backend: extract readerat from restic package

* check: complain about mixed pack files

* check: Complain about usage of s3 legacy layout

* check: Deprecate `--check-unused`

Unused blobs are not a problem but rather expected to exist now that
prune by default does not remove every unused blob. However, the option
has caused questions from users whether a repository is damaged or not,
so just remove that option.

Note that the remaining code is left intact as it is still useful for
our test cases.

* checker: Fix S3 legacy layout detection

* Fix S3 legacy layout migration

* Add changelog for stricter checks

* archiver: remove dead attribute from FutureNode

* archiver: cleanup Saver interface

* archiver: remove unused fileInfo from progress callback

* archiver: unify FutureTree/File into futureNode

There is no real difference between the FutureTree and FutureFile
structs. However, differentiating both increases the size of the
FutureNode struct.

The FutureNode struct is now only 16 bytes large on 64bit platforms.
That way is has a very low overhead if the corresponding file/directory
was not processed yet.

There is a special case for nodes that were reused from the parent
snapshot, as a go channel seems to have 96 bytes overhead which would
result in a memory usage regression.

* archiver: Incrementally serialize tree nodes

That way it is not necessary to keep both the Nodes forming a Tree and
the serialized JSON version in memory.

* archiver: reduce memory usage for large files

FutureBlob now uses a Take() method as a more memory-efficient way to
retrieve the futures result. In addition, futures are now collected
while saving the file. As only a limited number of blobs can be queued
for uploading, for a large file nearly all FutureBlobs already have
their result ready, such that the FutureBlob object just consumes
memory.

* Add changelog for the optimized tree serialization

* Remove stale comments from backend/sftp

The preExec and postExec functions were removed in
0bdb131 from 2018.

* Speed up restic init over slow SFTP links

pkg/sftp.Client.MkdirAll(d) does a Stat to determine if d exists and is
a directory, then a recursive call to create the parent, so the calls
for data/?? each take three round trips. Doing a Mkdir first should
eliminate two round trips for 255/256 data directories as well as all
but one of the top-level directories.

Also, we can do all of the calls concurrently. This may reintroduce some
of the Stat calls when multiple goroutines try to create the same
parent, but at the default number of connections, that should not be
much of a problem.

* Add environment variable RESTIC_COMPRESSION

* prune: separate collecting/printing/pruning

* prune: split into smaller functions

* prune: Add internal integrity check

After repacking every blob that should be kept must have been repacked.
We have seen a few cases in which a single blob went missing, which
could have been caused by a bitflip somewhere. This sanity check might
help catch some of these cases.

* repository: try to recover from invalid blob while repacking

If a blob that should be kept is invalid, Repack will now try to request
the blob using LoadBlob. Only return an error if that fails.

* prune: move code

* repository: Test fallback to existing blobs

* Add changelog for restic#3837/restic#3840

* internal/restic: Handle EINVAL for xattr on Solaris

Also make the errors a bit less verbose by not prepending the operation,
since pkg/xattr already does that. Old errors looked like

    Listxattr: xattr.list /myfiles/.zfs/snapshot: invalid argument

* Add possibility to set snapshot ID (used in test)

* Generalize fuse snapshot dirs implemetation

+ allow "/" in tags and snapshot template

* Make snapshots dirs in mount command customizable

* fuse: cleanup test

* fuse: remove unused MetaDir

* add option for setting min pack size

* prune: add repack-small parameter

* prune: reduce priority of repacking small packs

* repository: prevent header overfill

* document minPackSize

* rework pack size parameter documentation

* update restic help snippets in documentation

* Add changelog for packsize option

* rename option to --pack-size

* Only repack small files if there are multiple of them

* Always repack very small pack files

* s3: Disable multipart uploads below 200MB

* Add note that pack-size is not an exact limit

* Reword prune --repack-small description

* repository: StreamPack in parts if there are too large gaps

For large pack sizes we might be only interested in the first and last
blob of a pack file. Thus stream a pack file in multiple parts if the
gaps between requested blobs grow too large.

* Remove unused hooks mechanism

* debug: enable debug support for release builds

* debug: support roundtripper logging also for release builds

Different from debug builds do not use the eofDetectRoundTripper if
logging is disabled.

* update documentation to reflect DEBUG_LOG for release builds

* Add changelog for DEBUG_LOG available in release builds

* fuse: Redesign snapshot dirstruct

Cleanly separate the directory presentation and the snapshot directory
structure. SnapshotsDir now translates the dirStruct into a format
usable by the fuse library and contains only minimal special case rules.
All decisions have moved into SnapshotsDirStructure which now creates a
fully preassembled tree data structure.

* Mention --snapshot-template and --time-template in changelog

* mount: remove unused inode field from root node

* mount: Fix parent inode used by snapshots dir

* Update tests to Go 1.19

* Bump golangci-lint version

* restic: Use stable sorting in snapshot policy

sort.Sort is not guaranteed to be stable. Go 1.19 has changed the
sorting algorithm which resulted in changes of the sort order. When
comparing snapshots with identical timestamp but different paths and
tags lists, there is not meaningful order among them. So just keep their
order stable.

* stats: Add snapshots count to json output

* Fix typo with double percentage in help text

* doc: Update link to GCS documentation

Updates the link to Google Cloud Storage documentation about creating a service account key.

* doc: Update more links to GCS documentation

* forget: Error when invalid unit is given in duration policy

* doc: Fix typo in compression section

* forget: Fail test if duration parsing error is missing

* comment cleanup

gofmt reformatted the comment

* mount: Map slashes in tags to underscores

Suggested-by: greatroar <>

* copy: replace --repo2 with --from-repo

`init` and `copy` use `--repo2` with two different meaning which has
proven to be confusing for users. `--from-repo` now consistently marks a
source repository from which data is read. `--repo` is now always the
target/destination repository.

* mount: Only remember successful snapshot refreshes

If the context provided by the fuse library is canceled before the index
was loaded this could lead to missing snapshots.

* gofmt all files

Apparently the rules for comment formatting have changed with go 1.19.

* doc: document aws session token

* helper: don't setup cmd paths twice

* helper: cleanups

* helper: Reduce number of parallel builds a bit

The go compiler is already parallelized. The high concurrency caused my
podman container to hit a resource limit.

* helper: download modules as first step

There's no use in running that step in parallel.

* repository: Do not report ignored packs in EachByPack

Ignored packs were reported as an empty pack by EachByPack. The most
immediate effect of this is that the progress bar for rebuilding the
index reports processing more packs than actually exist.

* Add note that larger packs increase disk wear

* doc: fix typo

* update dependencies

* downgrade bazil/fuse again to retain macOS support

* remain compatible with go 1.15

* restic: Cleanup xattr error handling for Solaris

Since xattr 0.4.8 (pkg/xattr#68) returns ENOTSUP
similar to Linux.

* rclone: Return a permanent error if rclone already exited

rclone can exit early for example when the connection to rclone is
relayed for example via ssh: `-o rclone.program='ssh [email protected]
forced-command'`

* Polish changelog entries

* doc: Improve/clarify preparing and versions of repositories

* Further changelog polishing

* Fix typo in the environment variable name for --from-password-file

* Prepare changelog for 0.14.0

* Generate CHANGELOG.md for 0.14.0

* Update manpages and auto-completion

* Add version for 0.14.0

* go mod tidy run

* fix some merge errors

* tweaked linting to avoid merge nightmares

* took out lint because its not working and bugged me and updated the version for netapp

* updated to 1.8

---------

Co-authored-by: Lorenz Bausch <[email protected]>
Co-authored-by: MichaelEischer <[email protected]>
Co-authored-by: Arigbede Moses <[email protected]>
Co-authored-by: Alexander Neumann <[email protected]>
Co-authored-by: Alexander Neumann <[email protected]>
Co-authored-by: greatroar <[email protected]>
Co-authored-by: Jayson Wang <[email protected]>
Co-authored-by: mattxtaz <[email protected]>
Co-authored-by: lbausch <[email protected]>
Co-authored-by: JsBergbau <[email protected]>
Co-authored-by: rawtaz <[email protected]>
Co-authored-by: Roger Gammans <[email protected]>
Co-authored-by: Alexander Weiss <[email protected]>
Co-authored-by: Kyle Brennan <[email protected]>
Co-authored-by: greatroar <@>
Co-authored-by: Leo R. Lundgren <[email protected]>
Co-authored-by: bmason <[email protected]>
  • Loading branch information
17 people authored Feb 9, 2023
1 parent 3598439 commit fc9ab1a
Show file tree
Hide file tree
Showing 330 changed files with 9,819 additions and 5,370 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Workaround for https://github.com/golang/go/issues/52268.
**/testdata/fuzz/*/* eol=lf
34 changes: 0 additions & 34 deletions .github/workflows/netapp-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,40 +166,6 @@ jobs:
calens
if: matrix.check_changelog

lint:
name: lint
runs-on: ubuntu-latest
env:
go: 1.16.x
steps:
- name: Set up Go ${{ env.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.go }}

- name: Check out code
uses: actions/checkout@v2

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.36
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
args: --verbose --timeout 5m
skip-go-installation: true

# only run golangci-lint for pull requests, otherwise ALL hints get
# reported. We need to slowly address all issues until we can enable
# linting the master branch :)
if: github.event_name == 'pull_request'

- name: Check go.mod/go.sum
run: |
echo "check if go.mod and go.sum are up to date"
go mod tidy
git diff --exit-code go.mod go.sum

buildnpush:
name: Build and Push Docker Package
Expand Down
12 changes: 3 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,10 @@ linters:
# show how code can be simplified
- gosimple

# # make sure code is formatted
- gofmt

# examine code and report suspicious constructs, such as Printf calls whose
# arguments do not align with the format string
- govet

# make sure names and comments are used according to the conventions
- golint

# detect when assignments to existing variables are not used
- ineffassign

Expand All @@ -51,7 +45,7 @@ issues:

# list of things to not warn about
exclude:
# golint: do not warn about missing comments for exported stuff
- exported (function|method|var|type|const) `.*` should have comment or be unexported
# golint: ignore constants in all caps
# revive: do not warn about missing comments for exported stuff
- exported (function|method|var|type|const) .* should have comment or be unexported
# revive: ignore constants in all caps
- don't use ALL_CAPS in Go names; use CamelCase
440 changes: 427 additions & 13 deletions CHANGELOG.md

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ environment was used and so on. Please tell us at least the following things:
Remember, the easier it is for us to reproduce the bug, the earlier it will be
corrected!

In addition, you can compile restic with debug support by running
`go run build.go -tags debug` and instructing it to create a debug
log by setting the environment variable `DEBUG_LOG` to a file, e.g. like this:
In addition, you can instruct restic to create a debug log by setting the
environment variable `DEBUG_LOG` to a file, e.g. like this:

$ export DEBUG_LOG=/tmp/restic-debug.log
$ restic backup ~/work
Expand All @@ -66,8 +65,8 @@ Development Environment
The repository contains the code written for restic in the directories
`cmd/` and `internal/`.

Restic requires Go version 1.14 or later for compiling. Clone the repo (without
having `$GOPATH` set) and `cd` into the directory:
Make sure you have the minimum required Go version installed. Clone the repo
(without having `$GOPATH` set) and `cd` into the directory:

$ unset GOPATH
$ git clone https://github.com/restic/restic
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16-alpine as builder
FROM golang:1.18-alpine as builder
ARG BUILD_DATETIME
WORKDIR /src
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion NETAPPVERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1
3.0
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.1
0.14.0
9 changes: 9 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-1153
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Enhancement: Support pruning even when the disk is full

When running out of disk space it was no longer possible to add or remove
data from a repository. To help with recovering from such a deadlock, the
prune command now supports an `--unsafe-recover-no-free-space` option to
recover from these situations. Make sure to read the documentation first!

https://github.com/restic/restic/issues/1153
https://github.com/restic/restic/pull/3481
8 changes: 8 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-1842
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Change: Support debug log creation in release builds

Creating a debug log was only possible in debug builds which required users to
manually build restic. We changed the release builds to allow creating debug
logs by simply setting the environment variable `DEBUG_LOG=logname.log`.

https://github.com/restic/restic/issues/1842
https://github.com/restic/restic/pull/3826
28 changes: 28 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-21
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Enhancement: Add compression support

We've added compression support to the restic repository format. To create a
repository using the new format run `init --repository-version 2`. Please note
that the repository cannot be read by restic versions prior to 0.14.0.

You can configure whether data is compressed with the option `--compression`. It
can be set to `auto` (the default, which will compress very fast), `max` (which
will trade backup speed and CPU usage for better compression), or `off` (which
disables compression). Each setting is only applied for the current run of restic
and does *not* apply to future runs. The option can also be set via the
environment variable `RESTIC_COMPRESSION`.

To upgrade in place run `migrate upgrade_repo_v2` followed by `prune`. See the
documentation for more details. The migration checks the repository integrity
and upgrades the repository format, but will not change any data. Afterwards,
prune will rewrite the metadata to make use of compression.

As an alternative you can use the `copy` command to migrate snapshots; First
create a new repository using
`init --repository-version 2 --copy-chunker-params --repo2 path/to/old/repo`,
and then use the `copy` command to copy all snapshots to the new repository.

https://github.com/restic/restic/issues/21
https://github.com/restic/restic/issues/3779
https://github.com/restic/restic/pull/3666
https://github.com/restic/restic/pull/3704
https://github.com/restic/restic/pull/3733
18 changes: 18 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-2162
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Enhancement: Adaptive IO concurrency based on backend connections

Many commands used hard-coded limits for the number of concurrent operations.
This prevented speed improvements by increasing the number of connections used
by a backend.

These limits have now been replaced by using the configured number of backend
connections instead, which can be controlled using the
`-o <backend-name>.connections=5` option. Commands will then automatically
scale their parallelism accordingly.

To limit the number of CPU cores used by restic, you can set the environment
variable `GOMAXPROCS` accordingly. For example to use a single CPU core, use
`GOMAXPROCS=1`.

https://github.com/restic/restic/issues/2162
https://github.com/restic/restic/issues/1467
https://github.com/restic/restic/pull/3611
8 changes: 8 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-2248
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: Support `self-update` on Windows

Restic `self-update` would fail in situations where the operating system
locks running binaries, including Windows. The new behavior works around
this by renaming the running file and swapping the updated file in place.

https://github.com/restic/restic/issues/2248
https://github.com/restic/restic/pull/3675
12 changes: 12 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-2291
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Enhancement: Allow pack size customization

Restic now uses a target pack size of 16 MiB by default. This can be customized
using the `--pack-size size` option. Supported pack sizes range between 4 and
128 MiB.

It is possible to migrate an existing repository to _larger_ pack files using
`prune --repack-small`. This will rewrite every pack file which is
significantly smaller than the target size.

https://github.com/restic/restic/issues/2291
https://github.com/restic/restic/pull/3731
14 changes: 14 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-2295
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Enhancement: Allow use of SAS token to authenticate to Azure

Previously restic only supported AccountKeys to authenticate to Azure
storage accounts, which necessitates giving a significant amount of
access.

We added support for Azure SAS tokens which are a more fine-grained
and time-limited manner of granting access. Set the `AZURE_ACCOUNT_NAME`
and `AZURE_ACCOUNT_SAS` environment variables to use a SAS token for
authentication. Note that if `AZURE_ACCOUNT_KEY` is set, it will take
precedence.

https://github.com/restic/restic/issues/2295
https://github.com/restic/restic/pull/3661
13 changes: 13 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-2696
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Enhancement: Improve backup speed with many small files

We have restructured the backup pipeline to continue reading files while all
upload connections are busy. This allows the backup to already prepare the next
data file such that the upload can continue as soon as a connection becomes
available. This can especially improve the backup performance for high latency
backends.

The upload concurrency is now controlled using the `-o <backend-name>.connections=5`
option.

https://github.com/restic/restic/issues/2696
https://github.com/restic/restic/pull/3489
15 changes: 15 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-2907
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Enhancement: Make snapshot directory structure of `mount` command customizable

We've added the possibility to customize the snapshot directory structure of
the `mount` command using templates passed to the `--snapshot-template` option.
The formatting of snapshots' timestamps is now controlled using `--time-template`
and supports subdirectories to for example group snapshots by year. Please
see `restic help mount` for further details.

Characters in tag names which are not allowed in a filename are replaced by
underscores `_`. For example a tag `foo/bar` will result in a directory name
of `foo_bar`.

https://github.com/restic/restic/issues/2907
https://github.com/restic/restic/pull/2913
https://github.com/restic/restic/pull/3691
12 changes: 12 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3114
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Enhancement: Optimize handling of duplicate blobs in `prune`

Restic `prune` always used to repack all data files containing duplicate
blobs. This effectively removed all duplicates during prune. However, as a
consequence all these data files were repacked even if the unused repository
space threshold could be reached with less work.

This is now changed and `prune` works nice and fast even when there are lots
of duplicate blobs.

https://github.com/restic/restic/issues/3114
https://github.com/restic/restic/pull/3290
13 changes: 13 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3295
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Change: Deprecate `check --check-unused` and add further checks

Since restic 0.12.0, it is expected to still have unused blobs after running
`prune`. This made the `--check-unused` option of the `check` command rather
useless and tended to confuse users. This option has been deprecated and is
now ignored.

The `check` command now also warns if a repository is using either the legacy
S3 layout or mixed pack files with both tree and data blobs. The latter is
known to cause performance problems.

https://github.com/restic/restic/issues/3295
https://github.com/restic/restic/pull/3730
14 changes: 14 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3428
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Bugfix: List snapshots in backend at most once to resolve snapshot IDs

Many commands support specifying a list of snapshot IDs which are then used to
determine the snapshots to be processed by the command. To resolve snapshot IDs
or `latest`, and check that these exist, restic previously listed all snapshots
stored in the repository. Depending on the backend this could be a slow and/or
expensive operation.

Restic now lists the snapshots only once and remembers the result in order to
resolve all further snapshot IDs swiftly.

https://github.com/restic/restic/issues/3428
https://github.com/restic/restic/pull/3570
https://github.com/restic/restic/pull/3395
14 changes: 14 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3432
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Bugfix: Fix rare 'not found in repository' error for `copy` command

In rare cases `copy` (and other commands) would report that `LoadTree(...)`
returned an `id [...] not found in repository` error. This could be caused by
a backup or copy command running concurrently. The error was only temporary;
running the failed restic command a second time as a workaround did resolve the
error.

This issue has now been fixed by correcting the order in which restic reads data
from the repository. It is now guaranteed that restic only loads snapshots for
which all necessary data is already available.

https://github.com/restic/restic/issues/3432
https://github.com/restic/restic/pull/3570
10 changes: 10 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3465
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Enhancement: Improve handling of temporary files on Windows

In some cases restic failed to delete temporary files, causing the current
command to fail. This has now been fixed by ensuring that Windows automatically
deletes the file. In addition, temporary files are only written to disk when
necessary, reducing disk writes.

https://github.com/restic/restic/issues/3465
https://github.com/restic/restic/issues/1551
https://github.com/restic/restic/pull/3610
7 changes: 7 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3685
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: The `diff` command incorrectly listed some files as added

There was a bug in the `diff` command, causing it to always show files in a
removed directory as added. This has now been fixed.

https://github.com/restic/restic/issues/3685
https://github.com/restic/restic/pull/3686
13 changes: 13 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3692
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Bugfix: Fix rclone (shimmed by Scoop) and sftp not working on Windows

In #3602 a fix was introduced to address the problem of `rclone` prematurely
exiting when Ctrl+C is pressed on Windows. The solution was to create the
subprocess with its console detached from the restic console.

However, this solution failed when using `rclone` installed by Scoop or using
`sftp` with a passphrase-protected private key. We've now fixed this by using
a different approach to prevent Ctrl-C from passing down too early.

https://github.com/restic/restic/issues/3681
https://github.com/restic/restic/issues/3692
https://github.com/restic/restic/pull/3696
11 changes: 11 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3709
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Enhancement: Validate exclude patterns before backing up

Exclude patterns provided via `--exclude`, `--iexclude`, `--exclude-file` or
`--iexclude-file` previously weren't validated. As a consequence, invalid
patterns resulted in files that were meant to be excluded being backed up.

Restic now validates all patterns before running the backup and aborts with
a fatal error if an invalid pattern is detected.

https://github.com/restic/restic/issues/3709
https://github.com/restic/restic/pull/3734
13 changes: 13 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3720
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Bugfix: Directory sync errors for repositories accessed via SMB

On Linux and macOS, accessing a repository via a SMB/CIFS mount resulted in
restic failing to save the lock file, yielding the following errors:

Save(<lock/071fe833f0>) returned error, retrying after 552.330144ms: sync /repo/locks: no such file or directory
Save(<lock/bf789d7343>) returned error, retrying after 552.330144ms: sync /repo/locks: invalid argument

This has now been fixed by ignoring the relevant error codes.

https://github.com/restic/restic/issues/3720
https://github.com/restic/restic/issues/3751
https://github.com/restic/restic/pull/3752
8 changes: 8 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3736
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bugfix: The `stats` command miscalculated restore size for multiple snapshots

Since restic 0.10.0 the restore size calculated by the `stats` command for
multiple snapshots was too low. The hardlink detection was accidentally applied
across multiple snapshots and thus ignored many files. This has now been fixed.

https://github.com/restic/restic/issues/3736
https://github.com/restic/restic/pull/3740
8 changes: 8 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3837
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Enhancement: Improve SFTP repository initialization over slow links

The `init` command, when used on an SFTP backend, now sends multiple `mkdir`
commands to the backend concurrently. This reduces the waiting times when
creating a repository over a very slow connection.

https://github.com/restic/restic/issues/3837
https://github.com/restic/restic/pull/3840
9 changes: 9 additions & 0 deletions changelog/0.14.0_2022-08-25/issue-3861
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Bugfix: Yield error on invalid policy to `forget`

The `forget` command previously silently ignored invalid/unsupported
units in the duration options, such as e.g. `--keep-within-daily 2w`.

Specifying an invalid/unsupported duration unit now results in an error.

https://github.com/restic/restic/issues/3861
https://github.com/restic/restic/pull/3862
Loading

0 comments on commit fc9ab1a

Please sign in to comment.