Commit Graph
131 Commits
Author SHA1 Message Date
Daniel Gehriger 7d2c6befb0 Using USN journal in CountFilesHandler 2020-08-17 15:08:15 +02: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
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
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
Sean Templeton 3b6306b556 Fix exceptions caused by Stop Now
The LocalDatabase class was deleting from the BlocklistHash table based on the volume id of blocks. The deletes for the Blockset and BlocksetEntry tables were using a union query which included the same query the BlocklistHash delete was using. Changed the BlocklistHash delete query to use the union as well to ensure that all three tables would use the same query to delete the necessary rows. This fixes the "Detected non-empty blocksets with no associated blocks!" error.

Moved a write call in the DataBlockProcessor to send a volume for upload after setting blockvolume to null. This prevents a null reference exception because otherwise it would be sent to the SpillCollector and it tries to add a block, but the volume has already been closed.

Added the ? operator to the RegistryUtility class to prevent a null reference exception while debugging. It was annoying catching it in the debugger.

Fixes #4037
2020-01-05 21:43:56 -06:00
Kenneth Hsu 83ac03843d Fix spelling errors in comments.
In doing so, we also normalized some line endings.
2019-12-14 09:52:55 -08:00
Kenneth Hsu 0f30604046 Add comment clarifying partial fileset in synthetic filelist. 2019-11-30 13:38:04 -08:00
Kenneth Hsu cd08ca919a Include fileset file in synthetic filelist.
We declare this to be a partial backup, with the presumption being that
a synthetic filelist is only created when a backup is interrupted.

This concerns issue #3982.
2019-11-21 19:14:48 -08:00
Fish 3cf01b7297 Advance the progress bar when files are skipped. Fixes #3407.
According to the current implementation, the progress bar does not advance
when files are skipped by FilePreFilterProcess. This causes users'
confusion since the web frontend will get stuck at a certain stage for a
long time. This commit addresses this issue.
2019-11-03 21:34:21 -07:00
Kenneth SkovhedeandGitHub 579f9911d5 Merge pull request #3938 from warwickmm/bugfix/wrong_dblock_in_dindex
Ensure that dindex references correct dblock file after renames
2019-10-19 14:19:11 +02:00
Kenneth Hsu 1c492647ae Rename method parameter for consistency. 2019-10-05 11:25:22 -07:00
Kenneth Hsu 0cdc5b9159 Ensure that dindex contains correct dblock file after renames.
When support for parallel uploads was implemented, we overlooked a case
where a failed put of a dblock file is retried with a different
filename.  In this case, an instance of TemporaryIndexVolume was created
in the DataBlockProcessor or SpillCollectorProcess prior to the
attempted put.  The put would fail, and then retried with a different
filename.  While the Remotevolume table in the database would reflect
the new filename, the TemporaryIndexVolume still contained a reference
to the old dblock filename.  This would cause issues in direct restores,
etc., when the referenced dblock file could not be found.

Now, the TemporaryIndexVolume is only created after the dblock put has
completed.

