Commit Graph
682 Commits
Author SHA1 Message Date
Kenneth SkovhedeandGitHub 07da5662ff Merge pull request #5105 from Jojo-1000/fix-backend-requests-retired
Catch RetiredException in BackupHandler to avoid StopNow race condition
2024-03-04 13:33:58 +01:00
Kenneth Skovhede d16d702975 More fixes for stray using directives 2024-02-28 20:42:33 +01:00
Kenneth Skovhede 40dd3c6816 Updated all license mentions to MIT 2024-02-28 15:45:30 +01:00
Jojo-1000 929e61f6b4 Catch RetiredException in BackupHandler to avoid StopNow race condition. 2024-02-22 18:48:44 +01:00
gpatel-frandGitHub 396f7dfebe don't report backup as failed if all tests problems are 'extra' (#5074)
these problems don't block database rebuilding so it's not
a good thing to fail the backup.
Also fix erroneous message for ListAndIndexes
2023-12-23 14:25:28 +01:00
gpatel-frandGitHub 0de4cb7968 allow full-remote-verification to target only list and index files (#5037)
The option is turned into an enum with values True, False, ListIndexes
True and False are for compatibility with the existing backups.
ListIndexes is equivalent to True but don't handle block volumes.
This is to make more workable a strategy of full remote testing
after each backup.
2023-12-10 00:24:07 +01:00
gpatel-frandGitHub af4fd5af05 change error reporting for full backup remote verification (#5004)
Before the change, it could happen that when the postbackup test
was finding problems in the backend, the job would be reported
as having completed successfully, the found problems being displayed
only in the complete log. After the change, an error is logged
that cause the job to be failed.
To repro, the following procedure can be used in a test backup:
change a hash for a block in the block table database and run a backup having set
--full-remote-verification and --full-block-verification to true and
--backup-test-percentage to 100.
2023-12-10 00:23:16 +01:00
gpatel-frandGitHub ec9d49d684 Experiment/rebuildfaster (#5043)
* experimental faster db rebuild (#4955)

* try run update db query for every block file only when needed
add repair-force-block-use option
more appropriate naming for some routines
more tracing
more comments
2023-11-05 18:19:08 +01:00
gpatel-frandGitHub 43dea88b4f enable to perform tests without checking file list (#5054)
following the option --disable-filelist-consistency-checks
2023-11-04 14:25:59 +01:00
Janandgpatel-fr b894a197a9 Fix missing file error caused by interrupted compact.
Before the dindex files are deleted on the remote, update the state in the database to Deleting. Previously, only dblock files were handled this way.
Patch by warwickmm
Closes #4129
2023-09-21 22:56:52 +02:00
Riccardo Paolo Bestetti 528478fda4 Implement exponential backoff for backend errors 2022-01-20 23:22:08 +01:00
Kenneth Hsu e90eb3b2a3 Create custom Exception for remote list verification failures.
Previously, we would catch any Exception thrown by VerifyRemoteList and
perform an auto-cleanup (if specified in the options).  However, we
should only perform the auto-cleanup if VerifyRemoteList detected an
issue with the uploaded files.  Otherwise, an unrelated exception can
cause the database repair to be performed unnecessarily.  In the case of
a connection issue, this can leave the database in a corrupted state.

This fixes #4516.
2021-05-20 13:42:41 -07:00
Kenneth SkovhedeandGitHub e070af3dd1 Merge pull request #4386 from warwickmm/catch_symlink_read_error
Catch and log exceptions encountered when getting symlink target
2020-12-19 15:02:09 +01:00
Kenneth SkovhedeandGitHub ca073a2d0c Merge pull request #4380 from warwickmm/fix_purge_broken_files_dry_run
Fix error encountered during dry-run of purge-broken-files
2020-12-19 14:44:21 +01:00
Kenneth SkovhedeandGitHub 8002d3d225 Merge pull request #4376 from warwickmm/fix_indentation
Fix incorrect or misleading indentations
2020-12-19 14:43:31 +01:00
Kenneth Hsu a39a24beae Catch and log exceptions encountered when getting symlink target.
Since the GetSymlinkTarget method can throw an exception, we should log
the failure case and avoid further processing of the symlink target.

This concerns #2171, which describes issues with symlinks created using
Windows Subsystem for Linux.
2020-12-06 10:08:46 -08:00
Kenneth Hsu 9952babf0b Commit or rollback transaction before beginning new ones.
The PurgeFilesHandler begins new transactions using the same database
connection.  During a dry-run, these transactions are rolled back, and a
subsequent attempt to rollback in the PurgeBrokenFilesHandler then
resulted in an exception.

To avoid this, we perform the rollback in the PurgeBrokenFilesHandler as
soon as we can.

I'm not entirely confident that this is the correct fix, but it appears
to resolve issue #4379.

This fixes #4379.
2020-11-30 19:55:20 -08:00
warwickmmandGitHub 1c3065aa81 Merge pull request #4336 from barfoo4711/master
Add logging statements for issues encountered when restoring empty files.
2020-11-22 10:23:06 -08:00
Kenneth Hsu 47270d1979 Change log level for entry regarding restoring empty files.
Restoring empty files is expected to be quick, so profiling is not
necessary.
2020-11-22 09:05:25 -08:00
Kenneth Hsu 8b010888e2 Make log entries for restore errors consistent.
This concerns #4315.
2020-11-22 09:05:25 -08:00
Kenneth Hsu 31a4eab7e7 Fix casing in log entry. 2020-11-22 09:05:25 -08:00
Kenneth Hsu 5951047ff1 Fix incorrect or misleading indentations.
This also adds braces to clarify scope where beneficial.
2020-11-21 13:58:16 -08:00
Sean Templeton a9c16fcefa Upload filesets last during a backup
If parallel uploads are enabled it is possible for the fileset to be uploaded before all dblocks are uploaded.
When the fileset is placed in the queue to be uploaded place it in a separate list and only upload it after all dblocks have been uploaded.

Fixes #4341
2020-10-29 21:19:15 -05:00
Kai 8b1d2cfafa Merge branch 'master' of https://github.com/barfoo4711/duplicati into master 2020-10-03 14:20:08 +02:00
Kai 8e3a52654b Update RestoreHandler.cs
fixed #4315 by adding catching of exceptions when creating empty files Not sure if it is ok to create WARN messages or if it should be ERROR messages instead
2020-10-03 14:09:50 +02:00
Kenneth Hsu dd902ce7b2 Remove misleading comment.
The retention policy logic was changed, and this comment was leftover
from the old implementation.

https://forum.duplicati.com/t/new-retention-policy-deletes-old-backups-in-a-smart-way/2195/34?u=ts678

This fixes #3306.
2020-09-03 19:48:47 -07:00
Daniel Gehriger 7d2c6befb0 Using USN journal in CountFilesHandler 2020-08-17 15:08:15 +02:00
Kenneth Hsu be44b785ce Remove unnecessary local variable. 2020-07-01 16:50:29 -07:00
Kenneth Hsu 3aa1d2f3da Ensure that paths exist when restoring empty files.
This fixes #4148.
2020-07-01 16:13:32 -07:00
Kenneth SkovhedeandGitHub 5168d05ebf Merge pull request #4161 from warwickmm/refactor/verify_remote_list_setup
Remove boilerplate code in calls to VerifyRemoteList
2020-05-10 21:04:42 +02:00
Kenneth Hsu de1b89167b Rename local variable. 2020-04-05 12:00:51 -07:00
Kenneth Hsu d92a436bad Fix spelling error in local variable name. 2020-04-05 11:46:32 -07:00
Kenneth Hsu b53770b589 Add VerifyRemoteList overload to reduce duplicated code. 2020-04-05 11:46:08 -07:00
Kenneth Hsu 0c9ca9a75c Remove unused BackendHandler members. 2020-03-29 16:48:19 -07: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 SkovhedeandGitHub c95def65f5 Merge pull request #4122 from warwickmm/fix_upload_retry_attempts
Fix log message for retried upload operations
2020-03-25 06:58:14 +01:00
Sean Templeton 9739517b0a Fix bandwidth throttling inconsistency
In code the throttling generally works backwards than what one would expect.
The streams that are throttled are the streams that operate on files from the local machine.
This fixes the download throttling not working and the upload throttling applying to
both uploads and downloads.

When doing a Put operation the stream on the local machine is reading from the
local filesystem and hence the upload throttle bytes per second needs to be
applied to the reading of the stream, not the writing.

Similarly when doing a Get operation the download throttle bytes per second needs
to be applied to the writing of the stream.

Fixes #4115
2020-03-04 19:57:48 -06: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
warwickmmandGitHub b1d1972cb8 Merge pull request #4114 from seantempleton/syntheticfilelist
Fix issue with synthetic filelist not being uploaded
2020-03-01 12:39:08 -08:00
Kenneth Hsu 197a15e032 Fix log message for retried upload operations.
The number of attempts is one (the first attempt) plus the number of
retries.
2020-03-01 12:07:05 -08:00
Rod Savard 1b0f5a8cb0 add descriptive reason for usn soft failure 2020-02-25 15:34:42 -08: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
Kenneth Hsu 19303614f0 Remove unnecessary call to ToString. 2020-02-18 17:50:26 -08:00
Kenneth Hsu 7e86486f59 Fix logs for custom retention policy to show backup times.
When we modified the code in revision
68ffd86594 (pull request #4018) to
consider collections of IListResultFilesets instead of DateTimes, we
neglected to preserve the backup times in the logs.

This fixes #4109.
2020-02-18 17:50:13 -08:00
warwickmmandGitHub 44f619b725 Merge pull request #4085 from drwtsn32x/improve-usn-snapshot-fails
Improve USN and Snapshot error handling
2020-02-06 19:36:42 -08:00
Rod Savard 235f94c96f change to use custom exception class 2020-02-06 06:34:49 -08:00
Rod Savard 63ddc52744 log warning not error when usn policy is On 2020-02-03 21:55:43 -08:00
Rod Savard ec8f897460 log information event when snap policy is Auto 2020-02-03 21:50:27 -08:00
Rod Savard 57d36df981 improve error msg on snapshot failure 2020-02-03 21:47:11 -08:00
Rod Savard a85c10fd8c move config hash calculation to UsnJournalService 2020-02-02 15:09:23 -08:00