Commit Graph
104 Commits
Author SHA1 Message Date
Kenneth Hsu f4f676a1de Remove unnecessary variable assignment.
These variables are assigned values that are never read by any
subsequent instruction.
2018-09-28 20:13:45 -07:00
Kenneth Skovhede 809ba9a856 Changed the default query to be v==2, as multiple users reported this to be fastest.
The previous default query is now v==4.

Added an additional v==3, and a `LIMIT 1` clause to v==4 as suggested here:
https://forum.duplicati.com/t/release-2-0-3-10-canary-2018-08-30/4497/25
2018-09-05 10:12:28 +02:00
Kenneth Skovhede d0026d8028 Reworked the file-path query, and enabled experimentally changing it by setting the environment variable TEST_QUERY_VERSION=1 or TEST_QUERY_VERSION=2.
Added check to the unittests to catch cases where it scans too many files.
2018-08-13 13:23:59 +02:00
Kenneth Skovhede 4d1bea86a6 Attempt at making a leaner version of getting the previous file's information 2018-08-11 14:39:03 +02:00
Kenneth Skovhede 5507496352 Fixed the query to correctly extract metadata for a file, using the Metadataset indirection 2018-08-11 14:37:23 +02:00
Kenneth Skovhede 52cb9fb1f9 Removed the deprecated --store-metadata option.
Rewrote the logic for pre-filtering files based on timestamps/metadata to be more verbose and well documented.
Fixed an issue where `--check-filetime-only` also checked the file size, which was not present due to the reduced query used to grab only the lastmodified information.
Fixed a problem where the check for existing metadata was wrong and produced a warning.

This fixes #3204
This handles some of #3194
2018-08-11 11:48:19 +02:00
Kenneth Skovhede e9d7c47602 Disabled logging block and file database access to reduce overhead in these queries.
Added an option to explicitly re-enable logging of the database queries (`--profile-all-database-queries`)
2018-08-07 09:40:43 +02:00
Kenneth Skovhede d042e70ca2 Changed the returned IEnumerable values to be fully created, which avoids issues with locks and transactions being prematurely released.
This might help with #3202
2018-06-04 11:56:54 +02:00
Kenneth Hsu 20f2f37806 Remove unnecessary calls to String.Format. 2018-06-02 12:02:55 -07:00
Daniel Gehriger 8236cae390 USN change journal based backup now correctly reporting source size 2018-05-02 11:24:24 +02:00
Daniel Gehriger 7bf0a25912 Revert "Merge remote-tracking branch 'upstream/feature/fix_path_storage' into feature/usn"
This reverts commit 10d6b4c31c, reversing
changes made to 1af7f9e0ca.
2018-04-23 23:02:52 +02:00
Daniel Gehriger 10d6b4c31c Merge remote-tracking branch 'upstream/feature/fix_path_storage' into feature/usn 2018-04-23 22:57:32 +02:00
Kenneth Skovhede a8a32ea115 Added refactoring to improve the storage requirements for the local database, and speed up various queries.
This fixes #1283
2018-04-23 22:31:47 +02:00
Daniel Gehriger 1af7f9e0ca Merge remote-tracking branch 'upstream/master' into feature/usn 2018-04-23 22:28:27 +02:00
Daniel Gehriger 2c1a0ddb4e Implemented backup based on changes recorded in NTFS USN journal 2018-04-19 22:59:28 +02:00
Kenneth Skovhede 79f7b22e0f Merge branch 'master' into concurrent_processing
Changed a few things on the way, removing the log process

