Commit Graph
1798 Commits
Author SHA1 Message Date
Honoré Vasconcelos 71494826f9 Improve query performence used in GetFilesAndSourceBlocksFast
Tree changes in query
* Move inner selection S to a temporary table
* Reorder join field in outer query
* Remove intersection with File view in outer selection
File view is already intersected with in selection S

With the above-mentioned changes, on a specific testset, query took 9s instead of 6min.
2020-08-26 10:10:54 +01:00
Daniel Gehriger d143f8b3f9 Improved speed of AppendFilesFromPreviousSetWithPredicate, making USN backups usable when there are large file sets 2020-08-18 11:43:23 +02:00
Daniel Gehriger 82c54dde31 Fixing AppendFilesFromPreviousSetWithPredicate 2020-08-17 23:01:20 +02:00
Daniel Gehriger c5bef5c2e0 Improved Improved speed of AppendFilesFromPreviousSetWithPredicate, making USN backups usable when there are large file sets 2020-08-17 18:06:38 +02:00
Daniel Gehriger 8e8c758c65 Improved speed of AppendFilesFromPreviousSetWithPredicate, making USN backups usable when there are large file sets 2020-08-17 17:27:45 +02:00
Daniel Gehriger 7d2c6befb0 Using USN journal in CountFilesHandler 2020-08-17 15:08:15 +02:00
Kenneth SkovhedeandGitHub ec1975b5a7 Merge pull request #4269 from warwickmm/target_net_471
Target .NET Framework 4.7.1
2020-08-07 10:50:35 +02:00
Kenneth Hsu e964072690 Target .NET Framework 4.7.1.
This updates all projects to target .NET Framework 4.7.1.  The
TencentCOS and Tardigrade backends depend on .NET Standard 2.0.  When a
.NET Framework prior to 4.7.1 is targeted, the system cannot be sure
that all the dependencies exist, so it copies all dependent assemblies
to the output directory.  This causes many assemblies from the System
namespace to become bundled in the release.

https://stackoverflow.com/a/48875007

