Skip to content

Add configuration warnings to SD#583

Merged
arogge merged 3 commits intobareos:masterfrom
arogge:dev/arogge/master/new-config-warnings
Sep 3, 2020
Merged

Add configuration warnings to SD#583
arogge merged 3 commits intobareos:masterfrom
arogge:dev/arogge/master/new-config-warnings

Conversation

@arogge
Copy link
Member

@arogge arogge commented Sep 1, 2020

This PR adds configuration warnings to the SD when

  • Maximum Block Size is configured on a device that is not a tape
  • The SD is invoked with -p to ignore i/o errors

The storage daemon's configuration parser now calls Validate() on each
resource during pass 2.
As setting Maximum Block Size on a non-tape device can lead to
unexpected results we now emit a warning in that case.
ParseSdConfig(configfile, M_ERROR_TERM);

if (forge_on) {
my_config->AddWarning("Running with '-p' is for testing purposes only");
Copy link
Member

Choose a reason for hiding this comment

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

How about "for testing and emergency recovery purposes only"

Copy link
Member Author

Choose a reason for hiding this comment

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

agreed.


BareosResource* allocated_resource = *resources[rindex].allocated_resource_;
if (pass == 2 && !allocated_resource->Validate()) {
return false;
Copy link
Member

Choose a reason for hiding this comment

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

Does this return value mean that the storage daemon does not start?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. If Validate() returns false, the the SD will not start. This is analogous to the behaviour of the Director.
The idea is that we can run in-depth checks of the configuration that way (which was why that function added to the director in the first place).

Previously, when running the storage daemon with '-p' there was no
indication besides the actual commandline. We now register a
configuration warning, so people can see that this is not fit for
production.
@arogge arogge force-pushed the dev/arogge/master/new-config-warnings branch from 5913a9d to d5bc272 Compare September 3, 2020 10:11
@arogge arogge merged commit 85e8ff3 into bareos:master Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants