stored: implicitly create autochanger from device with count > 1#2198
Conversation
c07a2da to
cac6065
Compare
|
still requires documentation |
arogge
left a comment
There was a problem hiding this comment.
I had a quick first look. I found a typo in the docs and the systemtest does not seem to work correctly yet.
b9d5aa4 to
256fa9d
Compare
bruno-at-bareos
left a comment
There was a problem hiding this comment.
Generally good, work quite well and being helpful.
Please checks the remarks.
You think that is necessary? I personally would just leave it as is as long as there is no second testrunner or the file grows too large. |
256fa9d to
6cb508f
Compare
bruno-at-bareos
left a comment
There was a problem hiding this comment.
Still to be done:
- In the documentation, we must also rephrase the :config:option:
sd/device/Countoption, some of its properties have changed. - adapt the changelog
bruno-at-bareos
left a comment
There was a problem hiding this comment.
All's good for me, I'll give an approval.
@arogge would you mind to have a recheck for c++ code ?
sebsura
left a comment
There was a problem hiding this comment.
This needs some more time in the oven. I could very reliably create a crash:
Add an implicit autochanger with 4 devices. Set MaxConcurrentJobs to 10 everywhere. Start 10 concurrent jobs. Then the sd crashes.
This is because the sd tries to use the original device resource, which is not setup correctly (it has changer_res set, but not changer_command; see OpenDevice).
3746b81 to
3fc4a38
Compare
There was a problem hiding this comment.
We should definitely have a systemtest that actually uses this feature. I imagine the test could check
- that the maximum number of running jobs equals the count specified in the resource
- that one device was created with autoselect = no
...
This test would also make it easier to reproduce bugs as we would not have to set up the environment from scratch every time :)
Im still getting messages like this when running multiple jobs:
2025-06-05 07:51:23 bareos-sd JobId 5: Using Device "FileStorage" (storage) to write.
So im guessing the issue with the extra device is still not fixed. Could you double check that ?
Interestingly the device does not turn up in status sd.
if you want to try and reproduce this. |
ab96693 to
a3a9053
Compare
a3a9053 to
db08ef1
Compare
systemtests/tests/multiplied-device/etc/bareos/bareos-sd.d/device/ImplicitAutochanger.conf
Outdated
Show resolved
Hide resolved
systemtests/tests/multiplied-device/etc/bareos/bareos-sd.d/device/ImplicitAutochanger.conf
Outdated
Show resolved
Hide resolved
cc4c262 to
5e5d429
Compare
I took over the work, so i cannot review it anymore
accounting for review suggestions
and add note to changelog about changed behaviour
where the member changer_command is not set
from stored_conf.cc to the AutochangerResource class. Also add a flag for implicitly created autochangers so they don't get config-dumped.
This was needed when the Count directive reused the original device for a copied device. Now that we changed this behaviour, this code is obsolete.
only its copies should be displayed in the status view
When adding a device with Count > 1 to an AutochangerResource, it is now printed.
The return value is never checked and other "unused" configs also simply return true in this case.
Having some kind of error here would be nice, but I am not sure how to really handle it.
c734249 to
50d1444
Compare
9ddf237 to
65a3ebc
Compare
Automatically create Autochanger and devices 0000 - Count if the "Device" resource has set a "Count" directive > 1.
The new behaviour of the "Count" directive in the "Device" resource is the following:
If devices or the autochanger was not implicitly created, a warning is printed.
If the another autochanger which is not associated with the device has the name ,
no autochanger is created even if no autochanger yet exists for that device and a warning is printed..
Thank you for contributing to the Bareos Project!
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