Skip to content

console: prune command gained support to prune multiple volumes at once#966

Merged
pstorz merged 13 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/bulk-prune-command
Dec 16, 2021
Merged

console: prune command gained support to prune multiple volumes at once#966
pstorz merged 13 commits intobareos:masterfrom
alaaeddineelamri:dev/alaaeddineelamri/master/bulk-prune-command

Conversation

@alaaeddineelamri
Copy link
Contributor

@alaaeddineelamri alaaeddineelamri commented Oct 28, 2021

Description:

This PR enables the prune command to prune

  • all volumes of a specific pool
  • all volumes of all pools

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

@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/bulk-prune-command branch 3 times, most recently from f4bf641 to 891ae04 Compare November 4, 2021 09:48
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/bulk-prune-command branch from 891ae04 to 88242f4 Compare November 5, 2021 10:43
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/bulk-prune-command branch 2 times, most recently from 060b70a to a806203 Compare November 24, 2021 10:08
@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/bulk-prune-command branch 2 times, most recently from d2a8d23 to 384fe89 Compare December 6, 2021 13:58
arogge
arogge previously requested changes Dec 9, 2021
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.

I haven't checked the functionality yet, but I have a few comments about the code.

@alaaeddineelamri alaaeddineelamri force-pushed the dev/alaaeddineelamri/master/bulk-prune-command branch from 384fe89 to 27784c6 Compare December 10, 2021 17:10
@arogge arogge assigned pstorz and unassigned arogge Dec 14, 2021
@pstorz pstorz force-pushed the dev/alaaeddineelamri/master/bulk-prune-command branch from 27784c6 to 111f803 Compare December 14, 2021 10:48
@pstorz pstorz self-requested a review December 14, 2021 15:35
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.

While testing I found some problems.
The most important is that the output from pruning is stored in the messages buffer, so that now we can call "prune all volume yes", and then we got "you have messages". Then we need to execute "messages" to see what is going on.

I changed the prune and purge functions to log differently so that they now print their results immediately when running in console, and logging to the joblog if a job is the initiator of the pruning. (See last commit)

Besides of this, I added some commtent.

Good work!

@pstorz pstorz force-pushed the dev/alaaeddineelamri/master/bulk-prune-command branch 3 times, most recently from 12e9bbd to 82bac19 Compare December 15, 2021 10:48
@pstorz pstorz dismissed arogge’s stale review December 15, 2021 17:39

Changes applied

@pstorz pstorz changed the title Bulk pruning command introduce bulk pruning command Dec 15, 2021
@pstorz pstorz changed the title introduce bulk pruning command console: introduce bulk pruning command Dec 15, 2021
@pstorz pstorz self-requested a review December 15, 2021 17:44
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.

I just noticed, that we need to update the "prune command" section in the docs:

https://docs.bareos.org/TasksAndConcepts/BareosConsole.html#index-34

See BareosConsole.rst:891

@pstorz pstorz force-pushed the dev/alaaeddineelamri/master/bulk-prune-command branch from 3cf4b48 to 0eecd63 Compare December 15, 2021 17:52
@pstorz pstorz changed the title console: introduce bulk pruning command console: prune command gained support to prune multiple volumes at once Dec 15, 2021
pstorz and others added 6 commits December 15, 2021 18:57
... and to the job log when a job is calling the functions.

Before, most messages were created via Jmsg().
On interactive usage, the logs were stored in the message buffer
instead of showing up immediately.

With these changes, the logs created during pruning and purging show up
immediately when being used interactively in the console, and will be
logged into the job log if pruning and purging are called during a job
run.
Co-authored-by: Andreas Rogge <andreas.rogge@bareos.com>
@pstorz pstorz force-pushed the dev/alaaeddineelamri/master/bulk-prune-command branch from 0eecd63 to 49cb664 Compare December 15, 2021 17:57
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.

Good work!

@pstorz pstorz merged commit fca4a2d into bareos:master Dec 16, 2021
@pstorz pstorz deleted the dev/alaaeddineelamri/master/bulk-prune-command branch December 16, 2021 11:21
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