Commit Graph
162 Commits
Author SHA1 Message Date
Kenneth SkovhedeandGitHub 2632ba8164 Merge pull request #6625 from duplicati/bugfix/restore-deadlock-timer-better-start
Bugfix/Better starting time for restore deadlock detection.
2025-11-15 11:04:25 +01:00
Kenneth Skovhede 43d38efdd3 Fixed remaining warnings 2025-11-14 16:09:05 +01:00
Carl Johnsen d48afd7496 Check the database for volume sizes reported in remotevolume 2025-11-10 14:56:20 +01:00
Kenneth Skovhede 230d80642a Fixed invariant formatting helpers
This fixes an issue with formatting for invariant values that was caused by incrorrect function overload selection.

To avoid future issues, the two similar functions have been renamed to clarify what they are working for.
2025-09-25 11:14:54 +02:00
Carl Johnsen 7670ea9a58 Ensured that all values that are passed to interpolation strings have been passed through FormatInvariant to prevent SQLite errors related to string formatting cultures. 2025-09-05 14:11:05 +02:00
Carl Johnsen b3fe276a13 Ensured that all temporary tables uset the same type of generated guid name 2025-09-05 14:06:55 +02:00
Carl Johnsen 44c8793eaa Changed the cache evict flag in BlockRequest to be an enum, as there are now more than 2 types of block request 2025-08-08 12:38:08 +02:00
Carl Johnsen 79b63ee4b2 Fixed race condition on creating and disposing SqliteCommands from multiple threads sharing the same SqliteConnection 2025-06-24 12:04:31 +02:00
Carl Johnsen 2412800c0c Removed the sqlite page cache option. It should be set through the environment variable, or some other way of providing a custom database configurotion 2025-06-19 11:41:39 +02:00
Carl Johnsen 488d531bd5 Made the LocalRestoreDatabase methods accept a cancellation token 2025-06-19 07:54:53 +02:00
Carl Johnsen bc97eaf71b Removed redundant calls to a SqliteCommand.Parameters.Clear() 2025-06-18 12:06:20 +02:00
Carl Johnsen 9ac583db94 Made all relevant using statements use await to use DisposeAsync 2025-06-18 11:53:11 +02:00
Carl Johnsen f221098c28 Formatted SQL queries - mainly adding double quotes where they were missing. 2025-06-18 10:42:08 +02:00
Carl Johnsen ae633fe0e8 Added more docstrings 2025-06-18 07:42:57 +02:00
Carl Johnsen 86b75b395a LocalRestoreDatabase.IBlockMarker now implements IAsyncDisposable 2025-06-18 06:44:18 +02:00
Carl Johnsen 2296d040a2 LocalRestoreDatabase.IFilesAndMetadata now implements IAsyncDisposable 2025-06-17 22:15:57 +02:00
Carl Johnsen 1f97832546 Classes implementing DisposeAsync should also implement the interface 2025-06-17 15:11:25 +02:00
Carl Johnsen 3d11a05400 Added .ConfigureAwait(false) to all of the await statements 2025-06-12 08:34:29 +02:00
Carl Johnsen bc52522f3b A lot of the SELECT SQL queries don't have to commit. Especially not the ones returning an IAsyncEnumerable as that can leave a query execution as open, while the transaction is committed elsewhere. 2025-06-05 14:44:25 +02:00
Carl Johnsen 507087df1d Calling close on the connection, as that calls the backend directly, and not through the IDb interface 2025-06-05 09:13:40 +02:00
Carl Johnsen 3db2010b1a Ordering of the list of blocks to restore was not ensured to be in the correct order. 2025-06-04 10:32:49 +02:00
Carl Johnsen 6c6378c014 Fixed missing dollar sign 2025-06-04 10:32:19 +02:00
Carl Johnsen bd493638af Merge branch 'master' into performance/mssqlite-async 2025-06-02 10:39:33 +02:00
Kenneth Skovhede f592029c3d Fixed rare deadlock on restore failure 2025-05-28 14:35:00 +02:00
Carl Johnsen ee40767412 Merge branch 'master' into performance/mssqlite-async 2025-05-27 12:04:50 +02:00
Carl Johnsen 0d37608cb7 Each method in the DirectBlockMarker now sets the transaction upon calling to ensure that other outer methods don't commit (and thus invalidate the reference to) the transaction 2025-05-27 09:25:23 +02:00
Carl Johnsen 1861d90450 Made the DirectBlockMarker hold a reference to the database instead of it's inner transaction to more closely resemble the other helper classes 2025-05-27 09:23:34 +02:00
Carl Johnsen 09490b835b Accidentally committed the inner transaction instead of the outer 2025-05-27 09:22:30 +02:00
Carl Johnsen 0ebcad0b85 Removed unnecessary (and incorrect) unpacking of an SQL query 2025-05-27 09:22:08 +02:00
Carl Johnsen da487182ae Connection pool in RestoreDatabase now has a transaction associated with each connection 2025-05-23 15:46:30 +02:00
Kenneth Skovhede 721e497e69 Fixed nullability warnings 2025-05-23 11:46:37 +02:00
Carl Johnsen 9693840611 Updated one call that went from Task<IEnumerable> to IAsyncEnumerable 2025-05-22 06:47:38 +02:00
Carl Johnsen d45e977d53 Found more factory construction inconsistencies 2025-05-21 08:47:24 +02:00
Carl Johnsen 3e3a9b5aa9 More SQL query restructuring 2025-05-20 06:07:45 +02:00
Carl Johnsen bdaa976f6b Changed LocalRestoreDatabase to pass the ReusableTransaction instead of its inner transaction 2025-05-19 10:49:22 +02:00
Carl Johnsen 2dabf56c82 Additional SQL query whitespaces 2025-05-19 10:46:50 +02:00
Carl Johnsen cb4e9eb657 Made the LocalDatabase constructor protected to ensure that derived classes won't call the obsolete warning throwing constructor. 2025-05-19 06:40:18 +02:00
Carl Johnsen 1a0c6dcb37 Restructered SQL statements, ensured all calls to the database are async, and that commands are created using a chan of method calls rather than a sequence of statements 2025-05-16 15:49:40 +02:00
Carl Johnsen 88f5fbb963 Moved async code from constructors to factory functions 2025-05-16 15:48:27 +02:00
Carl Johnsen 43dc194acd Changed heavy properties of LocalRestoreDatabase to methods instead 2025-05-16 15:40:04 +02:00
Carl Johnsen 44c037e864 Implemented factory construction of LocalRestoreDatabase 2025-05-16 13:44:57 +02:00
Carl Johnsen f443331cca Removed import to ensure old way of accessing database isn't hit 2025-05-16 12:21:24 +02:00
Carl Johnsen 19009011b2 Updated LocalRestoreDatabase to async using Microsoft.Data.Sqlite 2025-05-16 12:21:24 +02:00
Kenneth Skovhede a271183b44 Merge branch 'fix-restore-duplicate' of github.com:Jojo-1000/duplicati into Jojo-1000-fix-restore-duplicate 2025-04-30 18:32:43 +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 faede65d8d Changed transactions to use a wrapper that ensures a transaction is allocated. 2025-04-14 12:04:00 +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 defb5a385b Added LocalRestoreDatabase 2025-04-03 09:00:55 +02:00
Carl Johnsen f73d3390cd The FileProcessor now works in two phases: first it restores the files, then they restore the folder metadata, unless specified otherwise. 2025-03-24 20:24:37 +01:00