Commit Graph
24 Commits
Author SHA1 Message Date
Kenneth Skovhede 51bcec3efc Style cleanup, named tuples.
Fix indentation.
Move metadata check up.
2025-05-09 17:34:09 +02:00
Kenneth Skovhede fe866ceb9f Implemented support for repairing the database when only parts of the source data is available.
This repair will leave the database in a still-broken state, but if this is run prior to purge-broken-files, less data will be lost.

Also updated the purge-broken-files operation to keep files and directories in the set, if they are only missing metadata.
2025-05-09 11:12:29 +02:00
Kenneth Skovhede 39dca1eb79 Improve list-broken-files output
This hand-picks the changes from #5049 by @gpatel-fr.

The change is to use a left-join to include all broken files, even if there are no entries in the Blockset table.

The update is only visual but makes the results consistent with the actual operation performed by purge-broken-files.

This close #5049
2025-04-30 09:22:24 +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 0b735d79ff More cleanup and a few bug fixes 2025-04-03 16:38:51 +02:00
Kenneth Skovhede 0638afb8b8 Fixed some nullable support 2025-04-03 15:25:20 +02:00
Kenneth Skovhede 7b948a2f1d Fixed issue with SQLite bindings not supporting arrays.
Added helper class to wrap values in a temporary table if they exceeed the maximum number of parameters.
2025-04-02 23:26:20 +02:00
Kenneth Skovhede 53a1d2a723 Added LocalListBrokenFilesDatabase 2025-04-02 14:06:06 +02:00
Kenneth Skovhede fe1cef3be8 Move away from positional parameters in SQL statements.
This is a move away from using positional parameters in SQL statements and rok towards only using named parameters.
2025-03-18 22:41:11 +01:00
Kenneth Skovhede bb1aa8e1f7 Cosmetic cleanup
Removed superfluous namespaces.
Using `var` most places.
Using extension methods for common setup of commands.
2025-03-14 14:34:56 +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 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 448b6e0e03 Fixed typo 2024-11-01 16:54:39 +01:00
Kenneth Skovhede a7e57c2ffb Added DuplicateBlock to the list of items purged. 2024-11-01 16:06:41 +01:00
Kenneth Skovhede 1809ffac09 Added a fix from #4982 that deletes additional information from the database when removing broken files. 2024-11-01 16:06:20 +01:00
Jojo-1000 55284410c7 Fix sql queries that use double quoted strings.
Closes #5202
2024-05-30 00:00:48 +02:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Kenneth Skovhede 8ac99e83b7 Merge branch 'master' into feature/fix_path_storage2 2018-06-28 10:51:11 +02:00
Kenneth Skovhede cbc18970d5 Re-applied the path-storage fix as the merge failed somehow 2018-06-14 10:12:24 +02:00
Tyler Gill 8acc9ba5c9 Blocksets with a length of 0 are not broken if the block they reference by hash is not listed. 2018-05-24 15:22:05 -06:00
Tyler Gill bbdf4c2747 Add more broken file detection:
Blocksets with either blockset entires or blocklist entries that refer to invalid / unreachable blocks are now treated as broken as well.
2018-05-21 10:16:51 -06:00
Tyler Gill b5931b2771 Adds a check for BlocksetIDs that don't have any corresponding BlocksetEntrys to the broken fileset check.
Bug #3210 (and several other possibly related ones) had cases where a recreated database would have these invalid blockset IDs.
It seems like they were caused by filesets referring to a blockset by hash, but not having any index or block file actually containing the block for that hash.
Also fixes countMissingInformation query - it should join with missingBlocklistVolumes, rather than missingBlocklistEntries, as it is selecting the VolumeID.
2018-05-17 08:11:13 -06:00
Kenneth Skovhede 1108d51d7f Implemented a new new list-broken-files and purge-broken-files command for the commandline to assist with handling remote file loss. 2017-01-05 16:46:01 +01:00