Skip to content

fix miscalculation when using Always Incremental Keep Number#1159

Merged
pstorz merged 5 commits intobareos:masterfrom
arogge:dev/arogge/master/fix-consolidate-again
Apr 28, 2022
Merged

fix miscalculation when using Always Incremental Keep Number#1159
pstorz merged 5 commits intobareos:masterfrom
arogge:dev/arogge/master/fix-consolidate-again

Conversation

@arogge
Copy link
Member

@arogge arogge commented Apr 12, 2022

When changing consolidation to remove zero-file-jobs, we introduced a bug by recalculating the number of existing incrementals wrong.
This PR fixes that problem and refactors the code to make it clearer so that such bugs will be less likely to occur in the future.

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

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
  • PR name is meaningful
  • Purpose of the PR is understood
  • Separate commit for this PR in the CHANGELOG.md, PR number referenced is same
  • Commit descriptions are understandable and well formatted
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
  • bareos-check-sources --since-merge does not report any problems
  • git status should not report modifications in the source tree after building and testing

Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the title/changelog entry: Good work!

- webui: get volume and pool params from query instead of route [PR #1139]
- FreeBSD packages: add missing ddl/update 2171_2192 and 2192_2210 files [PR #1147]
- Fix director connects to client while `Connection From Director To Client` is disabled. [PR #1099]
- dir: miscalculation when using `always incremental keep number` [PR #1159]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit too broad, maybe "miscalculation when always incremental keep number is greater than the number of backups determined by always incremental job retention

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is hard to describe in a meaningful way, thus I settled with that I have, so people see that there is something wrong when they use always incremental keep number.
I can, of course, go more into detail here. Maybe we describe the complete problem in the PR description - the Changelog will link to that for people who are really interested in what's going on.

Copy link
Contributor

@bruno-at-bareos bruno-at-bareos Apr 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pstorz it is also true for ai keep number = ai job retention Failure occur with this configuration.

Always Incremental Job Retention = 28 days
Always Incremental Keep Number = 28 days
Always Incremental Max Full Age = 32 days

@pstorz pstorz force-pushed the dev/arogge/master/fix-consolidate-again branch 2 times, most recently from d344168 to a408615 Compare April 26, 2022 11:31
Alaa Eddine Elamri and others added 5 commits April 28, 2022 10:39
This fixes a bug where the number of incrementals was miscalculated
during consolidation leading to no consolidation when "Keep Number" was
set.
The patch also makes a lot of the variables `const` and tries to avoid
re-use of existing variables to improve readability.
... and try to improve readability even more.
@pstorz pstorz force-pushed the dev/arogge/master/fix-consolidate-again branch from a408615 to e9341db Compare April 28, 2022 08:39
@pstorz pstorz merged commit 2bcade9 into bareos:master Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants