Commit Graph

1337 Commits

Author SHA1 Message Date
Jarek Kowalski
bc0df1e58e app: removed extra 'v' from KopiaUI window captions 2020-07-31 22:35:20 -07:00
Jarek Kowalski
40acf238f3 Fixed arm and arm64 build. (#506)
* fixed a number of cases where misaligned data was causing panics on armv7 (but not armv8)
* travis: enable arm64
* test: reduce compressed data sizes when running on arm
* arm: wait longer for snapshots
v0.6.0-rc2
2020-07-30 17:31:28 -07:00
Jarek Kowalski
cfa30f2e45 switched back to using v-prefixed tag names.
KOPIA_VERSION will now always be v-prefixed and we will strip the
prefix before embedding it in KopiaUI manifest.

Also upgraded Node and app NPM dependencies to latest versions.
v0.6.0-rc1
2020-07-25 17:22:35 -07:00
Jarek Kowalski
ff244b54ff go.mod: upgrade github.com/klauspost/compress to v1.10.10
See https://github.com/klauspost/compress/issues/272#issuecomment-663567344

Fixes #490.
2020-07-24 08:23:16 -07:00
Jarek Kowalski
8ead49b779 restore: support for zip, tar and tar.gz restore outputs (#482)
* restore: support for zip, tar and tar.gz restore outputs

Moved restore functionality to its own package.

* Fix enum values in the 'mode' flag

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-07-22 22:56:11 -07:00
Jarek Kowalski
52e763158b kopia-ui: fixed missing 'log' when clicking 'Launch At Startup' 2020-07-21 22:12:52 -07:00
Jarek Kowalski
7e9ce61f9e server: automatically flush the repository after setting or deleting a policy (#489)
Fixes #479
2020-07-20 20:59:21 -07:00
Jarek Kowalski
a544e0c32b kopia-ui: Added logging when waiting for notarization response from Apple.
Fixed #488
2020-07-18 15:49:15 -07:00
Jarek Kowalski
2c21582ef2 kopia-ui: added option to disable TLS and force HTTP
Fixes #476
2020-07-18 15:35:20 -07:00
Jarek Kowalski
73ed5adb01 kopia-ui: cleaned up console logging 2020-07-18 14:11:33 -07:00
darkdragon-001
8c941ccd4b Fix BUILD.md (#481)
Fix `make` command for `kopia-ui`.
2020-07-18 12:11:01 -07:00
Jarek Kowalski
0b2d12dfac kopia-ui: build deb and rpm packages
Fixes #478
2020-07-17 20:03:37 -07:00
Nick
ce5e6dcd13 [Robustness] Add first robustness tests
Add two tests:
- TestManySmallFiles: writes 100k files size 4k to a directory. Snapshots the data tree, restores and validates data.
- TestModifyWorkload: Loops over a simple randomized workload. Performs a series of random file writes to some random sub-directories, then takes a snapshot of the data tree. All snapshots taken during this test are restore-verified at the end.

A global test engine is instantiated in main_test.go, to be used in the robustness test suite across tests (saves time loading/saving metadata once per run instead of per test).
2020-07-14 22:37:11 -07:00
Nick
82a2fa0ea5 [Robustness] Add test engine to manage snapshot verification testing (#468)
* Add test engine to manage snapshot verification testing

Test engine manages the test and metadata repositories, snapshot
checker, metadata storage persistence, and file writer. It is
the high level helper that will be invoked in the snapshot
verification testing suite.

- modify data directory file structure
- issue snapshot/restore/delete to the data directory
- accumulate metadata over the course of the test suite
- flush accumulated metadata to the metadata repository
- load historical metadata from the repository on initialization
- perform automatic data integrity verification on snap restore

This change corresponds to the robustness execution engine component from the design documentation.
2020-06-27 23:46:37 -07:00
Jarek Kowalski
d44c01fabb content: do not short circuit compaction if there's one index but there are contents to delete 2020-06-24 08:39:56 -07:00
Jarek Kowalski
64a6cb42dc parallelwork: fixed error handling, which caused parallel work to never finish on any error 2020-06-24 08:39:56 -07:00
Jarek Kowalski
1c2534199c cli: fixed panic() during snapshot verification caused by refactoring to new Repository interface 2020-06-24 08:39:56 -07:00
Jarek Kowalski
3843ed6727 cli: added content verify --include-deleted flag 2020-06-24 08:39:56 -07:00
Jarek Kowalski
ed9511bae1 b2: fix GetMetadata() implementation
Fixes #459
2020-06-08 19:00:51 -07:00
Jarek Kowalski
25934a544d content: fixed deletion of cleanup blobs (#462)
* content: ensure that cleanup blobs have unique contents to prevent situation where they keep getting rewritten and thus never deleted

* cli: added '--decrypt' option to 'kopia blob show'
2020-06-08 08:14:01 -07:00
Jarek Kowalski
79757672ca server: implemented 'flush' and 'refresh' API
Added test that verifies that when client performs Flush (which happens
at the end of each snapshot and when repository is closed), the
server writes new blobs to the storage.

Fixes #464
2020-06-07 19:38:13 -07:00
Jarek Kowalski
293cb10471 cosmetic changes to maintenance behavior (#461)
- run maintenance even if the command is about to return an error
  (otherwise if folks have persistent error causing snapshots to fail
  they will never run maintenance)
- disable progress output after snapshotting so that
  'kopia snapshot --all' output is clean
2020-06-01 23:38:18 -07:00
Pavan Navarathna
c13b5f820f Remove extra whitespaces and fix minor typos (#460) 2020-06-01 13:40:57 -07:00
Samuel BENARD
85aa4ae6e5 Add 'repositories' page (#454)
Add sftp and webdav as repositories to "Getting started" documentation page, "Setting Up Repository" chapter.

Add repositories list and usage examples to doc.
2020-06-01 01:08:58 -07:00
Julio Lopez
deb1099c52 Trivial: remove unused logging.Option type 2020-06-01 00:59:51 -07:00
Jarek Kowalski
6bc47cb399 content: emit warning whenever the number of index blobs gets too high, which is an indication that maintenance has not run in a long time 2020-06-01 00:57:32 -07:00
Jarek Kowalski
960c33475e maintenance: disabled automatic compaction on repository opening
instead moved to run as part of maintenance ('kopia maintenance run')

added 'kopia maintenance run --force' flag which runs maintenance even
if not owned
2020-06-01 00:57:32 -07:00
Julio López
6cb970f156 Revert "Fix #360: Leverage Go 1.14 testing.T.Cleanup() (#455)" (#458)
This reverts commit 73b913c (#455)

Pulled the trigger too soon.
2020-05-31 22:39:39 -07:00
Julio López
73b913c406 Fix #360: Leverage Go 1.14 testing.T.Cleanup() (#455)
Revert "testing: ensure cleanup of content managers, fixes #356" (commit 06fbaba)
Re-applies commit 9a3e1e1

Co-authored-by: Jarek Kowalski <jaak@jkowalski.net>
2020-05-31 22:11:41 -07:00
Nick
b30da511e7 Wire up snapshot-store-compare behavior
Connect the snapshotter, the storer, and the comparer. Invoke
the snapshotter to take/restore/delete snapshots on the repo,
the comparer to gather metadata before the snapshot and
after the restore, and the storer to save metadata for later
lookup when verifying restores.
2020-05-31 21:12:31 -07:00
Jarek Kowalski
d68273a576 Improvements for dealing with eventually-consistent stores (S3) (#437)
* content: added support for cache of own writes

Thi keeps track of which blobs (n and m) have been written by the
local repository client, so that even if the storage listing
is eventually consistent (as in S3), we get somewhat sane behavior.

Note that this is still assumming read-after-create semantics, which
S3 also guarantees, otherwise it's very hard to do anything useful.

* compaction: support for compaction logs

Instead of compaction immediately deleting source index blobs, we now
write log entries (with `m` prefix) which are merged on reads
and applied only if the blob list includes all inputs and outputs, in
which case the inputs are discarded since they are known to have been
superseded by the outputs.

This addresses eventual consistency issues in stores such as S3,
which don't guarantee list-after-put or list-after-delete. With such
stores the repository is ultimately eventually consistent and there's
not much that can be done about it, unless we use second strongly
consistent storage (such as GCS) for the index only.

* content: updated list cache to cache both `n` and `m`

* repo: fixed cache clear on windows

Clearing cache requires closing repository first, as Windows is holding
the files locked.

This requires ability to close the repository twice.

* content: refactored index blob management into indexBlobManager

* testing: fixed blobtesting.Map storage to allow overwrites

* blob: added debug output String() to blob.Metadata

* testing: added indexBlobManager stress test

This works by using N parallel "actors", each repeatedly performing
operations on indexBlobManagers all sharing single eventually consistent
storage.

Each actor runs in a loop and randomly selects between:

- *reading* all contents in indexes and verifying that it includes
  all contents written by the actor so far and that contents are
  correctly marked as deleted
- *creating* new contents
- *deleting* one of previously-created contents (by the same actor)
- *compacting* all index files into one

The test runs on accelerated time (every read of time moves it by 0.1
seconds) and simulates several hours of running.

In case of a failure, the log should provide enough debugging
information to trace the exact sequence of events leading up to the
failure - each log line is prefixed with actorID and all storage
access is logged.

* makefile: increase test timeout

* content: fixed index blob manager race

The race is where if we delete compaction log too early, it may lead to
previously deleted contents becoming temporarily live again to an
outside observer.

Added test case that reproduces the issue, verified that it fails
without the fix and passed with one.

* testing: improvements to TestIndexBlobManagerStress test

- better logging to be able to trace the root cause in case of a failure
- prevented concurrent compaction which is unsafe:

The sequence:

1. A creates contentA1 in INDEX-1
2. B creates contentB1 in INDEX-2
3. A deletes contentA1 in INDEX-3
4. B does compaction, but is not seeing INDEX-3 (due to EC or simply
   because B started read before #3 completed), so it writes
   INDEX-4==merge(INDEX-1,INDEX-2)
   * INDEX-4 has contentA1 as active
5. A does compaction but it's not seeing INDEX-4 yet (due to EC
   or because read started before #4), so it drops contentA1, writes
   INDEX-5=merge(INDEX-1,INDEX-2,INDEX-3)
   * INDEX-5 does not have contentA1
7. C sees INDEX-5 and INDEX-5 and merge(INDEX-4,INDEX-5)
   contains contentA1 which is wrong, because A has been deleted
   (and there's no record of it anywhere in the system)

* content: when building pack index ensure index bytes are different each time by adding 32 random bytes
2020-05-31 17:11:20 -07:00
Jarek Kowalski
9123e3ebff cli: 'kopia server' made --ui default (#452) 2020-05-25 19:09:26 -07:00
Julio López
130712a1b4 Remove unused content.Manager.closed channel (#451) 2020-05-25 11:10:45 -07:00
Jarek Kowalski
e445dc5e61 repo: moved creating cache directory from connect to first use (#450) 2020-05-22 10:08:48 -07:00
Julio Lopez
fff2b44e19 Upgrade AWS SDK to 1.31.3 from 1.31.1
Change log:

https://github.com/aws/aws-sdk-go/releases

Notably:

SDK Bugs
service/s3/s3crypto: Add missing return in encryption client (#3258)
Fixes a missing return in the encryption client that was causing a nil
dereference panic.
2020-05-21 16:12:13 -07:00
Julio Lopez
0642b261a3 Upgrade github.com/klauspost/compress to 1.10.6
Change log:
https://github.com/klauspost/compress/releases
2020-05-21 16:12:13 -07:00
Julio Lopez
0afd1a5424 Upgrade github.com/minio/minio 2020-05-21 16:12:13 -07:00
Julio Lopez
97e04d53a0 Upgrade golang.org/x dependencies 2020-05-21 16:12:13 -07:00
Julio López
0875939d56 dep: upgrade protobuf dependents (#442)
Upgrade cloud.google.com/go/storage to v1.8.0 from version 1.6.0

Change logs:
- https://github.com/googleapis/google-cloud-go/releases/tag/storage%2Fv1.8.0
- https://github.com/googleapis/google-cloud-go/releases/tag/storage%2Fv1.7.0

Protobuf from 1.3.5 to 1.4.2
- https://github.com/golang/protobuf/releases
- https://github.com/golang/protobuf/releases/tag/v1.4.2

Use google.golang.org/protobuf version 1.23.0
Instead of github.com/golang/protobuf/proto which has been superseded
- https://github.com/protocolbuffers/protobuf-go/releases

cloud.google.com/go from 0.54.0 to 0.57.0
- https://github.com/googleapis/google-cloud-go/releases/tag/v0.57.0
- https://github.com/googleapis/google-cloud-go/releases/tag/v0.56.0
- https://github.com/googleapis/google-cloud-go/releases/tag/v0.55.0

google.golang.org/api from 0.20 to 0.25.0
- https://github.com/googleapis/google-api-go-client/releases

github.com/prometheus/client_golang to 1.6.0
- https://github.com/prometheus/client_golang/releases

Required changes:
- Fix import paths for protobuf imports
- Add linter exception
- Use prototext package to marshal to text
2020-05-21 13:22:59 -07:00
Julio López
23c12125d8 Build test/tools in Darwin as well (#447)
Upgrade github.com/google/fswalker to get fixes for Darwin/macOS

#212 
google/fswalker#25
2020-05-21 12:02:27 -07:00
Julio Lopez
0c2ad9973f Upgrade github.com/minio/minio-go/v6
Change log:
https://github.com/minio/minio-go/releases

Upgrade github.com/minio/minio

Change log:
https://github.com/minio/minio/releases

Also: `go mod tidy`
2020-05-20 22:36:35 -07:00
Julio López
53b82c9366 dep: upgrade various dependencies (#445)
* Upgrade various golang.org/x/* modules

golang.org/x/mod to 0.3.0 from 0.2.0
https://github.com/golang/mod/releases/tag/v0.3.0

* Upgrade gopkg.in/ini.v1 to 1.56.0

Change log:
https://github.com/go-ini/ini/releases

* Upgrade github.com/pkg/profile to 1.5.0

Change log:
https://github.com/pkg/profile/releases

* Upgrade github.com/mattn/go-ieproxy

Change log:
https://github.com/mattn/go-ieproxy/releases
2020-05-20 18:06:04 -07:00
Julio Lopez
0a6a0d4ffb Upgrade AWS SDK to 1.31.1
From version 1.28.13 to 1.31.1

Change log:

https://github.com/aws/aws-sdk-go/releases

Also upgrade github.com/stretchr/testify to 1.5.1 from 1.4.0

https://github.com/stretchr/testify/releases
2020-05-20 08:24:10 -07:00
Julio López
ea681e40c2 deps: Upgrade compress package to 1.10.5 (#443)
* Upgrade compress package to 1.10.5

Change log
https://github.com/klauspost/compress/releases

* Upgrade github.com/klauspost/pgzip to 1.2.4

Change log:
https://github.com/klauspost/pgzip/releases
2020-05-19 05:29:52 -07:00
Julio López
e493177236 Remove legacy flags from snapshot create command (#441)
Remove `--hostname` and `--username` flags
2020-05-18 22:48:18 -07:00
Jarek Kowalski
8c4fb53c96 blob: support for GetMetadata() to get server-side timestamp and blob length (#440) 2020-05-18 11:06:34 -07:00
Jarek Kowalski
ca28469706 cli: improved 'snapshot delete' usage (#436)
New usage:

```
kopia snapshot delete manifestID... [--delete]
kopia snapshot delete rootObjectID... [--delete]
```

Fixes #435

cli: added --unsafe-ignore-source as alias for `--delete`
This is a hidden flag for backwards compatibility. It will be removed.
2020-05-13 23:43:45 -07:00
Samuel BENARD
7e5fc52ce8 removal of unnecessary extra )} 2020-05-12 17:12:11 -07:00
Samuel BENARD
f3359d78f6 add sftp and webdav as repositories to "Getting started" documentation page, "Setting Up Repository" chapter 2020-05-12 17:12:11 -07:00
Jarek Kowalski
993c3bfb3e linter: fixed how linter is installed on Darwin and Linux since it was getting wrong version 2020-05-11 23:58:41 -07:00