From d1e5c1d8a0f46eda868b90f6aa2d06468ab77cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20L=C3=B3pez?= <1953782+julio-lopez@users.noreply.github.com> Date: Thu, 16 Apr 2026 21:41:39 -0700 Subject: [PATCH] chore(general): clean nits (#5313) - make benchmarking params uint - prevent error in compression benchmarking - lint on Windows and address linter warnings - upgrade golang.org/x/exp - upgrade github.com/cncf/xds/go - upgrade github.com/dustinkirkland/golang-petname - direct users to forum - add warning about _recovery recipes_ --- .github/workflows/lint.yml | 3 +++ Makefile | 10 +++++++--- README.md | 15 +++++++-------- cli/command_benchmark.go | 14 ++++++++++++-- cli/command_benchmark_crypto.go | 8 ++++---- cli/command_benchmark_ecc.go | 8 ++++---- cli/command_benchmark_encryption.go | 8 ++++---- cli/command_benchmark_hashing.go | 8 ++++---- cli/command_benchmark_splitters.go | 8 ++++---- fs/localfs/local_fs_windows.go | 1 - go.mod | 6 +++--- go.sum | 12 ++++++------ internal/mount/mount_net_use.go | 2 +- .../filesystem_storage_capacity_windows.go | 2 +- repo/compression/compressor_test.go | 4 ++++ ...committed_content_index_disk_cache_windows.go | 4 ++++ repo/content/index/content_id_to_bytes.go | 2 +- site/content/_index.html | 16 +++++----------- site/content/docs/Advanced/Actions/_index.md | 2 +- site/content/docs/Advanced/Compression/_index.md | 4 ++-- site/content/docs/Advanced/Consistency/_index.md | 4 ++-- site/hugo.toml | 7 +------ .../multiclient_test/framework/client.go | 4 ---- 23 files changed, 80 insertions(+), 72 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b693a0a40..22cbd6d02 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -52,6 +52,9 @@ jobs: sarif_file: govulncheck.sarif - name: Lint run: make lint + - name: Lint Windows + if: ${{ contains(matrix.os, 'ubuntu') }} + run: make lint-windows - name: Check Locks run: make check-locks - name: Prettier diff --git a/Makefile b/Makefile index 0818105b2..ebf9b4e7c 100644 --- a/Makefile +++ b/Makefile @@ -87,13 +87,17 @@ endif lint-and-log: $(linter) $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) | tee .linterr.txt -lint-all: $(linter) +lint-windows: $(linter) GOOS=windows GOARCH=amd64 $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) + +lint-darwin: $(linter) + GOOS=darwin GOARCH=amd64 $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) + GOOS=darwin GOARCH=arm64 $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) + +lint-all: $(linter) lint-windows lint-darwin GOOS=linux GOARCH=amd64 $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) GOOS=linux GOARCH=arm64 $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) GOOS=linux GOARCH=arm $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) - GOOS=darwin GOARCH=amd64 $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) - GOOS=darwin GOARCH=arm64 $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) GOOS=openbsd GOARCH=amd64 $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) GOOS=freebsd GOARCH=amd64 $(linter) --timeout $(LINTER_DEADLINE) run $(linter_flags) diff --git a/README.md b/README.md index a4d09c63f..5222c2029 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ Kopia ![Kopia](icons/kopia.svg) [![Build Status](https://github.com/kopia/kopia/workflows/Build/badge.svg)](https://github.com/kopia/kopia/actions?query=workflow%3ABuild) -[![Slack](https://img.shields.io/badge/discuss-slack-blue.svg)](https://slack.kopia.io/) [![GoDoc](https://godoc.org/github.com/kopia/kopia/repo?status.svg)](https://godoc.org/github.com/kopia/kopia/repo) [![Coverage Status](https://codecov.io/gh/kopia/kopia/branch/master/graph/badge.svg?token=CRK4RMRFSH)](https://codecov.io/gh/kopia/kopia)[![Go Report Card](https://goreportcard.com/badge/github.com/kopia/kopia)](https://goreportcard.com/report/github.com/kopia/kopia) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) @@ -58,22 +57,22 @@ Using Kopia via graphical user interface (note: the video is of an older version Getting Started --- -See [Kopia Documentation](https://kopia.io/docs/) for more information. - -Building Kopia ---- -See [Build Infrastructure](BUILD.md) for more information on building Kopia and working with the source code. +See [Kopia Documentation](https://kopia.io/docs/) for more information. Also check out the [users forum](https://kopia.discourse.group). Licensing --- Kopia is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text. +Building Kopia +--- +See [Build Infrastructure](BUILD.md) for more information on building Kopia and working with the source code. + Contribution Guidelines --- -Kopia is open source and contributions are welcome. For more information on how to contribute see the [Contribution Guidelines](https://kopia.io/docs/contribution-guidelines/). +Kopia is open source. For more information see the [Contribution Guidelines](https://kopia.io/docs/contribution-guidelines/). Reporting Security Issues --- -If you find a security issue you'd like to disclose privately, please contact `security@kopia.io` or via direct message to maintainers on [Slack](https://slack.kopia.io). +If you find a security issue you'd like to disclose privately, please contact `security@kopia.io`. [![Netlify Status](https://api.netlify.com/api/v1/badges/6b5c1fe4-a0da-4e7e-939b-ff1105251985/deploy-status)](https://app.netlify.com/sites/kopia/deploys) diff --git a/cli/command_benchmark.go b/cli/command_benchmark.go index 447926b59..714430d0b 100644 --- a/cli/command_benchmark.go +++ b/cli/command_benchmark.go @@ -31,7 +31,11 @@ type cryptoBenchResult struct { throughput float64 } -func runInParallelNoInputNoResult(n int, run func()) { +func runInParallelNoInputNoResult(n uint, run func()) { + if n == 0 { + return + } + dummyArgs := make([]int, n) runInParallelNoResult(dummyArgs, func(_ int) { @@ -39,7 +43,13 @@ func runInParallelNoInputNoResult(n int, run func()) { }) } -func runInParallelNoInput[T any](n int, run func() T) T { +func runInParallelNoInput[T any](n uint, run func() T) T { + if n == 0 { + var zero T + + return zero + } + dummyArgs := make([]int, n) return runInParallel(dummyArgs, func(_ int) T { diff --git a/cli/command_benchmark_crypto.go b/cli/command_benchmark_crypto.go index dda48ef4d..ddba8dedf 100644 --- a/cli/command_benchmark_crypto.go +++ b/cli/command_benchmark_crypto.go @@ -16,10 +16,10 @@ type commandBenchmarkCrypto struct { blockSize atunits.Base2Bytes - repeat int + repeat uint deprecatedAlgorithms bool optionPrint bool - parallel int + parallel uint out textOutput } @@ -27,9 +27,9 @@ type commandBenchmarkCrypto struct { func (c *commandBenchmarkCrypto) setup(svc appServices, parent commandParent) { cmd := parent.Command("crypto", "Run combined hash and encryption benchmarks") cmd.Flag("block-size", "Size of a block to encrypt").Default("1MB").BytesVar(&c.blockSize) - cmd.Flag("repeat", "Number of repetitions").Default("100").IntVar(&c.repeat) + cmd.Flag("repeat", "Number of repetitions").Default("100").UintVar(&c.repeat) cmd.Flag("deprecated", "Include deprecated algorithms").BoolVar(&c.deprecatedAlgorithms) - cmd.Flag("parallel", "Number of parallel goroutines").Default("1").IntVar(&c.parallel) + cmd.Flag("parallel", "Number of parallel goroutines").Default("1").UintVar(&c.parallel) cmd.Flag("print-options", "Print out options usable for repository creation").BoolVar(&c.optionPrint) cmd.Action(svc.noRepositoryAction(c.run)) c.out.setup(svc) diff --git a/cli/command_benchmark_ecc.go b/cli/command_benchmark_ecc.go index 59e90dc89..addf8b75f 100644 --- a/cli/command_benchmark_ecc.go +++ b/cli/command_benchmark_ecc.go @@ -16,9 +16,9 @@ type commandBenchmarkEcc struct { blockSize atunits.Base2Bytes - repeat int + repeat uint optionPrint bool - parallel int + parallel uint out textOutput } @@ -26,8 +26,8 @@ type commandBenchmarkEcc struct { func (c *commandBenchmarkEcc) setup(svc appServices, parent commandParent) { cmd := parent.Command("ecc", "Run ECC benchmarks") cmd.Flag("block-size", "Size of a block to encrypt").Default("10MB").BytesVar(&c.blockSize) - cmd.Flag("repeat", "Number of repetitions").Default("100").IntVar(&c.repeat) - cmd.Flag("parallel", "Number of parallel goroutines").Default("1").IntVar(&c.parallel) + cmd.Flag("repeat", "Number of repetitions").Default("100").UintVar(&c.repeat) + cmd.Flag("parallel", "Number of parallel goroutines").Default("1").UintVar(&c.parallel) cmd.Flag("print-options", "Print out options usable for repository creation").BoolVar(&c.optionPrint) cmd.Action(svc.noRepositoryAction(c.run)) c.out.setup(svc) diff --git a/cli/command_benchmark_encryption.go b/cli/command_benchmark_encryption.go index aa3362420..9a62dc1e3 100644 --- a/cli/command_benchmark_encryption.go +++ b/cli/command_benchmark_encryption.go @@ -16,10 +16,10 @@ type commandBenchmarkEncryption struct { blockSize atunits.Base2Bytes - repeat int + repeat uint deprecatedAlgorithms bool optionPrint bool - parallel int + parallel uint out textOutput } @@ -27,9 +27,9 @@ type commandBenchmarkEncryption struct { func (c *commandBenchmarkEncryption) setup(svc appServices, parent commandParent) { cmd := parent.Command("encryption", "Run encryption benchmarks") cmd.Flag("block-size", "Size of a block to encrypt").Default("1MB").BytesVar(&c.blockSize) - cmd.Flag("repeat", "Number of repetitions").Default("1000").IntVar(&c.repeat) + cmd.Flag("repeat", "Number of repetitions").Default("1000").UintVar(&c.repeat) cmd.Flag("deprecated", "Include deprecated algorithms").BoolVar(&c.deprecatedAlgorithms) - cmd.Flag("parallel", "Number of parallel goroutines").Default("1").IntVar(&c.parallel) + cmd.Flag("parallel", "Number of parallel goroutines").Default("1").UintVar(&c.parallel) cmd.Flag("print-options", "Print out options usable for repository creation").BoolVar(&c.optionPrint) cmd.Action(svc.noRepositoryAction(c.run)) c.out.setup(svc) diff --git a/cli/command_benchmark_hashing.go b/cli/command_benchmark_hashing.go index 25a311987..36fa79cbc 100644 --- a/cli/command_benchmark_hashing.go +++ b/cli/command_benchmark_hashing.go @@ -15,9 +15,9 @@ type commandBenchmarkHashing struct { blockSize atunits.Base2Bytes - repeat int + repeat uint optionPrint bool - parallel int + parallel uint out textOutput } @@ -25,8 +25,8 @@ type commandBenchmarkHashing struct { func (c *commandBenchmarkHashing) setup(svc appServices, parent commandParent) { cmd := parent.Command("hashing", "Run hashing function benchmarks").Alias("hash") cmd.Flag("block-size", "Size of a block to hash").Default("1MB").BytesVar(&c.blockSize) - cmd.Flag("repeat", "Number of repetitions").Default("100").IntVar(&c.repeat) - cmd.Flag("parallel", "Number of parallel goroutines").Default("1").IntVar(&c.parallel) + cmd.Flag("repeat", "Number of repetitions").Default("100").UintVar(&c.repeat) + cmd.Flag("parallel", "Number of parallel goroutines").Default("1").UintVar(&c.parallel) cmd.Flag("print-options", "Print out options usable for repository creation").BoolVar(&c.optionPrint) cmd.Action(svc.noRepositoryAction(c.run)) c.out.setup(svc) diff --git a/cli/command_benchmark_splitters.go b/cli/command_benchmark_splitters.go index f2fdb0df4..be75dfa06 100644 --- a/cli/command_benchmark_splitters.go +++ b/cli/command_benchmark_splitters.go @@ -19,9 +19,9 @@ type commandBenchmarkSplitters struct { randSeed int64 blockSize atunits.Base2Bytes - blockCount int + blockCount uint printOption bool - parallel int + parallel uint out textOutput } @@ -31,9 +31,9 @@ func (c *commandBenchmarkSplitters) setup(svc appServices, parent commandParent) cmd.Flag("rand-seed", "Random seed").Default("42").Int64Var(&c.randSeed) cmd.Flag("data-size", "Size of a data to split").Default("32MB").BytesVar(&c.blockSize) - cmd.Flag("block-count", "Number of data blocks to split").Default("16").IntVar(&c.blockCount) + cmd.Flag("block-count", "Number of data blocks to split").Default("16").UintVar(&c.blockCount) cmd.Flag("print-options", "Print out the fastest dynamic splitter option").BoolVar(&c.printOption) - cmd.Flag("parallel", "Number of parallel goroutines").Default("1").IntVar(&c.parallel) + cmd.Flag("parallel", "Number of parallel goroutines").Default("1").UintVar(&c.parallel) cmd.Action(svc.noRepositoryAction(c.run)) diff --git a/fs/localfs/local_fs_windows.go b/fs/localfs/local_fs_windows.go index 742aafc37..6a20b813f 100644 --- a/fs/localfs/local_fs_windows.go +++ b/fs/localfs/local_fs_windows.go @@ -25,7 +25,6 @@ func trailingSeparator(fsd *filesystemDirectory) string { fsd.prefix == `\\?\GLOBALROOT\Device\` && strings.HasPrefix(fsd.Name(), "HarddiskVolumeShadowCopy") && !strings.HasSuffix(fsd.Name(), separatorStr) { - return separatorStr } diff --git a/go.mod b/go.mod index a5e2dbeb2..562d64784 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/chromedp/cdproto v0.0.0-20250724212937-08a3db8b4327 github.com/chromedp/chromedp v0.14.2 github.com/coreos/go-systemd/v22 v22.7.0 - github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0 + github.com/dustinkirkland/golang-petname v0.0.0-20260215035315-f0c533e9ce9b github.com/edsrzf/mmap-go v1.2.0 github.com/fatih/color v1.19.0 github.com/foomo/htpasswd v0.0.0-20200116085101-e3a90e78da9c @@ -57,7 +57,7 @@ require ( go.opentelemetry.io/otel/trace v1.43.0 go.uber.org/zap v1.27.1 golang.org/x/crypto v0.50.0 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 + golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f golang.org/x/mod v0.35.0 golang.org/x/net v0.53.0 golang.org/x/oauth2 v0.36.0 @@ -90,7 +90,7 @@ require ( github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chromedp/sysutil v1.1.0 // indirect - github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 // indirect + github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect github.com/danieljoos/wincred v1.2.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect diff --git a/go.sum b/go.sum index fe37e164b..bcf4b4be9 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,8 @@ github.com/chromedp/sysutil v1.1.0/go.mod h1:WiThHUdltqCNKGc4gaU50XgYjwjYIhKWoHG github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/Tv1FZd4SCg8axKApyNyRsAt/w= -github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI= +github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 h1:aBangftG7EVZoUb69Os8IaYg++6uMOdKK83QtkkvJik= +github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA= github.com/coreos/go-systemd/v22 v22.7.0/go.mod h1:xNUYtjHu2EDXbsxz1i41wouACIwT7Ybq9o0BQhMwD0w= github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMFLdQ= @@ -81,8 +81,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0 h1:90Ly+6UfUypEF6vvvW5rQIv9opIL8CbmW9FT20LDQoY= -github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0/go.mod h1:V+Qd57rJe8gd4eiGzZyg4h54VLHmYVVw54iMnlAMrF8= +github.com/dustinkirkland/golang-petname v0.0.0-20260215035315-f0c533e9ce9b h1:qZ21OofI7zneC9dOEqul4FmIWz/YjJJMrf6fL7jrFYQ= +github.com/dustinkirkland/golang-petname v0.0.0-20260215035315-f0c533e9ce9b/go.mod h1:8AuBTZBRSFqEYBPYULd+NN474/zZBLP+6WeT5S9xlAc= github.com/edsrzf/mmap-go v1.2.0 h1:hXLYlkbaPzt1SaQk+anYwKSRNhufIDCchSPkUD6dD84= github.com/edsrzf/mmap-go v1.2.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= github.com/envoyproxy/go-control-plane v0.14.0 h1:hbG2kr4RuFj222B6+7T83thSPqLjwBIfQawTkC++2HA= @@ -311,8 +311,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM= +golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80= golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= diff --git a/internal/mount/mount_net_use.go b/internal/mount/mount_net_use.go index b5987d94b..20f8c74f4 100644 --- a/internal/mount/mount_net_use.go +++ b/internal/mount/mount_net_use.go @@ -61,7 +61,7 @@ func netUseMount(ctx context.Context, driveLetter, webdavURL string) (string, er // colon. s := bufio.NewScanner(strings.NewReader(out)) for s.Scan() { - for _, word := range strings.Split(s.Text(), " ") { + for word := range strings.SplitSeq(s.Text(), " ") { if isWindowsDrive(word) { return word, nil } diff --git a/repo/blob/filesystem/filesystem_storage_capacity_windows.go b/repo/blob/filesystem/filesystem_storage_capacity_windows.go index 4780befc4..9446ff7d9 100644 --- a/repo/blob/filesystem/filesystem_storage_capacity_windows.go +++ b/repo/blob/filesystem/filesystem_storage_capacity_windows.go @@ -11,7 +11,7 @@ "github.com/kopia/kopia/repo/blob" ) -func (fs *fsStorage) GetCapacity(ctx context.Context) (blob.Capacity, error) { +func (fs *fsStorage) GetCapacity(_ context.Context) (blob.Capacity, error) { var c blob.Capacity pathPtr, err := windows.UTF16PtrFromString(fs.RootPath) diff --git a/repo/compression/compressor_test.go b/repo/compression/compressor_test.go index a0d75c8f0..a68d277a9 100644 --- a/repo/compression/compressor_test.go +++ b/repo/compression/compressor_test.go @@ -99,6 +99,10 @@ func BenchmarkCompressor(b *testing.B) { var sortedNames []Name for id := range ByName { + if !IsSupported(id) { + continue + } + sortedNames = append(sortedNames, id) } diff --git a/repo/content/committed_content_index_disk_cache_windows.go b/repo/content/committed_content_index_disk_cache_windows.go index 4815dc677..a23489032 100644 --- a/repo/content/committed_content_index_disk_cache_windows.go +++ b/repo/content/committed_content_index_disk_cache_windows.go @@ -31,9 +31,11 @@ func (c *diskCommittedContentIndexCache) mmapFile(ctx context.Context, filename retryCount := 0 for err != nil && retryCount < maxRetries { retryCount++ + contentlog.Log2(ctx, c.log, "retry unable to mmap.Open()", logparam.Int("retryCount", retryCount), logparam.Error("err", err)) + time.Sleep(nextDelay) nextDelay *= 2 @@ -54,9 +56,11 @@ func (c *diskCommittedContentIndexCache) mmapFile(ctx context.Context, filename if err2 := mm.Unmap(); err2 != nil { return errors.Wrapf(err2, "error unmapping index %v", filename) } + if err2 := f.Close(); err2 != nil { return errors.Wrapf(err2, "error closing index %v", filename) } + return nil }, nil } diff --git a/repo/content/index/content_id_to_bytes.go b/repo/content/index/content_id_to_bytes.go index f78874938..b8add3822 100644 --- a/repo/content/index/content_id_to_bytes.go +++ b/repo/content/index/content_id_to_bytes.go @@ -11,7 +11,7 @@ func bytesToContentID(b []byte) ID { } if len(b) > maxIDLength+1 { - panic(fmt.Sprintln("Content ID byte slice is longer than the maximum supported ID:", len(b))) + panic(fmt.Sprintf("Content ID byte slice is longer than the maximum supported ID: %d", len(b))) } var id ID diff --git a/site/content/_index.html b/site/content/_index.html index b1edb381d..873787c52 100644 --- a/site/content/_index.html +++ b/site/content/_index.html @@ -13,13 +13,10 @@ linkTitle = "Kopia" Download -
- User Support Forum - - - Developer Discussion + User Forum +

Encrypted, Compressed, and Deduplicated Backups Using the Cloud Storage You Pick.

Supports GUI and CLI on Windows, macOS and Linux.

@@ -52,14 +49,11 @@ View a recorded demo of Kopia using Google Cloud Storage with pluggable encrypti With a secure and scalable architecture, **Kopia** can back up everything from small laptops to large servers. {{% /blocks/feature %}} - -{{% blocks/feature icon="fab fa-github" title="Contributions Welcome!" url="https://github.com/kopia/kopia/blob/master/GOVERNANCE.md" %}} -We use a [Pull Request](https://github.com/kopia/kopia/pulls) contributions workflow on GitHub. New contributors and bug reports are always welcome! +{{% blocks/feature icon="fas fa-comments" title="Join The Conversation" %}} +Join the [user forum](https://kopia.discourse.group) to get started with using **Kopia**, discuss features and issues. {{% /blocks/feature %}} - -{{% blocks/feature icon="fab fa-slack" title="Join The Conversation" %}} -Find us on [Slack](https://slack.kopia.io) to get started with using **Kopia**, discuss features and issues, meet the team, and more. +{{% blocks/feature icon="fab fa-github" title="Contributing" url="https://github.com/kopia/kopia/blob/master/GOVERNANCE.md" %}} {{% /blocks/feature %}} diff --git a/site/content/docs/Advanced/Actions/_index.md b/site/content/docs/Advanced/Actions/_index.md index e1d580f9b..80cdb227b 100644 --- a/site/content/docs/Advanced/Actions/_index.md +++ b/site/content/docs/Advanced/Actions/_index.md @@ -253,7 +253,7 @@ kopia policy set --after-folder-action "powershell -WindowStyle Hi Those are just some initial ideas, we're certain more interesting types of actions will be developed using this mechanism, including LVM snapshots, BTRFS Snapshots, notifications and more. -If you have ideas for extending this mechanism, definitely [file an Issue on Github](https://github.com/kopia/kopia/issues). +If you have ideas for extending this mechanism, please [file an Issue on Github](https://github.com/kopia/kopia/issues). If you develop a useful action script that you'd like to share with the community, we encourage you to do so by sending us a pull request to add to this web page or you can put them in your own repository and we'll be happy to link it from here. diff --git a/site/content/docs/Advanced/Compression/_index.md b/site/content/docs/Advanced/Compression/_index.md index a5e4dd14b..d3f998aae 100644 --- a/site/content/docs/Advanced/Compression/_index.md +++ b/site/content/docs/Advanced/Compression/_index.md @@ -80,13 +80,13 @@ Repeating 100 times per compression method (total 12.5 MiB). 16. zstd-best-compression 25.1 KiB 19.3 MiB/s 882 99.3 MiB ``` -While s2 uses significantly less memory in this case, pgzip's numbers seem indifferent to the input size. [Turns out](https://github.com/klauspost/pgzip/issues/44), pgzip has different memory usage logic. It would quickly allocate necessary memory and plateau, which s2 is more on a linear fashion. Here is rough graph is demonstrate the difference: +While s2 uses significantly less memory in this case, pgzip's numbers seem indifferent to the input size. [Turns out](https://github.com/klauspost/pgzip/issues/44), pgzip has different memory usage logic. It would quickly allocate necessary memory and plateau, which s2 exhibits more of a linear growth. The graph below illustrates the difference. ![s2 vs pgzip](s2_vs_pgzip.svg) Therefore, if your backup target is small, and memory is extremely restricted, s2 might be necessary. Otherwise, all algorithms are valid candidates. - Note: Newer Kopia versions no longer support reading contents that were compressed with the deprecated LZ4 algorithm. If your repository contains data written with LZ4, you must migrate it first using a Kopia version that still supports LZ4—for example by restoring the affected snapshots and/or repacking the repository with one of the currently supported compression algorithms—before upgrading. +Note: Newer Kopia versions no longer support reading contents that were compressed with the deprecated LZ4 algorithm. If your repository contains data written with LZ4, you must migrate it first using a Kopia version that still supports LZ4—for example by restoring the affected snapshots and/or repacking the repository with one of the currently supported compression algorithms—before upgrading. ### Minimum file size and extensions to compress diff --git a/site/content/docs/Advanced/Consistency/_index.md b/site/content/docs/Advanced/Consistency/_index.md index 8e8c547fd..60c6a4750 100644 --- a/site/content/docs/Advanced/Consistency/_index.md +++ b/site/content/docs/Advanced/Consistency/_index.md @@ -52,6 +52,6 @@ There are few tips to try, which are generally safe to try: 4. If a repository can’t be opened but was working recently and maintenance has not run yet, it may be helpful to try to remove (or stash away) the most recently-written index files whose names start with `x` in the reverse timestamp order one by one until the issue is fixed. This will effectively roll back the repository writes to a prior state. Exercise caution when removing the files. -5. If the steps above do not help, report your issue on https://kopia.discourse.group or https://slack.kopia.io. Kopia has many low-level data recovery tools, but they should not be used by end users without guidance from developers. +5. If the steps above do not help, report your issue on https://kopia.discourse.group. -> NOTE: Since all data corruption cases are unique, it’s generally not recommended to attempt fixes recommended to other users even for possibly similar issues, since the particular fix method may not be applicable. +> NOTE: While Kopia has many low-level data recovery tools, it’s generally not recommended to attempt fixes recommended to other users even for possibly similar issues, since all data corruption cases are unique and the particular fix method may not be applicable. Following those methods may damage the repository further and make the data completely unrecoverable. diff --git a/site/hugo.toml b/site/hugo.toml index 187aaeeb5..15932a095 100644 --- a/site/hugo.toml +++ b/site/hugo.toml @@ -117,16 +117,11 @@ no = 'Sorry to hear that. Please