New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dird: create restore tree caches on backup #1616
Draft
sebsura
wants to merge
45
commits into
bareos:master
Choose a base branch
from
sebsura:dev/ssura/master/tree-save
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since start is always the next element there is no need to explicitly save it. This commit also makes the remaining sub member relative to the node, i.e. instead of saving the absolute offset into the array, we instead just save the size of the whole subtree.
They probably should not get saved anyways!
We have to save the information on whether a file is the "original" file or if its just a "link". To do that we add the offset to the original to every hardlinked file so that we can detect the actual original by checking whether the node points to itself.
We need to ensure to free the build restore tree (if it exists) even if we decide not to do a restore.
We now use the cache directory from the director configuration.
This class is easy to use if you only want to calculate simple checksums.
Since elements of type TN_NEWDIR *always* have a deltaseq of -1 we can never not save them (since not all of them are 0). To remedy this, we instead save the delta_seq + (type == TN_NEWDIR), so that the vector is all 0, even if we have NEWDIRs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for contributing to the Bareos Project!
Building a restore tree by pulling data from the database can be very slow if it contains lots of files. This PR introduces a mechanism by which the director automatically creates a restore tree cache at the end of each backup job. This allows the director to create a restore tree much quicker when needed.
Things that should get added:
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)
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
Source code quality
Tests