consolidate: make virtualfull jobs spawned by consolidate job inherit same priority and max concurrent jobs#1530
Conversation
|
Hello @SamuelBoerlin For example if you define a job with "SpoolData=Yes" when the consolidation run the virtual full, this parameter is always applied. If it can make sense on some setup (like consolidating a lots of small incrementals), some other setup with large full jobs maybe want to skip spooling. |
|
Hi @bruno-at-bareos |
Great thanks. I know some people will be happy. |
|
I've also been experimenting with adding support for MaxConcurrentJobs now (master...SamuelBoerlin:bareos:consolidate-max-concurrent-jobs), which currently cannot be configured for consolidate jobs either. Not yet tested, but if it works I might add it to this PR too. |
c260ce7 to
b779be0
Compare
|
Did I see that correctly? The recently pushed changes are for the maximum concurrent jobs change? |
|
Yes please, thanks! |
arogge
left a comment
There was a problem hiding this comment.
This looks pretty good already.
I'm a bit unhappy wit the allow_mixed_priority and allow_mixed_priority_set, as it is hard to grasp what it is supposed to do at first.
I'm pretty confident we can make this work and merge it so it still goes into Bareos 23.
| directordaemon::PoolResource* next_pool{}; /**< Next Pool used for migration/copy and virtual backup */ | ||
| directordaemon::FilesetResource* fileset{}; /**< FileSet resource */ | ||
| directordaemon::CatalogResource* catalog{}; /**< Catalog resource */ | ||
| directordaemon::runtime_job_status_t* rjs{}; /**< Runtime Job Status. May point to the rjs of another resource (e.g. for consolidation vf jobs this points to the rjs of the parent consolidation job's resource) */ |
There was a problem hiding this comment.
I'm not sure this is the right place for this.
There was a problem hiding this comment.
I used to have it in the DirectorJcrImpl at first, but then moved it to the Resources struct because I thought it would be a better fit as the rjs is owned by a JobResource.
Should I move it back to DirectorJcrImpl?
core/src/dird/ua.h
Outdated
| bool allow_mixed_priority = false; | ||
| bool allow_mixed_priority_set = false; |
There was a problem hiding this comment.
if I understand correctly then these two bools mimics a tri-state enum like this:
enum class allow_mixed_priority : int {
unset = 0,
enable,
disable
}
or maybe more reusable:
enum class maybe_bool : int {
unset = 0,
enable,
disable
}
or maybe more in the mindset of modern C++ a std::optional<bool> could be sufficient.
There was a problem hiding this comment.
Yes, good point.
However, it just occurred to me that the allowmixedpriority UA run command parameter (and therefore this code too) isn't even needed because I can just grab it later on from the rc.consolidate_job resource which simplifies things.
There was a problem hiding this comment.
These two bools have now been removed.
core/src/dird/ua.h
Outdated
| char* since = nullptr; | ||
| char* StoreName = nullptr; | ||
| char* verify_job_name = nullptr; | ||
| char* consolidate_job_name = nullptr; |
There was a problem hiding this comment.
do you really need the name and the pointer to the resource stored here?
There was a problem hiding this comment.
No, not really, it's just how verify_job and previous_job e.g. work too and so I followed that. But I can use a local variable instead.
There was a problem hiding this comment.
Name is now removed.
arogge
left a comment
There was a problem hiding this comment.
Looks great! Thank you for the effort!
arogge
left a comment
There was a problem hiding this comment.
While I'm pretty happy with your changes, I'll have to request changes again. Sadly, in continuous integration your test fails at least sometimes. For the last build it failed on 9 out of 14 platforms. The requirement for a merge is to pass on all platforms.
I'm not sure what exactly went wrong and as I'll be out-of-office next week I won't have much time to look into it.
I would be glad if you could get in touch with me via e-mail (andreas.rogge@bareos.com) so we can discuss how we can provide access to the CI server's logs for you, so you can at least try to sort out the issue yourself.
I'll look into it. Yes, would be great if I could take a look at the test logs. Sent you an email. |
|
@arogge Thanks for sending me the logs. I couldn't figure out the actual cause yet, but for now I've just increased one of the job's wait time from 5s to 15s. |
|
To elaborate on why I have a job that waits 15s: my test starts a priority 20 consolidate job, which then consolidates a usually priority 10 job |
cafafc8 to
b7292b5
Compare
|
Couldn't reproduce the issue locally so I decided to just rewrite the test which ended up simplifying things anyways. |
|
Thank you. Build was successful. I'll take a look at the updated test tomorrow! |
Virtualfull jobs spawned by consolidate now inherit the conoslidate job's priority.
with this change that setting can now be overridden
make virtualfull jobs spawned by consolidate job inherit allow_mixed_priority flag from the consolidate job.
make virtualfull jobs spawned by consolidate job inherit spool_data flag
The AllowMixedPriority setting is now instead taken from the parent consolidate job resource.
8d5fb3d to
9dde571
Compare
Thank you for contributing to the Bareos Project!
This PR makes virtualfull jobs spawned by a consolidate job inherit the consolidate job's priority and allow mixed priority flag.
This change puts it more in line with e.g. migration/copy jobs which already behave this way.
It also allows users to give consolidate jobs a lower priority than the original jobs that are being consolidated, so that they don't block more important jobs (i.e. jobs with a higher priority than the consolidate jobs, but still lower priority than the original jobs being consolidated).
Example use case:
I've configured consolidate jobs to have the same priority as migrate/copy jobs and all of those have a lower priority than regular always incremental backups. This is because the consolidate/migrate/copy jobs can end up running for a very long time and they shouldn't block regular backups from happening. The issue with this is, that when a consolidation is started, it spaws virtualfull jobs with the same priority as the always incremental backups, which then end up blocking my migrate/copy jobs. This issue could be solved with this PR.
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
Source code quality
Tests