From d00e72fed4812b5d6866dcff09e07f3fcfca7a94 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 22 Oct 2023 20:24:02 +0200 Subject: [PATCH 1/2] Update klauspost/compress to fix data corruption at maximum compression --- changelog/unreleased/issue-4523 | 17 +++++++++++++++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 changelog/unreleased/issue-4523 diff --git a/changelog/unreleased/issue-4523 b/changelog/unreleased/issue-4523 new file mode 100644 index 000000000..3dd4a536f --- /dev/null +++ b/changelog/unreleased/issue-4523 @@ -0,0 +1,17 @@ +Bugfix: Update zstd library to fix possible data corruption at max. compression + +In restic 0.16.0, backups using maximum compression could result in data +corruption due to a bug in the library used for compressing data. Please note +that the "auto" compression level (used by default) is not affected! + +To check a repository for data corruption, run `restic check --read-data`. This +will download and verify the whole repository. If the `check` command detects +data corruption, follow the suggested steps. To simplify the repository repair +and minimize data loss, we've also added an experimental `repair packs` command +that salvages all valid data from the affected pack files. + +Restic now uses the latest version of the library used to compress data, which +includes a fix for the data corruption issue. + +https://github.com/restic/restic/issues/4523 +https://github.com/restic/restic/pull/4530 diff --git a/go.mod b/go.mod index ca110f148..e2b859421 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/go-ole/go-ole v1.3.0 github.com/google/go-cmp v0.5.9 github.com/hashicorp/golang-lru/v2 v2.0.7 - github.com/klauspost/compress v1.16.7 + github.com/klauspost/compress v1.17.2 github.com/minio/minio-go/v7 v7.0.61 github.com/minio/sha256-simd v1.0.1 github.com/ncw/swift/v2 v2.0.2 diff --git a/go.sum b/go.sum index 2fc29bce1..195fa5d0f 100644 --- a/go.sum +++ b/go.sum @@ -122,8 +122,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= From efef38d0e8aacd7f65c15dd30bcbd4e48fbfde62 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 22 Oct 2023 20:31:02 +0200 Subject: [PATCH 2/2] drop support for Go 1.18 --- .github/workflows/tests.yml | 5 ----- changelog/unreleased/pull-4532 | 6 ++++++ go.mod | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 changelog/unreleased/pull-4532 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 73f42d939..e81aefdb5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,11 +54,6 @@ jobs: os: ubuntu-latest test_fuse: true - - job_name: Linux - go: 1.18.x - os: ubuntu-latest - test_fuse: true - name: ${{ matrix.job_name }} Go ${{ matrix.go }} runs-on: ${{ matrix.os }} diff --git a/changelog/unreleased/pull-4532 b/changelog/unreleased/pull-4532 new file mode 100644 index 000000000..d56c03415 --- /dev/null +++ b/changelog/unreleased/pull-4532 @@ -0,0 +1,6 @@ +Change: Require Go 1.19 or newer + +Since some libraries require newer library features, support for Go 1.18 has +been dropped, which means that restic now requires at least Go 1.19 to build. + +https://github.com/restic/restic/pull/4532 diff --git a/go.mod b/go.mod index e2b859421..08f51d7a7 100644 --- a/go.mod +++ b/go.mod @@ -79,4 +79,4 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -go 1.18 +go 1.19