Commit Graph
899 Commits
Author SHA1 Message Date
Carl Johnsen 8814fdebcc Added more docstrings 2025-06-17 15:13:33 +02:00
Carl Johnsen 1f97832546 Classes implementing DisposeAsync should also implement the interface 2025-06-17 15:11:25 +02:00
Carl Johnsen 1ece8398b6 Reordered tuple to match name 2025-06-17 14:02:18 +02:00
Carl Johnsen e81100de04 Started on adding docstrings 2025-06-17 09:59:22 +02:00
Carl Johnsen 3d11a05400 Added .ConfigureAwait(false) to all of the await statements 2025-06-12 08:34:29 +02:00
Carl Johnsen ef5df3bd7a Changed property accessing database to be an async method 2025-06-11 14:32:18 +02:00
Carl Johnsen e5337e4d26 Formatted SQL queries 2025-06-11 12:09:58 +02:00
Carl Johnsen cb06275a81 Removed TODOs 2025-06-11 11:30:13 +02:00
Carl Johnsen 95dc884ab3 Removed unnecessary casts 2025-06-11 11:27:15 +02:00
Carl Johnsen 09251284ab Removed TODOs 2025-06-11 11:07:54 +02:00
Carl Johnsen da9334d174 Made ExpandInClaseParameterMssqlite generic to avoid casting 2025-06-11 11:07:41 +02:00
Carl Johnsen be550de081 Wrapped a database VACUUM in a transaction 2025-06-11 10:56:29 +02:00
Carl Johnsen fd5823a2f4 Found unformatted SQL queries in LocalTestDatabase 2025-06-11 10:54:02 +02:00
Carl Johnsen f373880c5a Renamed ExpandInClauseParameterAsync, as one of them isn't actually async.
Postfix mssqlite has been added as well to not clash with the IDb implementation
2025-06-11 10:47:40 +02:00
Carl Johnsen 9c2252f36c Ensured common order and interface for the async extension methods. 2025-06-11 10:46:04 +02:00
Carl Johnsen 1db0fc7789 Reordered the call trace of ExecuteScalarInt64Async 2025-06-11 10:06:55 +02:00
Carl Johnsen bbe409d564 Reordered the call trace of ExecuteScalarAsync 2025-06-11 10:01:40 +02:00
Carl Johnsen 16fdb633be Reordered the call trace of ExecuteReaderEnumerableAsync 2025-06-11 09:52:45 +02:00
Carl Johnsen 544ec85d87 Added missing combination of parameters to ExecuterReaderAsync 2025-06-11 09:48:09 +02:00
Carl Johnsen 7c9516eea0 Reordered the call trace of ExecuteNonQueryAsync 2025-06-11 09:42:51 +02:00
Carl Johnsen 1ab303caea Reordered the call trace of ExecuteReaderAsync 2025-06-11 09:34:50 +02:00
Carl Johnsen c1710cd6a4 Updated the database helper method for formatting SQL queries for logging 2025-06-11 09:33:30 +02:00
Carl Johnsen e946b3593a Handled TODOs in the database extension methods 2025-06-11 09:32:28 +02:00
Carl Johnsen f411260c03 Removed TODO in comments on newly introduced commits due to how the pre Microsoft.Data.Sqlite backend would make nested transactions 2025-06-11 09:11:35 +02:00
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