This addresses issue #3932.
2019-10-05 10:46:39 -07:00
Kenneth Hsu 614ccaf79d Convert duplicated static methods into instance method. 2019-10-04 21:37:33 -07:00
Kenneth Hsu 8d7c6c6e21 Ensure that filelist is always written to dlist files.
This fixes a regression introduced around revisions e0899a2a91 ("add
method to add the filelist file") and 3b5af1cf01 ("add method to add
filelist file"), where the filelist was not written by all usages of the
FilesetVolumeWriter.  Previously, one would have to invoke
AddFilelistFile with each usage.  Now, we simply do so when the
FilesetVolumeWriter is closed.

We also modified the UploadSyntheticFilelist so that the usage of the
FilesetVolumeWriter is contained in a using statement, which will ensure
that it is disposed.

This fixes issue #3924.
2019-09-27 20:35:06 -07:00
BlueBlock 3b5af1cf01 add method to add filelist file
This is part of correcting the way the dlist zip file is created. We now have a method to take the memorystream and put the file into dlist.
2019-09-10 13:12:21 -04:00
BlueBlock 0685e61285 method refactored to include actual IsFullBackup state 2019-09-10 12:56:04 -04:00
BlueBlock efb24d085e Merge remote-tracking branch 'upstream/master' into fix-stop-after-current-file 2019-08-31 14:12:14 -04:00
BlueBlock 42342f30be move new stream to Utility 2019-08-27 23:48:07 -04:00
BlueBlock c07411acb7 resolve codacy issues 2019-08-27 14:34:34 -04:00
BlueBlock 146b98ae4c initial fix for issue1400 2019-08-27 14:09:43 -04:00
BlueBlock 08e2c18185 add handling of a partial backup
- add backup state to DB table 'fileset' (job database upgrade to version 10)
- modify the Restore page dropdown to display if a backup is "partial"
- modify retention logic to remove partial backups only when the next recent full-backup has been removed
2019-08-05 20:14:05 -04:00
BlueBlock e52cef304b codacy fixes applied 2 2019-08-02 13:54:30 -04:00
BlueBlock 4407d24f5d codacy fixes applied 2019-08-02 13:48:50 -04:00
BlueBlock 14e6068a5f Also stop the file enum process when the user has cancelled
The file enumeration process should also stop when the user has cancelled the operation.
2019-07-24 15:58:44 -04:00
BlueBlock b416c6c78b fix - do not throw exception in case where user has asked to cancel 2019-07-24 15:02:30 -04:00
BlueBlock ba1c9bac21 resolve codacy issues 2019-07-23 11:14:06 -04:00
BlueBlock 29a1a7c618 fix stop after the current file
'stop after upload' is now
stop after the current file' and the operation will cleanly allow the current file to complete.
2019-07-23 10:35:33 -04:00
Kenneth Hsu 7fd815b56e Simplify comment. 2019-07-06 15:34:46 -07:00
Kenneth Hsu c149792973 Dispose Backends after upload operations.
This addresses issue #3808.
2019-07-06 15:33:59 -07:00
Kenneth Hsu bfa3c120e5 Make Worker implement IDisposable.
This will allow the underlying Task and Backend to be disposed.
2019-07-06 12:50:37 -07:00
Kenneth Hsu 914203c071 Reorder methods alphabetically. 2019-04-06 21:42:01 -07:00
Kenneth Hsu e3c16c58fd Set flushed result after all tasks have completed. 2019-03-31 19:41:09 -07:00
Kenneth Hsu be21e09db1 Cancel the FlushBackend task if upload exception occurs.
This should avoid the problem of something awaiting a
FlushBackend.LastWriteSizeAync task that may never complete.
2019-03-31 19:41:09 -07:00
Kenneth Hsu 9a80e422e9 Remove unnecessary try-finally.
The only code in the finally block was to set the result of the
FlushRequest if the completed task was not faulted.  This could be done
without the try-finally.
2019-03-31 19:38:42 -07:00
Kenneth Hsu fdb2c6788c Ensure that failed put operations throw exception.
The FlushBackend method uses Task.WhenAny to await the first completion
of the uploader task or the flush request.  Since the uploader was
setting the status of the flush request in the finally block, the flush
request would complete first when an exception was thrown, causing the
uploader's exception to be unobserved.  To resolve this,  we check that
the uploader's status is not faulted before setting the flush request
status.

This addresses issue #3673.
2019-03-31 19:38:40 -07:00
Sean Templeton 8be3203aa2 Fix index files not being created for full dblock files
As part of the parallel upload changes a bug slipped in where a check was
being made if the index volume writer exists before creating said index
volume writer. Fixed by changing the test to check if the temporary index
volume exists and then creating the writer for the index file.
2019-03-30 19:55:36 -05:00
Kenneth Hsu da4dabe838 Fix typo in async property name. 2019-03-28 20:53:55 -07:00
Sean Templeton b02b19e683 Change Put method name to PutAsync 2019-03-17 18:28:45 -05:00
Sean Templeton 19c1c908df Check upload throttle speed every 2 seconds
The upload throttle speed was being checked on average once every
5 milliseconds.

Changed a few variable names.
2019-03-13 21:51:06 -05:00
Sean Templeton cc3e94fece Fix code review comments and other minor changes
- Rename indexVolume to indexVolumeWriter in DataBlockProcessor to reduce
confusion.

- When flushing the remaining uploads, check the tasks for exceptions in
completion order rather than waiting for them all at once. If there is an
exception all other uploads are cancelled anyway.

- Remove setting the operation progress as Backup_WaitForUpload in the
BackendUploader since the BackupHandler sets it.

- Use an exception filter in BackendUploader.

- Use Options property MaxUploadPrSecond instead of getting the raw value.
2019-03-13 21:51:06 -05:00
Sean Templeton 8bd4b825c8 Fix several Codacy issues 2019-03-13 21:51:05 -05:00
Sean Templeton 61f511c087 Properly catch exceptions from an upload and cancel all other uploads
If a backend throws an exception while uploading, cancel other uploads and
throw an exception from the BackendUploader. Exceptions from cancelled
uploads are caught and not thrown so as to not spam the user with useless
information.
2019-03-13 21:51:02 -05:00
Sean Templeton ac08aa2fb1 Dynamically throttle and track the progress of concurrent uploads
Changed AddBackendEvent() in ResultClasses to allow the option to not update
the backend progress. This allows the  BackendUploader to log the act of starting
an upload without changing the backend progress. The backend progress is now
handled by a new class, FileProgressThrottler, which will determine the transfer
rate of all uploads currently in progress.

This class also handles throttling the upload streams. The algorithm will try
to decrease or increase the streams throttle rates as appropriate by changing
the value based on the over/under amount or based on a percentage to prevent
throttling one stream directly to zero.
2019-03-05 21:25:35 -06:00
Sean Templeton 12b15c09c8 Add asynchronous-concurrent-upload-limit option
This new option limits the number of concurrent uploads allowed when
performing asynchronous uploads. The default value is 4.
2019-03-05 21:25:35 -06:00
Sean Templeton 0c122ff550 Change IBackend and IStreamingBackend to return Task for Put() 2019-03-03 21:43:10 -06:00
Sean Templeton 3de04da39e Run each upload on a separate thread
Added a small Worker class, private to the BackendUploader, to track the
upload tasks and the backend for each task.
2019-03-03 21:43:00 -06:00
Sean Templeton 1029d99e10 Simplify BackendUploader and remove unnecessary code 2019-03-03 21:42:58 -06:00
Sean Templeton 05c3f4808c Move encrypting, hashing, and creating index volumes out of BackendUploader
Encrypting, hashing, and creating index volumes are now done
in the DataBlockProcessor and the SpillCollectorProcess. This allows
uploads to always be transferring data and not have to stop to create
a file, encrypt data, etc.
2019-03-03 21:41:09 -06:00
Sean Templeton 4f4529a88a Move upload related code from BackendHandler to BackendUploader
As the BackendUploader is in charge of uploads the code has been moved
there to centralize the responsibility and prepare for parallel uploads.
2019-03-03 21:35:09 -06:00
Kenneth Hsu 224a895975 Fix spelling error in log message id. 2019-02-19 20:23:07 -08:00