Skip to content

stored: fix sd volume limit#2264

Merged
BareosBot merged 7 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-sd-volume-limit
May 14, 2025
Merged

stored: fix sd volume limit#2264
BareosBot merged 7 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-sd-volume-limit

Conversation

@sebsura
Copy link
Contributor

@sebsura sebsura commented May 7, 2025

Thank you for contributing to the Bareos Project!

This pr fixes a long standing issue with bareos where one storage daemon can sometimes only request up to 19 volumes from the same pool/mediatype combination concurrently.
This is because the sd has a hard limit of 19 requests to get a suitable volume. As the director does not know which volume is currently in use, its possible to that it returns 19 volumes that are already in use by other devices.

In this pr we upped the limit to (number of devices)+10%. In the future we should make sure that the sd already tells the director immediately which volumes the sd is already using., reducing the number of round trips required.

This also contains a fix for a director crash that happens when it cannot connect to the database. This crash occurs because its not safe to lock the db in such cases (as the lock may not exist yet), but we still want to access the error string (which may be protected by that lock). I added a workaround, so that dbs that failed to open are considered "private" (as they can not have been shared yet!), in which case accessing error string is allowed even without the lock.

Thirdly, this pr contains some cmake improvements which should make it much faster to (re-)configure a bareos build directory. Unit tests are now not parsed via a cmake regex parser to find out which tests exist, but they are executed in a post build to gather that information.

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
  • Required backport PRs have been created
  • Correct milestone is set
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

@sebsura sebsura self-assigned this May 7, 2025
@sebsura sebsura added this to the 25.0.0 milestone May 7, 2025
@sebsura sebsura force-pushed the dev/ssura/master/fix-sd-volume-limit branch from c5c1b77 to e01db20 Compare May 9, 2025 06:17
@sebsura sebsura requested a review from florian-at-bareos May 9, 2025 06:18
@sebsura sebsura force-pushed the dev/ssura/master/fix-sd-volume-limit branch 4 times, most recently from 2128739 to f1937de Compare May 9, 2025 08:19
@sebsura sebsura force-pushed the dev/ssura/master/fix-sd-volume-limit branch 3 times, most recently from 5e89468 to 133c022 Compare May 12, 2025 07:04
@sebsura sebsura force-pushed the dev/ssura/master/fix-sd-volume-limit branch from 133c022 to 393b440 Compare May 13, 2025 14:29
@sebsura sebsura requested a review from florian-at-bareos May 14, 2025 06:25
Copy link
Contributor

@florian-at-bareos florian-at-bareos left a comment

Choose a reason for hiding this comment

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

Nice work!
I like that you return error info from OpenDatabase!

The only thing which is a little weird now is that
db->OpenDatabase(nullptr) evaluates to false if successfull and to true if not.

But that's something we can overlook for now.

@bruno-at-bareos bruno-at-bareos mentioned this pull request May 14, 2025
9 tasks
@BareosBot BareosBot merged commit 3f4def6 into bareos:master May 14, 2025
1 check was pending
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.

4 participants