# Conflicts:
#	Duplicati/Library/Main/Controller.cs
#	Duplicati/Library/Main/Database/ExtensionMethods.cs
#	Duplicati/Library/Main/Database/LocalBackupDatabase.cs
#	Duplicati/Library/Main/Duplicati.Library.Main.csproj
#	Duplicati/Library/Main/Operation/BackupHandler.cs
#	Duplicati/Library/Main/Operation/FilelistProcessor.cs
#	Duplicati/Library/Main/Operation/PurgeBrokenFilesHandler.cs
#	Duplicati/Library/Main/Operation/TestFilterHandler.cs
#	Duplicati/Library/Main/Options.cs
#	Duplicati/Library/Main/ResultClasses.cs
#	Duplicati/UnitTest/BasicSetupHelper.cs
2018-04-11 23:02:47 +02:00
Kenneth Skovhede 842fd96543 Implemented a new logging system that is more transparent and allows a more granular way of picking log messages.
Added ID's to each log message and each exception to allow later introduction of a Knowledgebase service that explains each error in more detail.
2018-03-15 09:12:34 +01:00
Kenneth Skovhede 9093603be1 Added support for disabling the file scanner during backups.
This fixes #2963
2018-02-11 20:57:38 +01:00
Kenneth Skovhede 75bf6857c1 Merge branch 'master' into concurrent_processing
# Conflicts:
#	.travis.yml
#	Duplicati/Library/Main/Database/LocalBackupDatabase.cs
#	Duplicati/Library/Main/Operation/BackupHandler.cs
#	Duplicati/Library/Main/ResultClasses.cs
#	Duplicati/Library/Main/Volumes/VolumeWriterBase.cs
#	Duplicati/Library/Utility/TempFile.cs
2018-01-20 15:02:41 +01:00
Kenneth Hsu ab489d9a28 Make parameter names in XML documentation match code. 2017-12-09 18:42:30 -08:00
Kenneth Hsu 1c7391399d Remove XML documentation for unmatched parameters. 2017-12-09 18:30:01 -08:00
Kenneth Skovhede d57c789f4f Merge branch 'master' into concurrent_processing
# Conflicts:
#	Duplicati/Library/Main/Duplicati.Library.Main.csproj
#	Duplicati/Library/Main/Options.cs
2017-09-18 11:56:35 +02:00
Kenneth Skovhede 7d3ac25426 Re-introduced the in-memory block-cache. This time keeping it simple with a check for size-induced collisions. 2017-09-16 18:44:25 +02:00
Dan Stahr 3b422ff058 Fixed some of the failing tests in concurrent_processing branch 2017-08-06 11:32:11 +01:00
Kenneth Skovhede 76139f207e Merge branch 'master' into concurrent_processing 2017-05-30 14:00:24 +02:00
Kenneth Skovhede 4d77fd7ebc Flipped the check for existing metadata 2017-05-30 10:29:18 +02:00
Kenneth SkovhedeandGitHub a8fe193f1e Merge pull request #2507 from downpoured/master
Proposed fix, --deleted-files causes Fatal error / System.FormatException
2017-05-30 00:53:18 +02:00
Kenneth Skovhede d18431b385 Merge branch 'master' into concurrent_processing
# Conflicts:
#	Duplicati/Library/Main/Controller.cs
#	Duplicati/Library/Main/Database/ExtensionMethods.cs
#	Duplicati/Library/Main/Database/LocalBackupDatabase.cs
#	Duplicati/Library/Main/Duplicati.Library.Main.csproj
#	Duplicati/Library/Main/Operation/BackupHandler.cs
#	Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs
#	Duplicati/Library/Main/ResultClasses.cs

First attempt at merging all changes from 2016-10-08 to now :/
2017-05-30 00:35:31 +02:00
Ben Fisher 76f3769f70 Proposed fix, --deleted-files causes Fatal error / System.FormatException
A simple backup that specifies --deleted-files causes a Fatal error.
Shortened repro steps:
(See Github comment for full repro steps)
>duplicati.commandline.exe backup file://C:\data\local\testchangedfiles\destination "C:\data\local\testchangedfiles\source\\" --encryption-module="none" --no-encryption="true" --dbpath="testchangedfiles.sqlite"  --compression-module="zip" --keep-versions=-1  --no-auto-compact="true"
>del source\file6.txt
>duplicati.commandline.exe backup file://C:\data\local\testchangedfiles\destination "C:\data\local\testchangedfiles\source\\" --changed-files="C:\data\local\testchangedfiles\source\file1.txt;C:\data\local\testchangedfiles\source\file2.txt" --deleted-files="C:\data\local\testchangedfiles\source\file6.txt" --encryption-module="none" --no-encryption="true"  --dbpath="testchangedfiles.sqlite"  --compression-module="zip" --keep-versions=-1  --no-auto-compact="true"

