fix file count mismatch on restores that use recycled volumes#1330
Conversation
a13a88c to
8356e5c
Compare
core/src/dird/restore.cc
Outdated
|
|
||
| if (JobCanceled(jcr)) { CancelStorageDaemonJob(jcr); } | ||
|
|
||
| if (jcr->dir_impl->ExpectedFiles != jcr->JobFiles) { TermCode = JS_Warnings; } |
There was a problem hiding this comment.
Maybe it would make sense to set a boolean variable filecount_does_mismatch to true here and use that in line 442 so that we only have this check once.
There was a problem hiding this comment.
Strictly thinking, we have two possibilities here:
1: TermCode is currently JS_Terminated, then we update the TermCode to JS_Warnings and the -- warnings file count mismatch message
2.: Term Code is already JS_Warning and we have also a file count mismatch . Then we probably want to have -- with warnings and file count mismatch as message.
There was a problem hiding this comment.
how about I just make the file count mismatch a joblog warning instead of a termination message?
There was a problem hiding this comment.
If we can do that, it would be great. "Restore OK -- with warnings" with a reasonable error message would work for me.
There was a problem hiding this comment.
If we can do that, it would be great. "Restore OK -- with warnings" with a reasonable error message would work for me.
already done.
core/src/cats/sql_create.cc
Outdated
| "FirstIndex = (CASE when firstindex=0 then %lu else firstindex end), " | ||
| "StartBlock = (CASE when startblock=0 then %lu else startblock end), " | ||
| "StartFile = (CASE when startfile=0 then %lu else startfile end), " |
There was a problem hiding this comment.
Are we sure that firstindex, startblock and startfile are always > 0 in normal operation, and only the dummy place holder sets them to 0?
There was a problem hiding this comment.
only the dummy placeholder creates zero-filled jobmedia record, no other place in the code requires those fields to be zero.
There was a problem hiding this comment.
as we're overwriting placeholder data with real data, I would consider this safe (even though it isn't nice).
8356e5c to
ba90cfe
Compare
ba90cfe to
bb9aed5
Compare
A file count mismatch during restore only changed the result message, but not the job term code. Now the job term code is changed to warning, and now also this is issued if the number of files restored are **different** to the number of files expected. Before, the warning was only issued if **less files than expected** were restored. Co-authored-by: Philipp Storz <philipp.storz@bareos.com>
b8bf03c to
40c13c6
Compare
40c13c6 to
415bb1d
Compare
Thank you for contributing to the Bareos Project!
Description
When using recycled volumes, the restore process may report wrong expected number of files.
This PR fixes the issue.
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
General
Separate commit for CHANGELOG.md ("update CHANGELOG.md"). The PR number is correct.Source code quality
bareos-check-sources --since-mergedoes not report any problemsTests