Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stored: enable labeling of tapes in devices even when autoselect = no #1021

Conversation

alaaeddineelamri
Copy link
Contributor

@alaaeddineelamri alaaeddineelamri commented Dec 9, 2021

Description:

When devices are set with the option autoselect=no, labeling and releasing is not possible as the device is skipped in the search. This PR handles this issue by not accounting for the autoselect attribute when searching devices. This has the same effect on the mount, unmount, as well as readlabel and autochanger commands. Backups are not affected.

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)

General
  • PR name is meaningful
  • Purpose of the PR is understood
  • Separate commit for this PR in the CHANGELOG.md, PR number referenced is same
  • Commit descriptions are understandable and well formatted
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
  • bareos-check-sources --since-merge does not report any problems
  • git status should not report modifications in the source tree after building and testing
Tests
  • Decision taken that a system- or unittest is required (if not, then remove this paragraph)
  • The decision towards a systemtest is reasonable compared to a unittest
  • Testname matches exactly what is being tested
  • Output of the test leads quickly to the origin of the fault

@pstorz pstorz changed the title stored: cannot use release or label when autoselect = no stored: enable release and label on devices where autoselect = no Dec 9, 2021
@pstorz pstorz self-requested a review December 9, 2021 17:16
CHANGELOG.md Outdated Show resolved Hide resolved
@pstorz pstorz changed the title stored: enable release and label on devices where autoselect = no stored: enable labeling of tapes in devices even when autoselect = no Dec 10, 2021
pstorz
pstorz previously requested changes Dec 10, 2021
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

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

Excellent work!
It might make sense to refactor this test to have setup and teardown, and to have two autochanger tests (the original one and the new one testing the label functionality)

systemtests/tests/autochanger/testrunner Outdated Show resolved Hide resolved
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/cannot-release-label-when-autoselect-no branch 3 times, most recently from bd336ae to c11ef92 Compare December 16, 2021 16:43
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/cannot-release-label-when-autoselect-no branch from c11ef92 to 6acc04f Compare December 23, 2021 10:14
Copy link
Member

@arogge arogge left a comment

Choose a reason for hiding this comment

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

This looks like a good idea, I just wouldn't return a device with autoselect = no unless the caller explicitly asks for that one.

core/src/stored/dir_cmd.cc Outdated Show resolved Hide resolved
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/cannot-release-label-when-autoselect-no branch 2 times, most recently from 48f81f6 to 917a9b9 Compare January 20, 2022 08:25
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/cannot-release-label-when-autoselect-no branch 2 times, most recently from 9da8672 to dccbf0c Compare February 1, 2022 10:09
Copy link
Member

@arogge arogge left a comment

Choose a reason for hiding this comment

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

bareos-check-sources is not happy yet.
Other than that, it looks great and can be merged.

added the following checks to the `autochanger` systemtest:
-Checking `label` command doesn't skip device when `autoselect = no`
-Checking `release` command doesn't skip device when `autoselect = no`
-Checking backups are not affected by newly added change
-Checking tape backups do not use devices that have `autoselect = no`
systemtest: updated systemtest
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/cannot-release-label-when-autoselect-no branch from dccbf0c to 399a349 Compare February 4, 2022 14:06
@arogge arogge requested a review from pstorz February 7, 2022 10:46
@arogge arogge dismissed pstorz’s stale review February 7, 2022 10:53

changes have already been addressed

@arogge arogge merged commit dc5d533 into bareos:master Feb 7, 2022
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.

None yet

3 participants