Commit Graph

2344 Commits

Author SHA1 Message Date
dependabot[bot]
902ce4ebe0 build(deps): bump google.golang.org/api from 0.82.0 to 0.83.0 (#2033)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.82.0 to 0.83.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.82.0...v0.83.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-11 06:31:33 +00:00
dependabot[bot]
0c2985c6ae build(deps): bump github.com/stretchr/testify from 1.7.1 to 1.7.2 (#2032)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.7.1...v1.7.2)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-11 06:08:03 +00:00
Julio Lopez
c6fba5468c chore(deps): allow at least 2 open PR to reduce HoL blocking (#2031) 2022-06-10 22:29:49 -07:00
Julio Lopez
df3be1c503 chore(deps): update dependabot frequency for Go deps (#2028)
Allow more frequent update while limiting the number of open PRs to 1.
Similarly, for GHA deps.
2022-06-10 22:18:40 -07:00
Julio Lopez
2f9f04a534 build(deps): bump github.com/klauspost/compress from 1.15.5 to 1.15.6 (#2009)
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/compress/compare/v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-11 02:23:08 +00:00
Jarek Kowalski
1ffad15069 chore(ci): upgraded linter to 1.46.2 (#2027) 2022-06-10 05:30:07 +00:00
Jarek Kowalski
bc88a8c705 fix(repository): fixed stress test caused by index leaking file handles (#2026)
Fixed regression caused by #1980

Switching to new mmap library uncovered a bug where we were not properly
closing indices that are no longer in use, since previous mmap had
a finalizer defined to do so.
2022-06-09 15:56:28 +00:00
Jarek Kowalski
4c5a6f4b3b chore(repository): fixed minor logger data race (#2025) 2022-06-09 12:51:16 +00:00
Jarek Kowalski
a2fdbdd717 chore(repository): reduced memory allocations when logging content.ID (#2024)
This fixes regression introduced in #1960.

Tested by backing up Linux 5.14.8 source on M1 Mac (average of 15 runs):

Before: duration=6.7s avg_heap_objects=7411657 avg_heap_bytes=871794888
After: duration=5.6s (17% faster) avg_heap_objects=5947800 (20% less) avg_heap_bytes=795762120 (9% less)
2022-06-09 06:23:45 +00:00
basldfalksjdf
94071072cb docs(site): updated directions for Google Cloud access (#2013)
* Update _index.md

* Update _index.md

* Update _index.md

Added endpoint option when using s3 for gcs connection
2022-06-07 20:56:02 -07:00
basldfalksjdf
cffc2489c0 docs(site): Update _index.md (#2017) 2022-06-07 20:55:39 -07:00
Jarek Kowalski
544dd41e7f fix(snapshots): fixed random deadlock when Uploader results in a failure (#2020)
* fix(snapshots): fixed random deadlock when Uploader results in a failure

The deadlock was caused by not properly waiting for all asynchronous
work to complete before closing the worker pool.

Introduced `workshare.AsyncGroup.Close()` and some assertions.

* fixed select race

* linter fix

* pr feedback
2022-06-07 18:37:08 -07:00
ashmrtn
ef8828a072 refactor(snapshots): Remove remaining internal uses of Readdir (#1986)
* Remove remaining internal uses of Readdir

* Remove old helpers and interface functions.

* Update tests for updated fs.Directory interface

* Fix index out of range error in snapshot walker

Record one error if an error occurred and it's not limiting errors

* Use helper functions more; exit loops early

Follow up on reviewer comments and reduce code duplication, use more
targetted functions like Directory.Child, and exit directory iteration
early if possible.

* Remove fs.Entries type and unused functions

Leave some functions dealing with sorting and finding entries in fs
package. This retains tests for those functions while still allowing
mockfs to access them.

* Simplify function return
2022-06-04 06:36:25 -07:00
Jarek Kowalski
7a3827a8ee refactor(snapshots): disable fine-grained Span creation when tracing is disabled (#2010)
This fixes memory usage increase from #1988
2022-06-04 03:55:46 +00:00
dependabot[bot]
17c520f244 build(deps): bump github.com/aws/aws-sdk-go from 1.44.22 to 1.44.26 (#2002)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.22 to 1.44.26.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.22...v1.44.26)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-03 18:06:21 -07:00
dependabot[bot]
6166ed4d83 build(deps): bump github.com/prometheus/common from 0.32.1 to 0.34.0 (#2006)
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.32.1 to 0.34.0.
- [Release notes](https://github.com/prometheus/common/releases)
- [Commits](https://github.com/prometheus/common/compare/v0.32.1...v0.34.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-03 15:44:17 -07:00
dependabot[bot]
49e5364f50 build(deps): bump google.golang.org/grpc from 1.46.2 to 1.47.0 (#2005)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.46.2 to 1.47.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.46.2...v1.47.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-03 15:25:48 -07:00
dependabot[bot]
ef9913a2b4 build(deps): bump github.com/prometheus/client_golang (#2001)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.1 to 1.12.2.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.12.1...v1.12.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-03 10:47:38 -07:00
dependabot[bot]
7e9ea50286 build(deps-dev): bump concurrently from 7.1.0 to 7.2.1 in /app (#1998)
Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 7.1.0 to 7.2.1.
- [Release notes](https://github.com/open-cli-tools/concurrently/releases)
- [Commits](https://github.com/open-cli-tools/concurrently/compare/v7.1.0...v7.2.1)

---
updated-dependencies:
- dependency-name: concurrently
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-01 22:18:17 -07:00
dependabot[bot]
11677f1a9d build(deps): bump electron-log from 4.4.6 to 4.4.7 in /app (#1997)
Bumps [electron-log](https://github.com/megahertz/electron-log) from 4.4.6 to 4.4.7.
- [Release notes](https://github.com/megahertz/electron-log/releases)
- [Changelog](https://github.com/megahertz/electron-log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/megahertz/electron-log/compare/v4.4.6...v4.4.7)

---
updated-dependencies:
- dependency-name: electron-log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-01 21:36:05 -07:00
dependabot[bot]
b9ed41dbeb build(deps): bump github.com/klauspost/compress from 1.15.2 to 1.15.5 (#2000)
Bumps [github.com/klauspost/compress](https://github.com/klauspost/compress) from 1.15.2 to 1.15.5.
- [Release notes](https://github.com/klauspost/compress/releases)
- [Changelog](https://github.com/klauspost/compress/blob/master/.goreleaser.yml)
- [Commits](https://github.com/klauspost/compress/compare/v1.15.2...v1.15.5)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-01 21:35:56 -07:00
dependabot[bot]
e7532076e4 build(deps): bump github.com/minio/minio-go/v7 from 7.0.24 to 7.0.27 (#2004)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.24 to 7.0.27.
- [Release notes](https://github.com/minio/minio-go/releases)
- [Commits](https://github.com/minio/minio-go/compare/v7.0.24...v7.0.27)

---
updated-dependencies:
- dependency-name: github.com/minio/minio-go/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-01 21:35:45 -07:00
dependabot[bot]
f1493b81ff build(deps): bump google.golang.org/api from 0.81.0 to 0.82.0 (#2003)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.81.0 to 0.82.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.81.0...v0.82.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-01 19:09:29 -07:00
Julio Lopez
65fc11ed58 fix(general): use a fixed time for protecting newly created content (#1994)
* test MinContentAgeSubjectToGC

* lint: move check for whether content is deleted to the caller to reduce gocycle complexity

* nit: add new lines before return

* log GC stats

* fix(maintenance): use a fixed time for protecting newly created content

Previously, the reference time used to determine whether a content had been
recently created would change througout a snapshot GC execution. For
long-running GC tasks, this non-deterministically shrinked the safety window
specified in `MinContentAgeSubjectToGC`.

Now, the snapshot GC starting time is used as a fix refererence for the
safety check.

* remove test entry point to avoid double execution of the test
2022-05-31 20:29:38 -07:00
Julio Lopez
511f4aa65d chore(cli): minor metrics-related cleanups (#1995)
* stop ticker to release resources
* nit: fix typo
* nit: add new line at EOF
2022-05-31 14:04:01 -07:00
Julio Lopez
99fb50118f fix(cli): add retention to JSON output (#1992)
refactor(cli): snapshot list JSON functionality.
Defines SnapshotManifest struct for the snapshot list JSON output.

test(cli): `snapshot list --json`
2022-05-31 13:43:42 -07:00
Jeremy Edwards
9167c08183 chore(ci): restrict GH actions for provider and stress tests to upstream repository. (#1989) 2022-05-29 02:27:04 +00:00
Jarek Kowalski
f5c64c8480 feat(snapshots): streaming upload support (#1963)
* feat(snapshots): switched repofs directory iteration to streaming

* feat(snapshots): switched ignorefs directory iteration to streaming

* feat(snapshots): switched mockfs iteration to streaming

* feat(snapshots): switched uploader to streaming mode

* fixed data race

* inlined foreachEntryUnlessCanceled
2022-05-28 13:20:40 -07:00
Jarek Kowalski
17c74e6386 feat(cli): added open telemetry tracing support (#1988)
New flag `--enable-jaeger-collector` and the corresponding
`KOPIA_ENABLE_JAEGER_COLLECTOR` environment variable enables Jaeger
exporter, which by default sends OTEL traces to Jaeger collector on
http://localhost:14268/api/traces

To change this, use environment variables:

* `OTEL_EXPORTER_JAEGER_ENDPOINT`
* `OTEL_EXPORTER_JAEGER_USER`
* `OTEL_EXPORTER_JAEGER_PASSWORD`

When tracing is disabled, the impact on performance is negligible.

To see this in action:

1. Download latest Jaeger all-in-one from https://www.jaegertracing.io/download/
2. Run `jaeger-all-in-one` binary without any parameters.
3. Run `kopia --enable-jaeger-collector snapshot create ...`
4. Go to http://localhost:16686/search and search for traces
2022-05-28 10:39:00 -07:00
Jarek Kowalski
e8c1cfe142 feat(cli): added flags for pushing kopia metrics (#1983)
When enabled, metrics are pushed to the provided Prometheus Push
Gateway at the start and end of each command and periodically every
few seconds.

```
--metrics-push-addr=http://address:port
--metrics-push-interval=5s
--metrics-push-job=kopia
--metrics-push-grouping=a:b --metrics-push-grouping=c:d
--metrics-push-username=user
--metrics-push-password=pass
```
2022-05-28 07:44:59 -07:00
Jarek Kowalski
680e3f29bb feat(repository): switched to using go-mmap for indexes (#1980)
* feat(repository): switched to using go-mmap for indexes

Previous mmap implementation only allowed io.ReaderAt API
this one allows direct access to the underlying bytes which helps
remove a bunch of buffers, copying and allocation in index parsing.

* let the compiler do bounds check

* removed one more unnecessary allocation

* pr feedback
2022-05-27 03:24:10 +00:00
Jarek Kowalski
bb9c2bf250 feat(snapshots): implemented iteration for local filesystem (#1967)
When combined with #1963, it significantly reduces memory usage.

When backing up Kopia enlistment with various binaries 2.8GB
(files:74180 dirs:12322):

Before: max memory 440MB, time 5.8s
After:  max memory 360MB, time 5.4s
2022-05-26 21:32:16 +00:00
Julio Lopez
6757489a00 build(deps): bump github.com/chromedp/chromedp from 0.8.1 to 0.8.2 (#1979)
Bumps [github.com/chromedp/chromedp](https://github.com/chromedp/chromedp) from 0.8.1 to 0.8.2.
- [Release notes](https://github.com/chromedp/chromedp/releases)
- [Commits](https://github.com/chromedp/chromedp/compare/v0.8.1...v0.8.2)

---
updated-dependencies:
- dependency-name: github.com/chromedp/chromedp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-26 06:44:00 +00:00
Julio Lopez
e9ca80dd27 refactor(cli): deprecate snapshot gc command (#1973)
* refactor(cli): deprecate `snapshot gc` command
* replace `snapshot gc` in tests with `maintenance run`
2022-05-26 05:51:36 +00:00
Julio Lopez
de33f7dc6f refactor(general): acquire maintenance lock before updating schedule (#1976)
Avoids adding an entry to the maintenance schedule for a maintenance
run that may not execute at all.

Also, avoids the potential race of overwriting the schedule of an
already running maintenance task.

nit: rename function to `checkClockSkewBounds`
2022-05-25 21:48:32 -07:00
Julio Lopez
f5f3d5897c refactor(general): increase default BlobDeleteMinAge to 24h (#1978) 2022-05-25 19:41:15 -07:00
Julio Lopez
7938d0cf50 build(deps): bump github.com/aws/aws-sdk-go from 1.44.4 to 1.44.22 (#1977)
* build(deps): bump github.com/aws/aws-sdk-go from 1.44.4 to 1.44.22

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.4 to 1.44.22.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.4...v1.44.22)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* go mod tidy --compat=1.17

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-26 00:58:34 +00:00
Julio Lopez
6f80995047 build(deps): bump google.golang.org/api from 0.77.0 to 0.81.0 (#1974)
* build(deps): bump google.golang.org/api from 0.77.0 to 0.81.0

Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.77.0 to 0.81.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.77.0...v0.81.0)

---
updated-dependencies:
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Upgrade cloud.google.com/go/storage v1.22.1 as well

- go mod tidy

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-25 23:45:05 +00:00
Jarek Kowalski
9bf9cac7fb refactor(repository): ensure we always parse content.ID and object.ID (#1960)
* refactor(repository): ensure we always parse content.ID and object.ID

This changes the types to be incompatible with string to prevent direct
conversion to and from string.

This has the additional benefit of reducing number of memory allocations
and bytes for all IDs.

content.ID went from 2 allocations to 1:
   typical case 32 characters + 16 bytes per-string overhead
   worst-case 65 characters + 16 bytes per-string overhead
   now: 34 bytes

object.ID went from 2 allocations to 1:
   typical case 32 characters + 16 bytes per-string overhead
   worst-case 65 characters + 16 bytes per-string overhead
   now: 36 bytes

* move index.{ID,IDRange} methods to separate files

* replaced index.IDFromHash with content.IDFromHash externally

* minor tweaks and additional tests

* Update repo/content/index/id_test.go

Co-authored-by: Julio Lopez <1953782+julio-lopez@users.noreply.github.com>

* Update repo/content/index/id_test.go

Co-authored-by: Julio Lopez <1953782+julio-lopez@users.noreply.github.com>

* pr feedback

* post-merge fixes

* pr feedback

* pr feedback

* fixed subtle regression in sortedContents()

This was actually not producing invalid results because of how base36
works, just not sorting as efficiently as it could.

Co-authored-by: Julio Lopez <1953782+julio-lopez@users.noreply.github.com>
2022-05-25 14:15:56 +00:00
dependabot[bot]
5f676f05d9 build(deps-dev): bump electron from 18.0.1 to 18.2.0 in /app (#1911)
Bumps [electron](https://github.com/electron/electron) from 18.0.1 to 18.2.0.
- [Release notes](https://github.com/electron/electron/releases)
- [Changelog](https://github.com/electron/electron/blob/main/docs/breaking-changes.md)
- [Commits](https://github.com/electron/electron/compare/v18.0.1...v18.2.0)

---
updated-dependencies:
- dependency-name: electron
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-25 07:15:39 -07:00
dependabot[bot]
717cf9dfd1 build(deps): bump async from 2.6.3 to 2.6.4 in /app (#1954)
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-25 07:15:11 -07:00
Jarek Kowalski
f49bcdd883 feat(cli): implementation for 'kopia snapshot fix' (#1930)
* feat(cli): implementation for 'kopia snapshot fix'

This allows modifications and fixes to the snapshots after they have
been taken.

Supported are:

* `kopia snapshot fix remove-invalid-files [--verify-files-percent=X]`

Removes all directory entries where the underlying files cannot be
read based on index analysis (this does not read the files, only index
structures so is reasonably quick).

`--verify-files-percent=100` can be used to trigger full read for
all files.

* `kopia snapshot fix remove-files --object-id=<object-id>`

Removes the object with a given ID from the entire snapshot tree.
Useful when you accidentally snapshot a sensitive file.

* `kopia snapshot fix remove-files --filename=<wildcard>`

Removes the files with a given name from the entire snapshot tree.
Useful when you accidentally snapshot a sensitive file.

By default all snapshots are analyzed and rewritten. To limit the scope
use:

--source=user@host:/path
--manifest-id=manifestID

By default the rewrite operation writes new directory entries but
does not replace the manifests. To do that pass `--commit`.

Related #1906
Fixes #799

reorganized CLI per PR suggestion

* additional logging for diff command

* added Clone() method to snapshot manifst and directory entry

* added a comprehensive test, moved DirRewriter  to separate file

* pr feedback

* more pr feedback

* improved logging output

* disable test in -race configuration since it's way to slow

* pr feedback
2022-05-25 01:17:55 +00:00
Julio Lopez
e420d74096 refactor(general): minor cleanups in robustness framework (#1971)
- nit: re-group struct fields
- nit: use consts
- nit: remove unnecessary fmt.Errorf(...) usage
- nit: avoid unnecessarily calling defaultActionControls when there is already a value
- robustness: increase readability in actions map declaration
- Prefer named functions over closures for the actions.
- nit fix typo
- nit: simplify robustness Log.StringThisRun
  Iterates only over the tail of the slice, which avoids iterating over the entire slice
2022-05-24 21:15:55 +00:00
Bruno Meneguello
5061a1e72e fix(snapshots): replace hard-coded cmd.exe with COMSPEC env var on Windows (#1969) (#1970)
Fixes #1969
2022-05-23 17:49:13 -07:00
Julio Lopez
3d1de6f27a chore(general): minor cleanups (#1959)
- expand command flag description for clarification
- include blob id in blob get error in the cache
- nit: remove unused BOTO_PATH
- nit: fix comment
- cleanup: remove unnecessary function declaration in interface
- leverage 'testify' to simplify test
2022-05-23 15:16:25 -07:00
Jarek Kowalski
671a400805 feat(cli): added KOPIA_IGNORE_MAINTENANCE_REWRITE_ERROR (#1966)
When environment variable `KOPIA_IGNORE_MAINTENANCE_REWRITE_ERROR` is set, this will ignore rewrite problems for deleted contents because of mising blobs. In case of data corruption this should let maintenance complete and eventually completely drop unused content from the index.

This is not something that regular folks should ever use, except when recovering repository after a data loss after being instructed to do so by Kopia crew.

For #1946
2022-05-22 20:17:01 +00:00
ashmrtn
9f85864da5 feat(snapshots): Add callback-based iteration function to Directory interface (#1957)
* New interface method to iterate over dir entries

* Fix build and test failures from interface

* Fix entry iteration for StaticDirectory

* Make utility function for directory iteration

* Fix lint errors

* No wrapcheck on fs.ReaddirToIterate

* Be consistent for IterateEntry implementations
2022-05-20 18:04:35 -07:00
Jarek Kowalski
99eeb3c063 feat(cli): added CLI for controlling throttler (#1956)
Supported are:

```
$ kopia throttle set \
    --download-bytes-per-second=N | unlimited
    --upload-bytes-per-second=N | unlimited
    --read-requests-per-second=N | unlimited
    --write-requests-per-second=N | unlimited
    --list-requests-per-second=N | unlimited
    --concurrent-reads=N | unlimited
    --concurrent-writes=N | unlimited
```

To change parameters of a running server use:

```
$ kopia server throttle set \
    --address=<server-url> \
    --server-control-password=<password> \
    --download-bytes-per-second=N | unlimited
    --upload-bytes-per-second=N | unlimited
    --read-requests-per-second=N | unlimited
    --write-requests-per-second=N | unlimited
    --list-requests-per-second=N | unlimited
    --concurrent-reads=N | unlimited
    --concurrent-writes=N | unlimited
```
2022-05-18 01:27:06 -07:00
Jarek Kowalski
ebd8f113c6 chore(ci): set golang version explicitly to 1.18 (#1952)
We were unintentionally doing that because ^1.17 was pulling 1.18.x
2022-05-16 11:55:04 -07:00
Jarek Kowalski
a61927e089 chore(infra): added more leak checks to tests (#1953) 2022-05-16 06:37:57 +00:00