1447 Commits

Author SHA1 Message Date
Jarek Kowalski
6b756bad40 fshasher: truncate timestamps to full seconds when comparing to accomodate filesystems that lose precision (#661) v0.7.2 2020-10-03 15:15:24 -07:00
Jarek Kowalski
966b9be521 Fixed retention tag application to incomplete snapshots, automatically apply at checkpoints. (#660)
* upload: apply retention policy after each checkpoint

* policy: fixed applying retention policy to incomplete snapshots

- added limited retention to incomplete snapshots (keeping at  least 3 snapshots and no less than 4 hours)
2020-10-03 13:36:04 -07:00
Jarek Kowalski
d8d29ed3a5 Fixed few minor data races (#659)
* nit: fixed minor data race

* upload: fixed minor data races when reporting stats

* upload: ensure we cancel estimation goroutine before upload finished

This fixes minor data race when gathering statistics.
Also avoids goroutine leaks.
2020-10-02 23:04:34 -07:00
Jarek Kowalski
f66fe5789e Eliminated busy loop after snapshot failure (#658)
* server: if a snapshot fails, don't start the next one for 5 minutes or until the next successful refresh.

* Makefile: don't print skipped tests
2020-10-02 19:48:21 -07:00
Jarek Kowalski
16073f728f testing: more sleeps in TestFileStorage 2020-09-30 23:08:15 -07:00
Jarek Kowalski
ae38fa3917 Speed up integration tests (#653)
* testing: don't use expensive scrypt-65536-8-1 in integration tests

* testing: use platform-specific encryption and hashing for arm and arm64 to speed up tests

* testing: manually manage log directory to be able to analyze integration test failures

* testing: snapshot_gc_test was too quick

* Makefile: renamed target building integration test binary
2020-09-30 22:01:16 -07:00
Jarek Kowalski
044b170915 testing: fixed deadlock in faketime_test (#655)
TestTimeAdvanceConcurrent was depending on t.Parallel() to be scheduled
quickly, which is not guaranteed.

Fixes #654
2020-09-29 23:28:03 -07:00
Jarek Kowalski
01e6395804 repo: refresh indexes in the background every 15 minutes (#650) 2020-09-29 22:02:46 -07:00
Jarek Kowalski
a01bfde39a Makefile: plug in gotestsum for better test output (#652) 2020-09-29 21:14:20 -07:00
Jarek Kowalski
2b6d3d724e testing: increase delay in filesystem_storage_test 2020-09-29 08:29:46 -07:00
Jarek Kowalski
377513cc34 Upgrade webdav client dependency to include bugfix for the race condition (#651)
* deps: upgrade gowebdav dependency to include race condition fix

* webdav: remove workaround
2020-09-29 08:08:31 -07:00
Jarek Kowalski
66cebb79cb Fixed empty object IDs in checkpoints (#649)
* object: fixed race condition between Result() and Checkpoint()

This would sometimes result in indirect objects having empty object IDs.

Fixes #648

* upload: ensure checkpoints never containt empty object IDs.

* testing: reduce armhf test weight
2020-09-29 07:14:47 -07:00
Jarek Kowalski
0758a92c58 restore: improved user experience (#644)
* restore: improved user experience

* 'snapshot restore' is now the same as 'restore' and both will
  support restoring by manifest ID, root ID or root ID + subdirectory

* added support for restoring individual files

* implemented PR feedback and refactored object ID parsing

Moving helpers inside the snapshot/ package helped clean up the code
a lot.
2020-09-28 22:57:24 -07:00
Jarek Kowalski
fd24227379 b2: fixed handling of 'no_such_file' to indicate NOT_FOUND (#646)
Fixes #645
2020-09-26 21:01:04 -07:00
Jarek Kowalski
1636071f6b testing: increase test timeout because 90s is often flaky 2020-09-26 18:49:53 -07:00
Jarek Kowalski
ff6a414ec5 cli: When listing directory that had errors, print error summary at the end. (#643)
Can be disabled with `--no-error-summary`.
Quick demo: https://asciinema.org/a/2rma0sx2mD6HoIPy6VL0QEFeP

Also refactored fs.Directory to provide Summary optionally.
2020-09-25 09:06:41 -07:00
Jarek Kowalski
c9c8d27c8d Repro and fix for zero-sized snapshot bug (#641)
* server: repro for zero-sized snapshot bug

As described in https://kopia.discourse.group/t/kopia-0-7-0-not-backing-up-any-files-repro-needed/136/5

* server: fixed zero-sized snapshots after repository is connected via API

The root cause was that source manager was inheriting HTTP call context
which was immediately closed after the 'connect' RPC returned thus
silently killing all uploads.
v0.7.1
2020-09-23 20:15:36 -07:00
Julio López
892af670e9 Add support for Blake3 hashing (#640)
* Add Blake3 hash

Uses github.com/zeebo/blake3 optimized implementation

Hash info at https://github.com/BLAKE3-team/BLAKE3

Micro benchmarks show ~2X speedup for hashing+encryption.
- Caveat: not fully controlled environment, etc.

* go mod tidy
2020-09-23 06:57:49 -07:00
Julio López
0f449f31df Update dependencies (#639)
Upgrade AWS SDK from 1.31.3 to 1.34.29
Change log: https://github.com/aws/aws-sdk-go/releases

Upgrade protobuf and google dependencies:
- cloud.google.com/go/storage to v1.12.0 from version 1.8.0
  https://github.com/googleapis/google-cloud-go/releases/tag/storage%2Fv1.12.0
- google.golang.org/protobuf to 1.25.0
  https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.25.0
- google.golang.org/api from 0.25 to 0.32.0
  https://github.com/googleapis/google-api-go-client/releases

Upgrade golang.org/x dependencies

Upgrade prometheus and opencensus
- Prometheus client to 1.7.0
  https://github.com/prometheus/client_golang/releases/tag/v1.7.0
- Opencensus to 0.22.4
  https://github.com/census-instrumentation/opencensus-go/releases/tag/v0.22.4
- Opencensus prometheus exporter to v0.2.0
  https://github.com/census-ecosystem/opencensus-go-exporter-prometheus/releases/tag/v0.2.0

Upgrade minio to 6.0.58
https://github.com/minio/minio-go/releases

Upgrade github.com/natefinch/atomic
Fixes an issue when working with relative directories

Upgrade testify to 1.6.1
https://github.com/stretchr/testify/releases/tag/v1.6.1

Upgrade gocloud.dev to 0.20.0
https://github.com/google/go-cloud/releases/tag/v0.20.0

Upgrades Azure storage blob to 0.10.0
https://github.com/Azure/azure-storage-blob-go/releases/tag/v0.10.0
as well as other Azure dependencies
azure-amqp-common-go    v2.1.0 => v2.1.0
azure-pipeline-go       v0.2.2 => v0.2.3

Upgrade compress and pgzip
github.com/klauspost/compress to v1.11.0
github.com/klauspost/pgzip to v1.2.5

Upgrade go-cmp to v0.4.1
Upgrade flock to v0.8.0
Upgrade uuid to v1.1.2
Upgrade gorilla/mux to v1.8.0
Upgrade github.com/pkg/sftp to v1.12.0
Upgrade github.com/zalando/go-keyring to v0.1.0
Upgrade github.com/mattn/go-colorable v0.1.7 // indirect

Cleanup: go mod tidy
2020-09-22 22:37:26 -07:00
Julio López
ae6a960080 Prefer t.TempDir() over makeScratchDir(t) (#612)
Prefer t.TempDir() over makeScratchDir(t)
Remove unused randomString
Leverage T.TempDir() in CLITest env
2020-09-22 22:16:39 -07:00
Julio López
6b0b79afe1 Trivial: update git attributes for Makefile (#638)
* Update .gitattributes for Go files

- Mark go source files as text, with LF line ending.
- Set git diff language mode for `*.go` files to `golang`

* Add .gitattributes entry for Makefiles
2020-09-22 21:32:53 -07:00
Jarek Kowalski
44ad8b58c1 Update build-armhf.yml 2020-09-22 19:51:54 -07:00
Jarek Kowalski
6bdcb81712 ignorefs: fixed arm-specific linter warning (#637)
* ignorefs: fixed arm-specific linter warning

* testing: TestServerStart fixes for armhf
2020-09-22 19:04:05 -07:00
Jarek Kowalski
b8c506b916 Create build-armhf.yml 2020-09-22 17:25:29 -07:00
Julio López
090cd1cc4d Minor edits for SFTP documentation (#635) 2020-09-21 17:18:03 -07:00
Jarek Kowalski
d0d6ac4767 SFTP connectivity and docs improvements (#623)
* sftp: support for external SSH command and host verfication improvements

- removed custom parsing of hostnames and verification and replaced with
  standard 'knownhosts' implementation.

- added option to launch external SSH command which supports
  aliases, agent, etc.

NOTE, we're still not supporting any cases where password needs to be
entered on the command line, since that would be incompatible with
the UI which uses client-server model.

Fixes #500
Fixes #414

* site: updated SFTP repository connection instructions

Fixes #590
v0.7.0
2020-09-20 11:10:13 -07:00
Jarek Kowalski
0595213d79 upload: fixed armhf alignment issue (#632)
Fixes: #631
2020-09-20 10:19:03 -07:00
Jarek Kowalski
04fcddeff0 webdav: prevent webdav client race condition (#626)
The race is described in
https://github.com/studio-b12/gowebdav/issues/36

We need this workaround until the fix is merged upstream,
to avoid maintaining a webdav client fork.

Fixes #624
2020-09-19 11:47:57 -07:00
Jarek Kowalski
538c644586 cli: don't ask for password if repository is not connected (#627) 2020-09-19 11:45:03 -07:00
Jarek Kowalski
fce9497375 restore: support for symlinks (experimental) (#621) v0.7.0-rc2 2020-09-18 10:29:20 -07:00
Jarek Kowalski
98a2bc6f6d testing: increase sleep time to fix flaky arm64 test 2020-09-18 08:25:17 -07:00
Nick
7f61dc6637 [Robustness] Add command line parameters for kopia snapshotter (#576)
* [Robustness] Add command line parameters for kopia snapshotter

Add flags for:
- no-progress
- parallel
- cache sizes
- no update check

Add an integration test to validate snapshotter expected output
against a kopia executable.
2020-09-18 01:15:19 -07:00
Jarek Kowalski
9551d2495d upload: scan the directory to be uploaded in parallel to estimate the amount of data to be uploaded (#622)
This allows better progress indicator in the CLI and UI.
The percentage completed is not displayed until estimate is available.

Quick demo: https://asciinema.org/a/O7ktcWSgaGUPfJwhzc65mMWM1
2020-09-17 23:59:18 -07:00
Jarek Kowalski
7cdb75ab79 fuse: changed file read implementation to avoid OOM (#620)
Changed file read implementation from ReadAll() to a Handle to avoid OOMing

We don't have automated tests for this but I verified this by restoring
13GB file over fuse and memory usage never exceeded 400MB.
2020-09-16 23:04:22 -07:00
Jarek Kowalski
f2cf71d914 logging: revamped logs from content manager to be machine parseable (#617)
* logging: revamped logs from content manager to be machine parseable

Logs from the content manager (except reads) are sent to separate log
file that is always free from personally-identifiable information
(e.g. no file names, just content IDs and blob IDs).

Also moved CLI logs to a subdirectory (cli-logs) and put content logs
in a parallel directory (content-logs)

Also, the log file name will now include the type of the command that
was invoked:

   kopia-20200913-134157-16110-snapshot-create.log

Fixes #588

* tests: moved all logs from tests to a separate directory
2020-09-16 20:04:26 -07:00
Jarek Kowalski
c7be3a0c87 testing: added performance benchmark (#618)
The benchmarks creates 20 GB of files in different configurations

* 10 x 2 GB files
* 100 x 200 MB files
* 1000 x 20 MB files

and backs them up to a local filesystem repository measuring time,
CPU and RAM usage.

The benchmarking script uses GCP instance (n1-standard-8) with fast NVME
flash to eliminate local filesystem latency.

Current performance numbers show major improvement in latency in
0.7.0-rc1 due to splitter throughput optimization (#606).
2020-09-15 21:30:08 -07:00
Jarek Kowalski
b71e551fd5 app: changed releaseType to release to fix publishing artifacts to GitHub, 2nd try v0.7.0-rc1 2020-09-13 18:47:05 -07:00
Jarek Kowalski
a5f275b2f5 app: changed releaseType to release to fix publishing artifacts to GitHub 2020-09-13 18:26:45 -07:00
Jarek Kowalski
8febe90e61 goreleaser: switch draft mode to off as it interferers with scoop publishing 2020-09-13 17:32:12 -07:00
Jarek Kowalski
44968af7b6 release: fixed RPM signing by moving all of this to a single invocation of sign.sh 2020-09-13 17:07:49 -07:00
Julio López
67ed3a9f96 Remove maintenance lock file on disconnect (#616)
* Remove maintenance lock file on disconnect

* Remove workaround for maintenance lock file in repotesting
2020-09-13 11:18:29 -07:00
Jarek Kowalski
9faf6b33d0 cli: fixed snapshot delete to support deleting file (not directory) snapshots by object ID (#613) 2020-09-12 22:36:47 -07:00
Jarek Kowalski
f0b97b960b Fixed checkpointing to not restart the entire upload process (#594)
* object: added Checkpoint() method to object writer

* upload: refactored code structure to allow better checkpointing

* upload: removed Checkpoint() method from UploadProgress

* Update fs/entry.go

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-09-12 22:36:22 -07:00
Jarek Kowalski
6a14ac8a2a cli: ensure advanced commands are not accidentally used (#611)
* cli: ensure advanced commands are not accidentally used

This prints an error when a dangerous command is used without
first setting KOPIA_ADVANCED_COMMANDS=enabled environment variable.

Co-authored-by: Julio López <julio+gh@kasten.io>
2020-09-12 20:31:25 -07:00
Jarek Kowalski
5784d68766 site: edited installation page and switched Download link to point at it (#603)
* site: edited installation page and switched Download link to point at it.

Emphasized the use of package managers to download and keep Kopia up-to-date.
Added instructions for using Scoop on Windows.

Co-authored-by: Julio López
2020-09-12 19:30:49 -07:00
Julio López
64b6018140 Test for directory reuse after GC (#601)
content:Allow returning deleted content in GetContent
maintenance: check deleted contents as well
maintenance: test for when a directory content is reused after deletion

testing: add support for repo open options in repotesting
* Allow passing repo options to MustReopen
* Add repotesting.Environment.MustConnectOpenAnother
* Remove kopia.config.mlock file
* snapshot create helper
* Fix content delete related and e2e tests
2020-09-12 19:28:52 -07:00
Jarek Kowalski
e22d22dba2 object: implemented fast concatenation of objects by merging their index entries (#607) 2020-09-11 20:12:01 -07:00
Jarek Kowalski
faf280616a Splitter throughput improvements (#606)
* object: refactored writer to detect split points before writing

This introduces new primitive that will be moved into splitters
themselves in subsequent commits. I'm doing this in small steps to
ensure we don't regress at any time.

* splitter: refactored TestSplitters test

This is use slow (byte-by-byte) and fast (nextSplitPoint) methods of
determining split points.

Note nextSplitPoint is not implemented by splitters yet, but this
verifies that the test is expecting the right thing.

* object: splitter refactoring - replaced ShouldSplit() with NextSplitPoint() everywhere, still not optimized

* splitter: added additional dimension to splitter_test

We split either in large chunks or one byte at a time to catch
the corner cases in the splitter implementation.

* splitter: optimized splitters using NextSplitPoint primitive

This improves splitter performance by about 40% (buzhash) and makes
it virtually free for FIXED splitter.
2020-09-11 19:45:48 -07:00
Julio López
aebf8616a2 object: loadSeekTable helper (#608) 2020-09-11 19:12:13 -07:00
Jarek Kowalski
57888a81eb travis: disable publishing RPM on pull requests since it needs credentials 2020-09-11 09:21:14 -07:00