Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new ConcurrencyPolicy setting to the MedusaBackupSchedule #1204

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

burmanm
Copy link
Contributor

@burmanm burmanm commented Feb 8, 2024

…ent multiple active backups working on the same Datacenter

What this PR does:
Prevents multiple backup jobs from running concurrently when targeting the same Datacenter. This works with the internal MedusaBackupScheduler and can be disabled using ConcurrencyPolicy Allow.

Which issue(s) this PR fixes:
Fixes #1203

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CHANGELOG.md updated (not required for documentation PRs)
  • CLA Signed: DataStax CLA

…ent multiple active backups working on the same Datacenter
@burmanm burmanm requested a review from a team as a code owner February 8, 2024 16:37
Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (98d439e) 57.31% compared to head (8f569d9) 57.28%.

❗ Current head 8f569d9 differs from pull request most recent head 3e4725f. Consider uploading reports for the commit 3e4725f to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1204      +/-   ##
==========================================
- Coverage   57.31%   57.28%   -0.03%     
==========================================
  Files         103      103              
  Lines       10680    10709      +29     
==========================================
+ Hits         6121     6135      +14     
- Misses       4028     4037       +9     
- Partials      531      537       +6     
Files Coverage Δ
apis/medusa/v1alpha1/medusaschedule_types.go 100.00% <ø> (ø)
...trollers/medusa/medusabackupschedule_controller.go 71.00% <68.75%> (-2.24%) ⬇️

... and 3 files with indirect coverage changes

Copy link
Contributor

@rzvoncek rzvoncek left a comment

Choose a reason for hiding this comment

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

The changes look good to me, but there are a few thing I did not understand (see the questions).

return ctrl.Result{}, err
} else {
if len(activeTasks) > 0 {
logger.V(1).Info("Postponing backup schedule due to existing active backups", "MedusaBackupSchedule", req.NamespacedName)
Copy link
Contributor

Choose a reason for hiding this comment

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

[Question]: I've not come across logger.V(1) yet. What does it do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the same as what in Java you would call for "logger.debug". There's multiple levels (not sure if there's even any limit) of logging you can set, but usually V(1) is for debugging in Go projects and rest are not used.

Copy link
Contributor

Choose a reason for hiding this comment

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

[Question] We're adding this (and also the charts/k8ssandra-operator/templates/role.yaml) file. Why did this happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed them, from another PR (there's nothing wrong having them here, but they're autogenerated on the release process also, so redundant in here).

@burmanm burmanm merged commit c03280e into k8ssandra:main Feb 12, 2024
9 checks passed
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

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.

Add ConcurrencyPolicy to MedusaBackupSchedule
2 participants