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

chore: update the group of the BackupPolicyTemplate to "dataprotection" #8203

Merged
merged 18 commits into from
Oct 9, 2024

Conversation

wangyelei
Copy link
Contributor

No description provided.

@wangyelei wangyelei marked this pull request as draft September 25, 2024 06:17
@github-actions github-actions bot added the size/XXL Denotes a PR that changes 1000+ lines. label Sep 25, 2024
@wangyelei wangyelei marked this pull request as ready for review September 25, 2024 07:00
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 69.57831% with 101 lines in your changes missing coverage. Please review.

Project coverage is 61.63%. Comparing base (038fc44) to head (6632bcd).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...trollers/apps/transformer_cluster_backup_policy.go 72.35% 45 Missing and 15 partials ⚠️
.../dataprotection/backuppolicytemplate_controller.go 63.20% 30 Missing and 9 partials ⚠️
controllers/apps/transformer_component_rbac.go 50.00% 0 Missing and 1 partial ⚠️
pkg/operations/custom.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8203      +/-   ##
==========================================
+ Coverage   61.24%   61.63%   +0.38%     
==========================================
  Files         348      348              
  Lines       40184    40615     +431     
==========================================
+ Hits        24611    25033     +422     
- Misses      13333    13367      +34     
+ Partials     2240     2215      -25     
Flag Coverage Δ
unittests 61.63% <69.57%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wangyelei wangyelei marked this pull request as draft September 25, 2024 10:06
@wangyelei wangyelei marked this pull request as ready for review September 26, 2024 03:01
controllers/apps/transformer_cluster_backup_policy.go Outdated Show resolved Hide resolved
controllers/apps/transformer_cluster_backup_policy.go Outdated Show resolved Hide resolved
controllers/apps/transformer_component_rbac.go Outdated Show resolved Hide resolved
return transformBackupPolicyAndSchedule(bpt, compSpec, componentName, isSharding, false)
}

for i := range r.Cluster.Spec.ComponentSpecs {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move all the logic into BackupPolicyTemplateReconciler?

Copy link
Contributor Author

@wangyelei wangyelei Oct 8, 2024

Choose a reason for hiding this comment

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

the backupPolicy and backupScheduled are reconciled by the cluster.spec.backup and componentSpecs/shardingSpecs. if move it to BackupPolicyTemplateReconciler, bpt controller will watch the changes of the cluster and handle the logic for all related clusters .

Copy link
Contributor

Choose a reason for hiding this comment

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

The backup policy needs a mechanism or the API to bind to the cluster in a loosely coupled way. For example, referring to Prometheus, the backup policy can define an annotation and well-defined value, so that the cluster only needs to serialize the necessary backup information to this annotation in the defined format, and the backup policy controller can generate the object for it automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When using a BPT (Backup Policy Template) controller, every time there is a change in the cluster, the corresponding BPT will reconcile all related clusters to synchronize the backup policies and schedules. If there are many clusters, this can keep the controller very busy, potentially causing blocks and delaying reconciliations. Prometheus, on the other hand, periodically pulls all metrics with the specified annotations, which is a reasonable approach.

Copy link
Contributor

@zjx20 zjx20 left a comment

Choose a reason for hiding this comment

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

Please resolve conflicts.

cmd/manager/main.go Outdated Show resolved Hide resolved
@apecloud-bot apecloud-bot added the approved PR Approved Test label Oct 9, 2024
@wangyelei wangyelei merged commit 5cc108f into main Oct 9, 2024
37 checks passed
@wangyelei wangyelei deleted the feature/update_bpt_group branch October 9, 2024 07:16
@github-actions github-actions bot added this to the Release 0.9.2 milestone Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved PR Approved Test size/XXL Denotes a PR that changes 1000+ lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants