Commit Graph

3660 Commits

Author SHA1 Message Date
Jarek Kowalski
5642a8a521 refactor: extracted complete blob set functions to separate package (#1175)
* refactor: extracted complete blob set functions to separate package

* completeset: added more functions

Also treat malformed blob IDs as their own sets for backwards compat.
2021-07-05 17:08:40 -07:00
dependabot[bot]
a917027544 build(deps): bump postcss from 8.2.15 to 8.3.5 in /htmlui (#1162)
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.15 to 8.3.5.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.2.15...8.3.5)

---
updated-dependencies:
- dependency-name: postcss
  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>
2021-07-03 19:09:49 -07:00
dependabot[bot]
4713148972 build(deps): bump github.com/google/go-cmp from 0.5.5 to 0.5.6 (#1123)
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.5...v0.5.6)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  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>
2021-07-03 19:09:12 -07:00
dependabot[bot]
7ac0cb3140 build(deps): bump google.golang.org/api from 0.46.0 to 0.48.0 (#1125)
Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.46.0 to 0.48.0.
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/master/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.46.0...v0.48.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>
2021-07-03 19:08:32 -07:00
dependabot[bot]
6d192fa929 build(deps): bump github.com/aws/aws-sdk-go from 1.38.41 to 1.38.69 (#1159)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.41 to 1.38.69.
- [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.38.41...v1.38.69)

---
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>
2021-07-03 19:08:12 -07:00
dependabot[bot]
9ceb302c96 build(deps): bump @testing-library/jest-dom in /htmlui (#1164)
Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.12.0 to 5.14.1.
- [Release notes](https://github.com/testing-library/jest-dom/releases)
- [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/jest-dom/compare/v5.12.0...v5.14.1)

---
updated-dependencies:
- dependency-name: "@testing-library/jest-dom"
  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>
2021-07-03 19:07:44 -07:00
Jarek Kowalski
e64d5b8eab Fixed few subtle threading bugs uncovered by stress test and rewrote the test to be model-based (#1157)
* testing: refactored logs directory management

* content: fixed index mutex to be shared across all write sessions

added mutex protection during writecontent/refresh race

* testing: upload log artifacts

* content: bump revision number after index has been added

This fixes a bug where manifest manager in another session for
the same open repository may not see a content added, because they
will prematurely cache the incomplete set of contents.

This took 2 weeks to find.

* manifest: improved log output, fixed unnecessary mutex release

* testing: rewrote stress test to be model-based and more precise
2021-07-01 21:37:27 -07:00
Steve Joachim
d73e0d60ce robustness: reduce memory consumption (#1155)
Detailed changes:
* Implement Kopia API client
* Implement kopia client
* Implement new persister
* Separate storeLoad and Delete concurrency tests
* Update Store interface to return error for Delete
* Return errors from os.RemoveAll
* Robustness test updates
* Push robustness metadata without writing to fs
* Fix testenv.AssertNoError references
* Update tests to use new kopia persister
* Minor updates to multiclient test cases
* Use require.NoError instead of assertNoError
* Add context to store interface
* Update logging to be less verbose
* Use io instead of ioutil package
* Simplify restore by using object ID
* Accommodate repository.NewWriter signature change
* Improve tests to increase code coverage
* Spelling and error string fixes
* Address lint errors

Co-authored-by: Nick <nick@kasten.io>
2021-06-30 13:46:51 -07:00
Robert Kroeger
474ef1c9bf Multiplaces (#1154)
* Multiple placeholder expansion

It's inconvenient to only be able to expand a single placeholder file
at a time. Add support to the restore command to expand any number of
shallow placeholder arguments.

* Add placeholder looping

Loop over placeholder targets to expand from within the restore
command.

* Added multiple placeholder expansion test

Added a test to exercise the new code capable of expanding multiple
placeholder arguments to the restore command.
2021-06-27 16:24:21 -07:00
Jarek Kowalski
d6d97deba9 content: re-added missing lock accidentally removed by #1138 (#1156)
This fixes race condition between index compaction and index refresh
which was causing recent test flakes. This is not likely to happen in
real world as compaction is super rare but test was triggering it very
frequentl.

I was able to reliably repro this with a nearly complete rewrite
of a stress test (coming in separate PR). Without the fix it would fail
in 1-3 attempts, with the fix it succeeded 100 attempts of the new
stress test.

Also improved logging and fixed old terminology leftovers.
2021-06-24 09:17:39 -07:00
Jarek Kowalski
85cfbb1afd cli: added 'kopia repo set-parameters' to override mutable parameters (#1148) 2021-06-19 18:47:13 -07:00
Jarek Kowalski
0756dee6d5 More epoch manager work (#1147)
* content: added packIndexBuilder sharding

* epoch manager improvements
2021-06-19 16:48:45 -07:00
Jarek Kowalski
9e059a1277 upgraded linter to 1.41.0 (#1144) 2021-06-16 19:44:55 -07:00
Stuart Hickinbottom
5b04a1c471 Added documentation with storage tier advice (#1143)
Based on Jarek Kowalski's fine advice in the Slack channel.
2021-06-16 13:55:22 -07:00
Jarek Kowalski
8b0296cdf2 Misc index blob manager refactorings (#1138)
* content: extracted encryptedBlobMgr component

* content: renamed files

* content: refactored ParseIndexBlob

* epoch: adjusted API to return blob.Metadata

* content: removed IndexBlobReader interface

* content: cleaned up indexBlobManager API
2021-06-13 18:52:49 -07:00
Jarek Kowalski
ede09c1585 listcache: added missing FlushCaches() method which fixed test flakes 2021-06-13 08:30:25 -07:00
Jarek Kowalski
6277fa27c9 content: refactored own writes cache and list cache into blob.Storage wrappers (#1133)
added blob.Storage.FlushCaches method.
2021-06-12 19:22:25 -07:00
Chetan Goti
e37822957a site: fix privacy policy link in footer (#1132) 2021-06-12 06:53:49 -07:00
Jarek Kowalski
17ba77f57f Index manager refactor (#1131)
* content: cleaned up and refactored indexBlobManager api, no code movement

* content: refactored indexBlobManagerImpl - code move only
2021-06-11 19:05:33 -07:00
Peter Palotas
42c59cb65b Fixed bug in pattern matching for patterns containing a star. (#1129)
Fixes #961
2021-06-11 18:58:25 -07:00
Jarek Kowalski
7735fcc525 epoch: added epoch manager + unit tests (#1128) 2021-06-11 18:57:21 -07:00
Jarek Kowalski
46a6cc3f24 blob: minor improvements + test coverage (#1127)
* blob: additional utility functions and test coverage

* testing: made faulty storage less noisy
2021-06-10 18:35:00 -07:00
Robert Kroeger
93979818e6 Add a flag to not shallowrestore small files (#1126)
When doing a shallow restore, small files might take up less size than
storing the DirectoryEntry metadata. Add a minimum file size flag that
where files below that size will be written directly instead being
represented with shallow placeholders. This improves on #710.
2021-06-09 20:31:07 -07:00
Robert Kroeger
6fc3bf1af6 Support for shallow restore (#725) 2021-06-08 20:11:43 -07:00
Jarek Kowalski
b7c8463075 cli: 'kopia content verify' performance improvements (#1120)
* content: reduce cache lock scope and improve sharding for metadata cache

* cli: improved 'content verify' progress reporting

* cli: ensure we stop estimation goroutine before we return from content verify
2021-06-06 14:13:31 -07:00
Jarek Kowalski
c6accb858c Misc small and trivial changes (#1119)
* trivial: refactored indexBlobManager interface

* testlogging: added NewLogger()

* blob: added helper to extract blob IDs

* content: added packIndexBuilder.BuildStable()

This uncovered a bug where we were failing to return the name of
last pack object ID in an index file. Because of padding this was never
possible, but with stable indexes will. Fixed that.
2021-06-05 21:38:15 -07:00
Jarek Kowalski
53589d9efc content: fixed minor data race 2021-06-05 20:19:23 -07:00
Jarek Kowalski
6b646f7e9d Content manager cleanups (#1118)
* nit: dead code cleanup

* content: cleaned up committedContextIndex usage, removed unused code

* content: moved fetching index blobs into committedContentIndex
2021-06-05 13:34:20 -07:00
dependabot[bot]
f094b97628 build(deps-dev): bump concurrently from 6.1.0 to 6.2.0 in /app (#1108)
Bumps [concurrently](https://github.com/kimmobrunfeldt/concurrently) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/kimmobrunfeldt/concurrently/releases)
- [Commits](https://github.com/kimmobrunfeldt/concurrently/compare/v6.1.0...v6.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-05 10:41:22 -07:00
dependabot[bot]
c01e732397 build(deps): bump github.com/fatih/color from 1.11.0 to 1.12.0 (#1103)
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.11.0...v1.12.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-05 10:41:06 -07:00
Jarek Kowalski
87f1f5281c cli: added tests for benchmark subcommands 2021-06-05 09:03:49 -07:00
Jarek Kowalski
d84c884321 Added content manager internal logging (#1116)
* logging: added logger wrappers for Broadcast and Prefix

* nit: moved max hash size to a named constant

* content: added internal logger

* content: replaced context-based logging with explicit Loggers

This will capture the logger.Logger associated with the context when
the repository is opened and will reuse it for all logs instead of
creating new logger for each log message.

The new logger will also write logs to the internal logger in addition
to writing to a log file/console.

* cli: allow decrypting all blobs whose names start with _

* maintenance: added logs cleanup

* cli: commands to view logs

* cli: log selected command on each write session
2021-06-05 08:48:43 -07:00
Jarek Kowalski
4b251bdaac mechanical: added ctx parameter to repo.{Direct}WriteSession callback (#1114) 2021-06-02 23:12:30 -07:00
Jarek Kowalski
f5eb12e8b7 content: introduced content.Crypter (#1112) 2021-06-01 20:12:34 -07:00
Jarek Kowalski
3a15f666f4 webdav: disable server-side compression (#1100)
Fixes #1098
2021-05-28 19:36:09 -07:00
Jarek Kowalski
6811f1fae1 cli: optimized 'kopia index recover' by leveraging partial read and parallelism (#1094) 2021-05-23 22:18:31 -07:00
Jarek Kowalski
e15a79474c azure: added support for using SAS Tokens instead of storage keys (#1093)
Fixes #1071
2021-05-22 12:43:55 -07:00
Jarek Kowalski
76490dc361 sftp: ensure key file and known hosts are absolute paths (#1092)
Fixes #1089
2021-05-22 11:17:22 -07:00
Jarek Kowalski
40510c043d Support for content-level compression (#1076)
* cli: added a flag to create repository with v2 index features

* content: plumb through compression.ID parameter to content.Manager.WriteContent()

* content: expose content.Manager.SupportsContentCompression

This allows object manager to decide whether to create compressed object
or let the content manager do it.

* object: if compression is requested and the repo supports it, pass compression ID to the content manager

* cli: show compression status in 'repository status'

* cli: output compression information in 'content list' and 'content stats'

* content: compression and decompression support

* content: unit tests for compression

* object: compression tests

* testing: added integration tests against v2 index

* testing: run all e2e tests with and without content-level compression

* htmlui: added UI for specifying index format on creation

* cli: additional tests for 'content ls' and 'content stats'

* applied pr suggestions
2021-05-22 05:35:27 -07:00
Jarek Kowalski
99b7a6e5d2 unrelated cleanups from PR #1076 (#1091)
* cli: fixed progress estimate for 'snapshot verify'

* content: prevent multiple close of shared content manager

* content: test cleanup
2021-05-21 23:59:14 -07:00
Steve Joachim
ba5eb74151 robustness: use testing.T for parallel robustness tests (#1051)
Use testing.T for parallel robustness tests
Elide t.Helper() to improve test output
2021-05-18 21:22:32 -07:00
Jarek Kowalski
57c3ba51ac testing: exclude additional test-only packages from code coverage 2021-05-18 20:27:51 -07:00
Julio Lopez
b5db8b09ca trivial: fix typo 2021-05-18 15:51:46 -07:00
Jarek Kowalski
2faed2bcf6 sftp: run tests as part of unit tests (#1086) 2021-05-18 09:22:26 -07:00
Jarek Kowalski
227b2f1bbc ci: change codecov thresholds (#1085) 2021-05-18 08:59:36 -07:00
Jarek Kowalski
5179ad2cd2 cli: test + misc improvements (#1083)
* cli: Added --max-examples-per-bucket flag to 'kopia snapshot estimate'

Added and cleaned up a bunch of unit tests.

Fixes #1054

* cli: misc tests to increase code coverage of the cli package

* ci: move code coverage run into separate GH job
2021-05-17 21:47:11 -07:00
dependabot[bot]
19ad8082e1 build(deps): bump google.golang.org/grpc from 1.37.0 to 1.37.1 (#1080)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.37.0 to 1.37.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.37.0...v1.37.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 21:13:03 -07:00
dependabot[bot]
488ab9406e build(deps): bump github.com/aws/aws-sdk-go from 1.38.36 to 1.38.41 (#1084)
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.36 to 1.38.41.
- [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.38.36...v1.38.41)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 21:12:43 -07:00
dependabot[bot]
5ed3a3ac00 build(deps): bump gocloud.dev from 0.22.0 to 0.23.0 (#1082)
Bumps [gocloud.dev](https://github.com/google/go-cloud) from 0.22.0 to 0.23.0.
- [Release notes](https://github.com/google/go-cloud/releases)
- [Commits](https://github.com/google/go-cloud/compare/v0.22.0...v0.23.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 19:43:56 -07:00
dependabot[bot]
a699cc4d81 build(deps): bump github.com/fatih/color from 1.10.0 to 1.11.0 (#1079)
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.10.0 to 1.11.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.10.0...v1.11.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-17 19:43:16 -07:00