Skip to content

dir: fix DbLocker usage#1953

Merged
BareosBot merged 2 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/reproduce-copy-on-remote-sd-failing-after-label
Oct 11, 2024
Merged

dir: fix DbLocker usage#1953
BareosBot merged 2 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/reproduce-copy-on-remote-sd-failing-after-label

Conversation

@bruno-at-bareos
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos commented Sep 11, 2024

This PR add dir: fix DbLocker usage

When a remote copy on medium that need manual intervention to manage volume state (new, used, purge), the interaction might crash the director under certain situation.

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

@bruno-at-bareos bruno-at-bareos added this to the 24.0.0 milestone Sep 11, 2024
@bruno-at-bareos bruno-at-bareos changed the title dev/bruno/master/reproduce copy on remote sd failing after label reproduce copy on remote sd failing after label Sep 11, 2024
@bruno-at-bareos bruno-at-bareos changed the title reproduce copy on remote sd failing after label reproduce copy on remote sd failing after label or purge Sep 18, 2024
@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/reproduce-copy-on-remote-sd-failing-after-label branch from d30d6fd to bf28abb Compare October 7, 2024 08:44
@bruno-at-bareos bruno-at-bareos changed the title reproduce copy on remote sd failing after label or purge dir: fix DbLocker usage Oct 7, 2024
@bruno-at-bareos bruno-at-bareos added requires no backport This will not be backported and removed draft labels Oct 7, 2024
@bruno-at-bareos
Copy link
Contributor Author

@sebsura as discussed, we revamp the PR to have the DbLocker fixed and merged for 24.
I'm not sure, as you propose the patches, if we want to enroll another reviewer.

I might be able to create a quick systemtest that show the problem extending an existing one, or maybe it is not mandatory in this case.

@bruno-at-bareos
Copy link
Contributor Author

another case to reproduce this type of crash was to label volume on non existing pool

bin/bconsole <<< "label volume=TestNoName storage=File pool=Fulls yes"

Connecting to Director opensuse-tumbleweed:30051
 Encryption: TLS_CHACHA20_POLY1305_SHA256 TLSv1.3
1000 OK: bareos-dir Version: 24.0.0~pre1209.bf28abb7d (07 October 2024)
Self-compiled binaries (UNSUPPORTED)
Get professional support from https://www.bareos.com
You are connected using the default console

Enter a period (.) to cancel a command.
label volume=TestNoName storage=File pool=Fulls yes
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Could not find Pool "Fulls": ERR=Pool record not found in Catalog.
Defined Pools:
1: Scratch
2: quickrecycle
3: purgeoldest
4: Incremental
5: Full
6: Differential
Select the Pool (1-6):

here the result with the fix, which is what 23 was doing.

We might be interested to have quick systemtest to be sure this doesn't reappear

@sebsura sebsura assigned bruno-at-bareos and unassigned sebsura Oct 11, 2024
@sebsura sebsura force-pushed the dev/bruno/master/reproduce-copy-on-remote-sd-failing-after-label branch from bf28abb to 02bb06d Compare October 11, 2024 05:07
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

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

nice finds!

bruno-at-bareos and others added 2 commits October 11, 2024 05:58
fix director crashes during concurrent access on label and volumes.
@BareosBot BareosBot force-pushed the dev/bruno/master/reproduce-copy-on-remote-sd-failing-after-label branch from 5896d8c to 0e4700a Compare October 11, 2024 05:58
@BareosBot BareosBot merged commit 4a5fb04 into bareos:master Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires no backport This will not be backported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants