Skip to content

Disable writing PRE_LABEL label-type to support WORM media#1958

Merged
BareosBot merged 6 commits intobareos:masterfrom
arogge:dev/arogge/master/no-pre-label
Oct 11, 2024
Merged

Disable writing PRE_LABEL label-type to support WORM media#1958
BareosBot merged 6 commits intobareos:masterfrom
arogge:dev/arogge/master/no-pre-label

Conversation

@arogge
Copy link
Member

@arogge arogge commented Sep 16, 2024

This change disables the use of PRE_LABEL label-type when labeling volumes without writing data to them.
Instead a normal volume label is written and the label will not be overwritten when the volume appended to afterwards.
With this change append-only media can now be used.

Resolves #1781

Thank you for contributing to the Bareos Project!

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

@arogge arogge added this to the 24.0.0 milestone Sep 16, 2024
@arogge arogge force-pushed the dev/arogge/master/no-pre-label branch 2 times, most recently from b054723 to b20849d Compare September 17, 2024 08:18
@pstorz pstorz self-assigned this Sep 17, 2024
@pstorz pstorz self-requested a review September 17, 2024 08:46
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.

The code looks good. Maybe we want to document somewhere that we now support WORM tapes and for that no PRE_LABELS are ever written now?

@pstorz pstorz changed the title Disable writing PRE_LABEL label-type Disable writing PRE_LABEL label-type to support WORM media Oct 4, 2024
@pstorz pstorz added requires no backport This will not be backported requires backport to 23 and removed requires no backport This will not be backported labels Oct 4, 2024
instead of writing a pre-label to an empty volume when labeling it, we
write the real volume-label right away so we don't have to rewrite it
when we actually start writing to the volume.
This will allow using WORM storages.
the VolFiles was previously fixed to 0 for new volumes, however when not
using pre-labels, the label will fill file 0, so VolFiles should be 1.
To achieve this, the `3000 OK label` message was slightly extended.
with the changed `3000 OK label` message this tests requires a slight
change.
as the first write to a volume will no longer overwrite the
volume-label, instead of pre-labeling a volume for this test we rely on
auto-labeling so the bSdEventLabelWrite event will be triggered.
When mounting a volume that contains a VOL_LABEL, the SD would log the
following message:
Volume "XXX" previously written, moving to end of data.

As that could be misleading now that newly labeled volumes will contain
a VOL_LABEL and the message would appear for volumes that only habe a
label, but no data.
@arogge arogge force-pushed the dev/arogge/master/no-pre-label branch from b20849d to 5e09eda Compare October 11, 2024 09:29
@BareosBot BareosBot merged commit 3b259e3 into bareos:master Oct 11, 2024
@sebsura sebsura assigned arogge and unassigned pstorz Oct 17, 2024
@arogge arogge mentioned this pull request Nov 15, 2024
11 tasks
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.

add support for WORM tapes

3 participants