Commit Graph
162 Commits
Author SHA1 Message Date
Carl Johnsen abc7c79841 Dispose made infinite recursion between different class derivations 2025-05-23 08:20:00 +02:00
Carl Johnsen dc4404e751 Added missing await 2025-05-22 15:28:35 +02:00
Carl Johnsen 22550be73c SQLite parameters are case sensitive. 2025-05-22 13:34:29 +02:00
Carl Johnsen 2cd1692532 Temporary fix to distinguish between new and legacy extension method 2025-05-22 13:25:42 +02:00
Carl Johnsen d11b4e58e7 Reworked the factory construction chains to forward an instantiated object where applicable 2025-05-21 07:24:36 +02:00
Carl Johnsen 3e3a9b5aa9 More SQL query restructuring 2025-05-20 06:07:45 +02:00
Carl Johnsen 0b508d2575 Started work on restructuring the SQL queries in LocalBackupDatabase. 2025-05-19 21:59:44 +02:00
Carl Johnsen d73a555647 Restructured the SQL queries in LocalBackupDatabase and made sure it's properly async 2025-05-19 15:43:55 +02:00
Carl Johnsen 48e6b61977 Purged IDb from LocalBackupDatabase 2025-05-19 14:40:00 +02:00
Carl Johnsen 4ab7f290a7 Updated LocalBackupDatabase to use factory construction 2025-05-19 13:19:24 +02:00
Kenneth SkovhedeandGitHub 171eb1bb12 Merge branch 'master' into feature/add-sqlite-cache-value 2025-04-23 16:34:55 +02:00
Kenneth Skovhede 3ff868b0f9 Removed tracking of files sizes, and implemented it with a database lookup 2025-04-23 15:39:32 +02:00
Kenneth Skovhede 0a7a1cd689 Added option to set the SQLite page cache
This adds an extra option to allow setting the SQLite page cache size as a regular option.

Prior to this commit it was only possible to set the SQLite page cache size via environment variables.

The option to use environment variables is preserved, and as options from the environment variable are applied after the new setting, environment variables take precedence.

The default value for the new option is to use 1% of the system memory for the page cache. For the restore process, a connection per worker may be made which defaults to half the number of cores, so the maximum amount of memory is 1% * half the CPU cores.

This is just the upper limit, and SQLite may choose not to use all of it.

This fixes #6178
2025-04-22 14:26:46 +02:00
Kenneth Skovhede 1095850965 Reworked the way deleted blocks are detected.
This should have a much lower performance impact.
2025-04-06 08:41:59 +02:00
Kenneth Skovhede cfad020ef2 Merge commit '61892a40d9aff663da86eda273505970268f6384' into feature/improve-block-reuse 2025-04-06 08:36:24 +02:00
Kenneth Skovhede 8b72528030 Re-implemented the change statistics calculation. 2025-04-05 21:42:05 +02:00
Kenneth Skovhede bb24036602 Fixed performance degradation after parameter queries 2025-04-05 09:25:10 +02:00
Kenneth Skovhede 0b735d79ff More cleanup and a few bug fixes 2025-04-03 16:38:51 +02:00
Kenneth Skovhede 2006556778 Fixed some more nullable support in the database layer 2025-04-03 15:46:20 +02:00
Kenneth Skovhede 9e3aa72d00 Added LocalBackupDatabase 2025-04-03 11:31:36 +02:00
Kenneth Skovhede f5061476c0 Merge remote-tracking branch 'origin/master' into feature/improve-block-reuse 2025-04-01 22:02:58 +02:00
Kenneth Skovhede 4a46918760 Additional cleanup in database files 2025-03-18 20:30:27 +01:00
Kenneth Skovhede 7234d43961 Fixed all SQL strings to use interpolation and forced them into the FormattableString handler using the invariant formatting. 2025-03-14 12:13:17 +01:00
Kenneth Skovhede f342d70819 Implemented forced invariant locale on all SQL strings.
This fixes #6023
2025-03-13 23:06:32 +01:00
Kenneth Skovhede be16323f24 General cleanup, common database validation exception 2025-03-10 14:38:45 +01:00
Kenneth Skovhede 9952e31f49 Fixed a bug where retention time was incorrectly parsed when reading from the database.
This effectively caused the retention time to be ignored when reading from the database.
Also moved some code related to finding an unfinished fileset into the common database class.
2025-03-08 15:13:03 +01:00
Kenneth Skovhede 9dfe977d3f Changed logic so the source providers are now logically mounted into the source directory structure.
This fixes the restore issues as all sources will now appear as if they were originally part of the source file system.

The backend implementation has now been simplified so the backends only return names of entries with no path information.  Most backends already do this, but the S3 backends did not, so this was fixed as well.

This also clears up the interfaces, so the backend does not know about the `ISourceProviderEntry`. All mapping is done by the `BackendSourceProvider`, making it simpler to support other backends as sources.
2025-02-21 16:06:55 +01:00
Kenneth Skovhede 1716d09b51 Fixed source providers for S3, CIFS, and SSH.
Made the SMBShareConnection slightly more robust.

Introduced v2 List API to S3 backend, currently it retains v1 as the default.

Changed S3 backends to not recurse, potentially making smaller listings. This option can be disabled if it breaks things.

Added support for relative paths in the SSH backend.
2025-02-21 13:20:52 +01:00
Kenneth SkovhedeandGitHub 9464caf622 Feature/update license 2025 (#5851)
* Fixed some minor whitespace issues

* Updated all copyright to 2025
2025-01-07 09:40:39 +01:00
Kenneth Skovhede f5cabd4c7f Remove --use-block-cache
The option has no effect.
This closes #3566
The block cache was added originally to work around perceived slow hash table lookups in the database.
By having an in-memory dictionary, lookups would be much faster.
It has no effect on disk wear, as the lookups are read-only.
The impact of such a cache was measured to be minimal with recent versions of SQLite.
2024-12-04 10:06:49 +01:00
Kenneth Skovhede cae5b218d4 Potential fix for the missing blocklist hash 2024-11-04 21:46:12 +01:00
Kenneth Skovhede 756cb6aef8 Added solution for re-using blocks from the DeletedBlock table.
As the check is done on the hot-path for the backup, it is split into two queries, where the first is done in the table only and the other is joining two tables.
This is based on the solution in #4982
2024-11-01 16:27:06 +01:00
Kenneth Skovhede 30a3410180 Changed strategy to check if block is known in a previous blockset.
If this fileset is the first containing the block in a blockset, we add it to the index file.
2024-10-31 15:30:25 +01:00
Kenneth Skovhede 6362dd3cf8 Updated query to remove warning from SQLite logging 2024-04-16 14:19:15 +02:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
tariandeath 396119aa40 Add indexes to improve backup query performance. 2022-02-26 20:24:14 -07: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
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 Hsu 13e1f0dac6 Remove unused Database members. 2020-03-14 16:45:08 -07: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 da08be84a6 Convert VolumeID to long instead of int 2020-02-29 16:43:10 -06: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
BlueBlock 488aed3823 fix merge 2019-09-07 15:02:10 -04:00
BlueBlock c8bb889f6d Merge remote-tracking branch 'upstream/master' into fix-stop-after-current-file 2019-09-07 11:27:20 -04:00
Kenneth Hsu 0a390bd31a Move NormalizeDateTimeToEpochSeconds method to Utility class. 2019-09-01 12:38:23 -07:00
BlueBlock c8df8c5354 move method to base 2019-09-01 13:12:03 -04:00
BlueBlock d82d146322 fix case of parameter 2019-08-30 11:16:12 -04:00