autoxflate: fix autoxflate on replication#1576
Merged
BareosBot merged 17 commits intobareos:masterfrom Nov 10, 2023
Merged
Conversation
sebsura
requested changes
Oct 25, 2023
Contributor
sebsura
left a comment
There was a problem hiding this comment.
Thanks for your contribution. The changes are really good. I added some notes
Contributor
Author
|
Thanks for the feedback! |
Contributor
|
Just to give you an update: The code is great and will be merged. But i want to add some additional tests before that. Thank you for your contribution! |
Contributor
Author
|
Okay, thanks! |
208ab28 to
de5afc0
Compare
sebsura
approved these changes
Nov 10, 2023
15 tasks
The buffers have to be set up if inflate/deflate is enabled in any way not just when used in a particular direction.
nrec would get leaked if the needed buffers were not set up correctly. This should fix that issue.
A bSdEventSetupRecordTranslation event should get dispatched when reading and writing records during copy/migration.
This is done in preparation of adding more tests
If autodeflate is set, we need to ensure that an algorithm was actually selected.
Also slightly enhance the emitted debug messages.
Co-authored-by: Philipp Storz <philipp.storz@bareos.com>
382d156 to
415f167
Compare
This file contains hidden or 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
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!
While trying to set up autoxflate I ran into a bug where autoxflate doesn't seem to work with copy jobs (in Bareos 21 - and still an issue currently).
This test does the following:
Once the copy is restored I'd expect the files to be the same as the original files. While the restore job does end in success ("Restore OK"), it doesn't actually seem to restore anything, just a couple of empty files.
So, after some investigation it turns out to be a problem caused by several things:
This PR fixes 1 and 2 and also adds a check to ensure the inflate buffer is set up. Autoxflate should now also work with migrate/copy jobs and the test passes.
I've also fixed a small memory leak which would occur when autoxflate detects that the deflate buffer is not set up.
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-toolto have some simple automated checks run and a proper changelog record added.General
Check backport lineSource code quality
Tests