stored: add new volume status 'Unlabeled'#2207
Conversation
2d99d80 to
2ff782f
Compare
2ff782f to
67f2ded
Compare
|
Currently, when manually labeling a volume its status is set to unlabeled |
arogge
left a comment
There was a problem hiding this comment.
- You'll need to upgrade the database correctly. This means we need to introduce a new database version and create a migration script for that.
- As far as I can tell an unlabeled volume was definitely never written to (as the label would have been written first), so neither the purge nor the prune operation makes sense on such a volume.
- When selecting a volume, I think we should prefer appendable volumes over unlabeled ones
maybe we can discuss sometime how to pursue with this. |
The migration scripts are in For the upgrade script you create a new file (probably based on an existing one) named When changing the database version, you also have to change the |
That's actually a good point. I think it doesn't make much sense to support purge/prune on these volumes, but you're right that it should probably not fail either. |
73282af to
270eea4
Compare
270eea4 to
ced3746
Compare
sebsura
left a comment
There was a problem hiding this comment.
These are some great changes!
| | VolStatus | text | | Status of media: | | ||
| | | | | Full, Archive, Append, | | ||
| | | | | Unlabeled, Full, Archive, Append, | | ||
| | | | Recycle, Read-Only, Disabled, Error, | | ||
| | | | Busy | |
There was a problem hiding this comment.
This creates a line that is slightly too long.
| VolStatus | text | | Status of media: |
| | | | Unlabeled, Full, Archive, Append, |
| | | | Recycle, Read-Only, Disabled, Error, |
| | | Busy |
this might fix it.
| | NewVolStatus | integer | enum: Unlabeled, Full, Archive, Append, | | ||
| | | | Recycle, Purged, Read-only, Disabled, Error, | | ||
| | | | Busy, Used, Cleaning | |
There was a problem hiding this comment.
The same applies here: i get a scroll bar for the table. You can just split it up like we did above.
|
You should also squash the commits a bit. There are some check sources/undo commits in there. |
efa5bae to
6e6353e
Compare
a5ab259 to
98d4e31
Compare
|
@sebsura I squashed some of the commits. Do you want to take another look at this? |
this status is the original status when a new volume is created in the catalog and is changed if the storage daemon (successfully) wrote on the volume.
If you manually set the volume status of a volume to "Unlabeled", the sd corrects this status after successfully writing to the volume.
DoLabel returns whether labelling suceeded or not and not whether the console connection should be killed.
such that the VolStatus is not "Unlabeled" after labeling but "Append".
98d4e31 to
0bd41e2
Compare
arogge
left a comment
There was a problem hiding this comment.
This is a great improvement for that nasty annoyance when your filesystem is full (or something else went wrong).
Looks great and tested OK.
This status is the initial status when a new volume is created in the catalog and is changed if the storage daemon (successfully) wrote on the volume.
Fixes #1804
Currently:
-> the volume record with "Append" status persists in the catalog even if no volume with that name was ever created by the sd
With this PR:
-> the volume record with "Unlabeled" status persists in the catalog and is selected again if the sd asks for a volume to append to until labeling works
If the sd successfully wrote on the "Unlabeled" volume, its status is updated to "Append", "Full" or whatever the sd decides.
Note:
Manually updating an existing volume record in the catalog to the status "Unlabeled" is not dangerous, no backup data is ever overwritten!
When the sd wants to send volume updates to the director, and the status is "Unlabeled" but has written bytes, the status is set to "Append".
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
Required backport PRs have been createdSource code quality