We had previously attempted to make individual projects target 4.7.1
(see pull request #4242), but this can cause compatibility issues when
4.6.2 projects depend on 4.7.1. projects.

This will require Mono 5.10.0 or greater (previously, we required 5.0.0
or greater).

https://www.mono-project.com/docs/about-mono/releases/5.10.0/#class-libraries

This fixes issue #4234.
2020-07-26 19:46:01 -07:00
Kenneth Hsu fea55b9981 Avoid removing files unrelated to backup being deleted.
This fixes issues #3845 and #4244.
2020-07-21 12:59:28 -07:00
warwickmmandGitHub 45da5a4e2b Merge pull request #4249 from jpschewe/report-compression-errors
Ensure that compression errors are thrown and logged.

This also prevents FilesetVolumeWriter.Dispose from calling Close prematurely, which
can result in a JsonWriter exception.
2020-07-11 16:49:10 -07:00
Jon Schewe e5f57e8f66 Remove unused LOGTAG field 2020-07-11 18:12:59 -05:00
Jon Schewe 2747f78c40 Remove unneeded catch statement
Using the finally block to close out the writer allows the exception to
show up in the log.
2020-07-11 17:33:38 -05:00
Jon Schewe 36336ac6f1 Rethrow exception after logging
This ensures that the backup properly fails.
2020-07-10 06:55:41 -05:00
Jon Schewe e41c0d8bf9 Catch compression errors and report them
When the file list is over 4GB one needs to have the zip64 option
enabled. This commit catches the exception and reports it as an error so
that the user knows what the problem is.

Fixes duplicati/duplicati#/4206
2020-07-08 07:55:25 -05:00
Kenneth Hsu be44b785ce Remove unnecessary local variable. 2020-07-01 16:50:29 -07:00
Kenneth Hsu 3aa1d2f3da Ensure that paths exist when restoring empty files.
This fixes #4148.
2020-07-01 16:13:32 -07:00
Kenneth Skovhede 9eef0a92f7 Updated the schema to include DB version 11 changes. 2020-05-10 21:30:15 +02:00
Kenneth SkovhedeandGitHub e8833c2173 Merge pull request #4171 from warwickmm/add_block_indices
Add indices to Block table to improve query performance
2020-05-10 21:25:03 +02:00
Kenneth SkovhedeandGitHub 5168d05ebf Merge pull request #4161 from warwickmm/refactor/verify_remote_list_setup
Remove boilerplate code in calls to VerifyRemoteList
2020-05-10 21:04:42 +02:00
Kenneth Hsu 6638af10e7 Add indices to Block table to improve query performance.
The index on Block.Size improves the performance of the query that
checks that the user has not altered the block size of the backup
configuration.

The index on Block.Hash and Block.VolumeID improves the performance of
the query that obtains the blocklists.

There are anecdotes that these indices can drastically improve
performance (queries that used to take hours completed in seconds with
the index):

https://forum.duplicati.com/t/repairing-a-big-database/8174/4
https://github.com/duplicati/duplicati/issues/3884#issuecomment-612296016

This fixes issue #3884.
2020-04-11 11:47:40 -07:00
Kenneth Hsu de1b89167b Rename local variable. 2020-04-05 12:00:51 -07:00
Kenneth Hsu d92a436bad Fix spelling error in local variable name. 2020-04-05 11:46:32 -07:00
Kenneth Hsu b53770b589 Add VerifyRemoteList overload to reduce duplicated code. 2020-04-05 11:46:08 -07:00
Kenneth Hsu 0c9ca9a75c Remove unused BackendHandler members. 2020-03-29 16:48:19 -07:00
Kenneth SkovhedeandGitHub e45b8c4b2e Merge pull request #4049 from seantempleton/filesetdifference
Fix unexpected difference in fileset when using Stop Now
2020-03-25 07:11:04 +01:00
Kenneth SkovhedeandGitHub bb05d1edde Merge pull request #4139 from warwickmm/remove_unused_result_classes_members
Remove unused members from Duplicati.Library.Main.ResultClasses
2020-03-25 07:05:15 +01:00
Kenneth SkovhedeandGitHub 535268d1f7 Merge pull request #4138 from warwickmm/remove_unused_strings_members
Remove unused members from Duplicati.Library.Main.Strings
2020-03-25 07:04:09 +01:00
Kenneth SkovhedeandGitHub f628c5dd01 Merge pull request #4136 from warwickmm/remove_unused_database_members
Remove unused members from Duplicati.Library.Main.Database
2020-03-25 07:03:41 +01:00
Kenneth SkovhedeandGitHub c95def65f5 Merge pull request #4122 from warwickmm/fix_upload_retry_attempts
Fix log message for retried upload operations
2020-03-25 06:58:14 +01:00
Kenneth Hsu bf5ae9afac Disable false ReSharper warnings for unused properties.
These properties are referenced in the logs.
2020-03-15 12:11:10 -07:00
Kenneth Hsu 043a11967a Remove unused members from Duplicati.Library.Main.ResultClasses. 2020-03-15 12:09:13 -07:00
Kenneth Hsu 62781b508f Remove unused members from Duplicati.Library.Main.Strings. 2020-03-15 11:13:04 -07:00
Kenneth Hsu a42a0a41b6 Remove unnecessary variable assignment. 2020-03-15 09:58:14 -07:00
Kenneth Hsu 7456d12dac Revert "Ensure that IndexVolumeWriter is disposed."
Since a reference to the IndexVolumeWriter is passed to the
FileEntryItem, we should not dispose of it here.

This reverts commit b6123cc156.

This is a potential fix for issue #4130.
2020-03-15 09:53:21 -07:00
Kenneth Hsu 13e1f0dac6 Remove unused Database members. 2020-03-14 16:45:08 -07:00
Sean Templeton 9739517b0a Fix bandwidth throttling inconsistency
In code the throttling generally works backwards than what one would expect.
The streams that are throttled are the streams that operate on files from the local machine.
This fixes the download throttling not working and the upload throttling applying to
both uploads and downloads.

When doing a Put operation the stream on the local machine is reading from the
local filesystem and hence the upload throttle bytes per second needs to be
applied to the reading of the stream, not the writing.

Similarly when doing a Get operation the download throttle bytes per second needs
to be applied to the writing of the stream.

Fixes #4115
2020-03-04 19:57:48 -06:00
Sean Templeton d5e064ae45 Fix a few more issues with stop now
When a backup is interrupted it will now show as a partial backup in the list of backups on the restore files page.

Temporary filelist volumes are protected from deletion in several places. All but the RestoreHandler
only protect the most recent filelist. The RestoreHandler protects all temporary filelist volumes as the user
might be restoring from one that would be deleted.

Prevent the CoCoL BackendRequests channel is retired exception from appearing when the backup is stopped by checking
if the channel is retired before trying to add the FlushRequest to the channel. Any exceptions from the BackendUploader
task will still be thrown.
2020-03-01 21:19:07 -06:00
Sean Templeton 19010e6314 Fix unexpected difference in fileset when using Stop Now
The exception could occur due to the existing delete for FilesetEntry
deleting based on volume ids, which would only match a filelist.
The bsIdsSubQuery would return BlocksetIds that should
be deleted and would delete from the FileLookup table.

FilesetEntry would then have a higher count of rows
than what would be returned by the LEFT OUTER JOINS on all of the
other tables in VerifyConsistency() since more rows had been deleted
from FileLookup.

To fix this when rows are deleted in FileLookup, use the associated metadata id
to delete from FilesetEntry and other tables based on the blockset id for the
metadata id.

Some existing delete statements were moved, none were deleted.
The existing FileLookup delete had the match on metadata id removed as
a blockset id does not equal a metadata id.
2020-03-01 18:16:33 -06:00
warwickmmandGitHub b1d1972cb8 Merge pull request #4114 from seantempleton/syntheticfilelist
Fix issue with synthetic filelist not being uploaded
2020-03-01 12:39:08 -08:00
Kenneth Hsu 197a15e032 Fix log message for retried upload operations.
The number of attempts is one (the first attempt) plus the number of
retries.
2020-03-01 12:07:05 -08:00
Sean Templeton da08be84a6 Convert VolumeID to long instead of int 2020-02-29 16:43:10 -06:00
Rod Savard 1b0f5a8cb0 add descriptive reason for usn soft failure 2020-02-25 15:34:42 -08:00
Sean Templeton 446120ae3e A synthetic filelist could not be uploaded due to the logic in UploadSyntheticFilelist. The code passing in the fileset id to the class would get the id based on if the volume was in the Temporary or Uploading states. If the volume was in the Uploading state, present on the remote backend, and of the right size it would get changed to Uploaded.
One of the first things UploadSyntheticFilelist does is throw an exception if the volume is not in the Uploaded state. Or if it is in the Uploaded state, the next check would prevent a synthetic filelist from being created if the volume was not in the Uploading or Temporary states.

Removed the check for the volume not being in the Uploaded state as the warning in the second check handles that case.

Removed the using statement as it would dispose of the FilesetVolumeWriter after passing it to the UploadChannel. The UploadChannel could not use it since it had been disposed.

Fixed the GetRemoteVolumeFromIDAsync taking a fileset id and matching it up against a volume id. Now it will use fileset id to get the volume that matches the fileset.

Change the StopNow disruption test to not use a synthetic file list. The test was written with it not working and therefore fails a check on the number of filesets after stopping a backup.

Bonus fix for a possible null exception in Dispose for VolumeWriterBase.
2020-02-23 16:50:36 -06:00
Kenneth Hsu 19303614f0 Remove unnecessary call to ToString. 2020-02-18 17:50:26 -08:00
Kenneth Hsu 7e86486f59 Fix logs for custom retention policy to show backup times.
When we modified the code in revision
68ffd86594 (pull request #4018) to
consider collections of IListResultFilesets instead of DateTimes, we
neglected to preserve the backup times in the logs.

This fixes #4109.
2020-02-18 17:50:13 -08:00
warwickmmandGitHub 44f619b725 Merge pull request #4085 from drwtsn32x/improve-usn-snapshot-fails
Improve USN and Snapshot error handling
2020-02-06 19:36:42 -08:00
Rod Savard 235f94c96f change to use custom exception class 2020-02-06 06:34:49 -08:00
Kenneth SkovhedeandGitHub cb7f4483cd Merge pull request #4065 from warwickmm/move_create_fileset_file
Move CreateFilesetFile method to FilesetVolumeWriter class
2020-02-06 08:06:28 +01:00
Kenneth SkovhedeandGitHub dfbfeda42c Merge pull request #4068 from warwickmm/remove_unused_options_members
Remove unused Options members
2020-02-06 08:05:20 +01:00
Kenneth SkovhedeandGitHub c0213b0bdd Merge pull request #4069 from warwickmm/remove_unused_backend_manager_members
Remove unused BackendManager members
2020-02-06 08:03:50 +01:00