Skip to content

stored: fix blocksize warning#1503

Merged
BareosBot merged 5 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-blocksize-warning
Aug 1, 2023
Merged

stored: fix blocksize warning#1503
BareosBot merged 5 commits intobareos:masterfrom
sebsura:dev/ssura/master/fix-blocksize-warning

Conversation

@sebsura
Copy link
Contributor

@sebsura sebsura commented Jul 5, 2023

Thank you for contributing to the Bareos Project!

This PR changes the way that the parser saves which members it set itself.
Instead of remembering the items by index (from the resource item array),
they are instead remembered by the member name. This makes it easy for
other parts of the code to look up whether a member was set or not.

This is then used to only emit the block size warning if the block size was actually
set inside the configuration (regardless of what is was set to).

This PR also slightly alters the way that job control records are dumped during a crash.
Now the dumper reports how many jcrs got dumped in total and does not print redundant
information.

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
  • Check backport line
  • Required backport PRs have been created
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

@sebsura sebsura force-pushed the dev/ssura/master/fix-blocksize-warning branch from 4c72b65 to 934437e Compare July 5, 2023 08:13
@sebsura sebsura added the bugfix label Jul 6, 2023
@sebsura sebsura requested a review from arogge July 14, 2023 04:35
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.

Looks good. Just one thing: you write "If such a warning is
emitted we also reset the value to its default value." in the description. But I cannot find the code doing this and I don't think that's the desired behaviour.

@sebsura
Copy link
Contributor Author

sebsura commented Jul 14, 2023

Looks good. Just one thing: you write "If such a warning is emitted we also reset the value to its default value." in the description. But I cannot find the code doing this and I don't think that's the desired behaviour.

You are right. This was the case originally, but I reverted it because that feature is actually pretty useful for testing.
Ill amend the pr text to reflect that.

@sebsura sebsura force-pushed the dev/ssura/master/fix-blocksize-warning branch from 410f0a3 to 11dc931 Compare July 24, 2023 06:38
sebsura added 4 commits July 24, 2023 11:29
Instead of remembering the items by index, they are instead remembered
by their name.  This allows other parts of the code to easily query
whether a member was set or not without having access to the list of
resource items.

This works since no two members of a class can have the same name.
Instead of checking for max_block_size > 0 instead check that the
value was not set by the parser.
@sebsura sebsura force-pushed the dev/ssura/master/fix-blocksize-warning branch from 11dc931 to 625d6dc Compare July 24, 2023 09:29
@BareosBot BareosBot merged commit ad4211d into bareos:master Aug 1, 2023
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.

3 participants