Commit Graph
875 Commits
Author SHA1 Message Date
Carl Johnsen 087ff65646 Removed synchronous helper method 2025-06-11 07:41:03 +02:00
Carl Johnsen 66ed9600b8 Removed unused synchronous helper method 2025-06-11 07:38:24 +02:00
Carl Johnsen 73c8471f8e Made BlocklistHashEnumerable and the code using it async 2025-06-11 07:37:22 +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 23509a27eb Disposing the database disposes the reusable transaction and creates it's own transaction for PRAGMA optimize 2025-06-05 09:15:17 +02:00
Carl Johnsen db7b81d3a1 Disposing a reusable transaction implicitly rolls it back 2025-06-05 09:14:17 +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 80389f7bc1 Incorrectly mimicked old way of executing SQL queries without a transaction 2025-06-04 09:33:12 +02:00
Carl Johnsen d78d7c2739 Added additional logging of SQL executions 2025-06-04 09:11:34 +02:00
Carl Johnsen abcb3569ff Added additional logging of SQL executions 2025-06-03 21:46:50 +02:00
Carl Johnsen 3bfe6eb349 Added additional context to commits without messages 2025-06-03 21:46:19 +02:00
Carl Johnsen 85e6f45338 Moved some of the commits to transactions outside of database methods, as this more closely mimics the commit flow of the old IDb backend.
This was especially needed due to the Microsoft.Data.Sqlite backend not supporting nested transactions.
2025-06-03 21:44:55 +02:00
Carl Johnsen caa3c13dbe Post master merge fixes 2025-06-02 11:50:35 +02:00
Carl Johnsen bd493638af Merge branch 'master' into performance/mssqlite-async 2025-06-02 10:39:33 +02:00
Carl Johnsen 04ffb4fb42 Fixed incorrectly merged changes in LocalDatabase 2025-06-02 09:16:25 +02:00
Kenneth SkovhedeandGitHub 0207ad1516 Merge pull request #6299 from duplicati/feature/correct-transfer-progress-api
Websocket subscriptions
2025-05-28 21:40:21 +02:00
Kenneth Skovhede f592029c3d Fixed rare deadlock on restore failure 2025-05-28 14:35:00 +02:00
Carl Johnsen ff2e8ddd68 Found an SQL query missing the transaction 2025-05-28 05:53:44 +02:00
Carl Johnsen c4d550572a Added missing quotes around table name containing a dash (-), which led to a syntax error 2025-05-28 05:53:14 +02:00
Carl Johnsen d2a34b600f Fixed typo on which integer was the one being saved during recreatedatabase 2025-05-27 18:37:09 +02:00
Kenneth Skovhede 3ebc50a89d Adding repair for index files
Since index files only contains information related to recreating the database, they can be recreated directly from a working database.

This PR adds an automatic repair feature that replaces index files if they are missing content. This will gradually repair remote index files if they are affected by the compact bug that re-wrote index files without the blocklists.

To fully repair, it is possible to run the `Test` command with the option `--full-remote-verification=indexonly` and a large number of samples. Since the new option `--replace-faulty-index-files` is default set to `true` this will repair any defective index files and ignore all others.

This update uncovered that the Test method would previously not verify the presence of blocklists in the index files. This is likely a very old bug, caused by the fact that the original implementation did not place blocklisthashes in the index files. The omission of this check is the reason the extent of the compact issue was not discovered earlier.

With this PR it is now also visible that there is ample room for error in creating the index files during the backup process. This is caused by the parallel processing and carry-over, where the index files are created on-the-go, so they are ready to upload once the blocks are filled.

While this is likely good for performance, it has some drawbacks.
- A failed block upload will cause a rewrite of the index file
- An elaborate callback system is needed to update the index file
- It is possible to race against the database and create extra blocklist hashes, bloating the index files (causes problems on verification)

A subsequent task is to rewrite the logic to not touch the index files outside the backend manager, so the backend manager will just use the database to create the index file. This means the same code will be invoked for both the create, the recreate, and the replacement.

For now, extra content in index files is logged with the verbose log level.

This fixes #6296
2025-05-27 17:15:02 +02:00
Carl Johnsen ee40767412 Merge branch 'master' into performance/mssqlite-async 2025-05-27 12:04:50 +02:00
Carl Johnsen 259f3dcf74 Fixed typo in SQL query parameter names 2025-05-27 09:39:35 +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 5463cdcf24 NOT keyword was accidentally removed from an SQL query. 2025-05-27 05:40:52 +02:00
Carl Johnsen b54bcba624 All commands should run in a transaction 2025-05-27 05:40:07 +02:00
Carl Johnsen 7fa181a759 Commit to ensure that changes are visible 2025-05-27 05:39:51 +02:00
Carl Johnsen e11d6377ac Construction chain was incorrect for LocalBackupDatabase 2025-05-26 09:06:42 +02:00
Carl Johnsen 5408570643 All SQL queries should be performed inside of a transaction 2025-05-26 09:03:21 +02:00
Carl Johnsen e57768f604 All transactions should be deferred 2025-05-23 15:46:58 +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 9419f225c0 Creating a new LocalRepairDatabase should close the database 2025-05-23 11:17:30 +02:00
Carl Johnsen 006efa875d Fixed missing increment 2025-05-23 11:16:30 +02:00
Carl Johnsen d0df1386cc Removed line that's also been removed on master 2025-05-23 11:16:17 +02:00
Carl Johnsen d27dec0a2f Updated methods to use the instance ReusableTransacition instead of starting a new one 2025-05-23 08:26:06 +02:00
Carl Johnsen abc7c79841 Dispose made infinite recursion between different class derivations 2025-05-23 08:20:00 +02:00
Carl Johnsen ad2d66ce2b Made ReusableTransaction automatically try to commit when disposing 2025-05-23 08:15:51 +02:00
Carl Johnsen afa468377b Fixed typo 2025-05-22 15:28:46 +02:00
Carl Johnsen dc4404e751 Added missing await 2025-05-22 15:28:35 +02:00
Carl Johnsen 344d3dcb5b The new backend requires a value to be set 2025-05-22 15:28:14 +02:00
Carl Johnsen 6c7e67dd28 Post master merge fixes 2025-05-22 14:35:15 +02:00
Carl Johnsen a37f0dda31 Merge branch 'master' into performance/mssqlite-async 2025-05-22 14:09:17 +02:00
Carl Johnsen 22550be73c SQLite parameters are case sensitive. 2025-05-22 13:34:29 +02:00
Carl Johnsen c5248e007f Construction chain of databases wrongfully tried to start multiple transactions 2025-05-22 13:33:10 +02:00