Skip to content

Fix problem with reoccuring files in always incremental#1395

Merged
arogge merged 6 commits intobareos:masterfrom
arogge:dev/arogge/master/reoccuring-files-simple
Mar 21, 2023
Merged

Fix problem with reoccuring files in always incremental#1395
arogge merged 6 commits intobareos:masterfrom
arogge:dev/arogge/master/reoccuring-files-simple

Conversation

@arogge
Copy link
Member

@arogge arogge commented Feb 27, 2023

When utilizing always incremental backup scheme while using Always Incremental Max Full Age, Bareos will run backups with level VirtualFull to merge existing Incrementals into a new Incremental.
As VirtualFull was intended to create new Full backups, the resulting Job will not contain removed files. As a result files that were marked as deleted in the Incremental jobs that were merged will reoccur when asking for a restore.
During the next Incremental job, these files will then be marked as deleted again.

In this pull request we add a test to reproduce the issue and a simple workaround that will replicate the deleted file information in the catalog.

To actually fix the underlying problem, we would have to change how deleted files are represented in the catalog, so we can add their file-indexes to the BSR that is used when creating a virtual full.
As doing this in a backwards-compatible manner is not trivial, it has been postponed for now.

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)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
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
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

arogge added 3 commits March 15, 2023 10:00
Introduce a way to express hard dependencies between systemtests.

Using DEPENDS on a test only ensures ordering, but does not imply the
need to run the other test or that the other test must have finished
successfully.

Using the new function systemtest_requires() you can now express that a
test A will require successful execution of test B by simply calling
systemtest_requires(A B). As this is tailored to be used inside a single
directory, the required prefixes are added automatically. The function
also honors existing fixtures.
Under the hood this is implemented by adding a setup fixture to every
systemtest that is then required by the depending test.
This test will reproduces a problem where consolidating multiple
incrementals into one, will lose the information about deleted files.
Replicate the deleted file information using a simple SQL query. While
this works the deleted files will not be added to the job data stored on
the volume.
@arogge arogge force-pushed the dev/arogge/master/reoccuring-files-simple branch from d7013a7 to 0c6349b Compare March 15, 2023 09:03
When reloading the configuration failed, the working_directory would not
be reset correctly which made it point to the freed string of the new
configuration.
Now SetWorkingDirectory() is called after reloading in case of success
and failure.

This also allows to run all of the reload systemtests under a sanitizer
which failed previously because of the use-after-free.
@arogge arogge force-pushed the dev/arogge/master/reoccuring-files-simple branch from 252bfa6 to 91f35fa Compare March 15, 2023 09:17
@arogge arogge requested a review from sebsura March 15, 2023 09:18
an allocated ua context was not released.
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

Looks good to me. We can merge if jenkins gives its OK!

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