Results in:
Fatal error => Input string was not in a correct format.
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber
   at System.Number.ParseInt64
   at System.String.System.IConvertible.ToInt64
   at System.Convert.ToInt64
   at System.Data.SQLite.SQLiteStatement.BindParameter
   at System.Data.SQLite.SQLiteStatement.BindParameters
   at System.Data.SQLite.SQLiteCommand.BuildNextCommand
   at System.Data.SQLite.SQLiteCommand.GetStatement
   at System.Data.SQLite.SQLiteDataReader.NextResult
   at System.Data.SQLite.SQLiteDataReader..ctor
   at System.Data.SQLite.SQLiteCommand.ExecuteReader
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery
   at Duplicati.Library.Main.Database.LocalBackupDatabase.AppendFilesFromPreviousSet
   at Duplicati.Library.Main.Database.LocalBackupDatabase.AppendFilesFromPreviousSet
   at Duplicati.Library.Main.Operation.BackupHandler.RunMainOperation
   at Duplicati.Library.Main.Operation.BackupHandler.Run
   at Duplicati.Library.Main.Controller.RunAction[T]
   at Duplicati.Library.Main.Controller.Backup
   at Duplicati.CommandLine.Commands.Backup
   at Duplicati.CommandLine.Program.RunCommandLine
>Exit code: 100

With this patch, backup completes successfully.
2017-05-28 16:01:18 -07:00
Kenneth Skovhede 6cadaad56a Rewrote the query to use CROSS JOIN to force the SQLite query planner to consider the File table first. 2017-05-19 08:07:39 +02:00
Kenneth Skovhede d9014ee09c Changed query as suggested by @sjonez in issue #2442.
This fixes #2442.
2017-05-18 23:40:24 +02:00
Dan Stahr 27c9e15875 Improved database performance and logging
- Don't use Vacuum() just before PurgeLogData (which performs vacuum() already)
 - Removed unncessary poorly performning query (after optimizing it I found out it's unused)
 - Correctly log calls for ExecuteScalarInt64
2017-03-23 15:22:58 +00:00
Kenneth Skovhede f5a1bcd32c Reverted the SQL query to use the Timestamp sorting instead of explicit fileset.
This fixes #2244
2017-01-11 23:48:41 +01:00
Kenneth Skovhede 9a849a2b58 Improved support for cross-os restores.
This fixes #1302
This fixes #1983
2017-01-06 23:01:54 +01:00
Kenneth Skovhede 179290d521 Added more extensive listing to further pinpoint the source of the error in #1400 2017-01-05 22:15:59 +01:00
Kenneth Skovhede 76aae5de7b Changed the logic for getting the last-modified timestamp from the database.
Now we only look at the timestamp from the previous fileset, instead of for the last time the file was seen.
This should improve lookup times, and thus the running time for backups with many files.

This change means that the following sequence of operations will react differently:

- backup
- delete file
- backup
- undelete file
- backup

Prior to this commit, the undeleted file would be seen with the original timestamp and thus can avoid being scanned for changes.
After this commit, the file will be treated as a new file, even if it has the previous timestamp and will thus be scanned for changes.

An additional switch has been introduced, --check-filetime-only that improves the lookup further by not looking at the metadata or filesize, and thus makes a much lighter call to the database, where fewer tables need to be touched.
2017-01-05 10:03:32 +01:00
Kenneth Skovhede 9a227ada6b Reworked the cleanup process to allow a dangling filelist, such that this dangling entry can be used as the basis for a synthetic filelist.
Also added an option to disable synthetic filelists.
This fixes #2038.
This fixes #2101
2016-12-24 11:42:26 +01:00
Kenneth Skovhede 3182a227b9 Added additional debug info for tracing the cause of issue #1400 2016-12-23 17:04:12 +01:00
Kenneth Skovhede d8972b0f2b Removed unused memory cache code 2016-12-16 17:30:39 +01:00
Kenneth Skovhede c1c8c9a1aa Merge branch 'master' into concurrent_processing
Some changes were required for this merge,
now the StreamBlockSplitter process will take in any stream, store the blocks and return the blockset ID.
This makes it compatible with the changes for metadata handling where they support more than a single block of metadata.

# Conflicts:
#	Duplicati/Library/Main/Database/LocalDatabase.cs
#	Duplicati/Library/Main/Database/LocalRepairDatabase.cs
#	Duplicati/Library/Main/Operation/BackupHandler.cs
#	Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs
2016-10-18 13:27:36 +02:00
Kenneth Skovhede 309bf1648d Merge branch 'master' into feature/fix_for_different_blockhash_and_filehash_plus_multiblocks_metadata
# Conflicts:
#	Duplicati/Library/Main/Database/LocalDatabase.cs
#	Duplicati/Library/Main/Database/LocalRecreateDatabase.cs
#	Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs
#	Duplicati/UnitTest/BorderTests.cs
2016-10-17 13:28:27 +02:00
Kenneth Skovhede 94c5e10480 Merge branch 'master' into concurrent_processing
# Conflicts:
#	Duplicati/Library/Main/Database/LocalBackupDatabase.cs
#	Duplicati/Library/Main/Database/LocalDatabase.cs
#	Duplicati/Library/Main/Database/RemoteVolumeEntry.cs
#	Duplicati/Library/Main/Operation/BackupHandler.cs
#	Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs
#	Duplicati/Library/Main/Operation/RepairHandler.cs
#	Duplicati/Library/Main/Operation/RestoreControlFilesHandler.cs
2016-09-16 10:33:07 +02:00
Kenneth Skovhede 0c68daff6c Fixed all whitespace to be 4 spaces instead of tabs 2016-09-15 11:39:27 +02:00
Kenneth Skovhede f0c0fc3a2e Merge branch 'master' into concurrent_processing
# Conflicts:
#	Duplicati/Library/Main/Database/LocalDatabase.cs
#	Duplicati/Library/Main/Duplicati.Library.Main.csproj
#	Duplicati/Library/Main/Operation/BackupHandler.cs
#	thirdparty/CoCoL/CoCoL.dll
2016-08-08 15:03:42 +02:00
FootStark 568cc60856 Fixed lookup of a file's last entry during backup
- Fixed SQL to create temp table for lookup of last backup's file
entries
- Removed temp table by writing directly to internal lookup struct.
- Direct lookup of single file entries from DB
2016-05-06 00:14:03 +02:00
Kenneth Skovhede 742eab0913 Fixed multiple cases where connections and command instances were not disposed.
This should fix all cases of "File is locked" on windows.
2016-04-06 20:40:34 +02:00
Kenneth Skovhede 66eb681541 Fixed issues that arose when using multi-threaded execution 2016-04-05 23:29:14 +02:00
Kenneth Skovhede 72b33bcf93 Extra fixes to support larger metadata (up to appx 300 mb with default blocksize) 2016-04-03 23:54:52 +02:00
Kenneth Skovhede e40bd7f02a Proposed version, not complete with handling large metadata chunks 2016-04-03 23:10:47 +02:00
Kenneth Skovhede 537fe20838 Added a lot of comments.
Fixed a few issues that caused parallel uploads.
Fixed the use of the encryption module so the encryption module is not re-used for multiple jobs.
2016-02-25 19:15:51 +01:00