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

fix: sharding cluster can not be deleted #8643

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

Y-Rookie
Copy link
Collaborator

No description provided.

@Y-Rookie Y-Rookie requested review from leon-inf and a team as code owners December 13, 2024 07:56
@github-actions github-actions bot added the size/XS Denotes a PR that changes 0-9 lines. label Dec 13, 2024
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 58.97436% with 16 lines in your changes missing coverage. Please review.

Project coverage is 61.37%. Comparing base (2f60dc9) to head (0ccee5a).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
controllers/apps/cluster_plan_builder.go 58.33% 7 Missing and 3 partials ⚠️
controllers/apps/transformer_cluster_component.go 60.00% 1 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8643      +/-   ##
==========================================
+ Coverage   60.49%   61.37%   +0.87%     
==========================================
  Files         378      378              
  Lines       45623    46278     +655     
==========================================
+ Hits        27598    28401     +803     
+ Misses      15441    15266     -175     
- Partials     2584     2611      +27     
Flag Coverage Δ
unittests 61.37% <58.97%> (+0.87%) ⬆️

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.

@Y-Rookie Y-Rookie marked this pull request as draft December 13, 2024 08:47
@Y-Rookie Y-Rookie linked an issue Dec 13, 2024 that may be closed by this pull request
@Y-Rookie Y-Rookie changed the title chore: fix sharding cluster can not be deleted fix: sharding cluster can not be deleted Dec 13, 2024
@github-actions github-actions bot added size/M Denotes a PR that changes 30-99 lines. and removed size/XS Denotes a PR that changes 0-9 lines. labels Dec 18, 2024
@Y-Rookie Y-Rookie marked this pull request as ready for review December 18, 2024 03:22
controllers/apps/cluster_plan_builder.go Show resolved Hide resolved
if err != nil {
return false, err
}
c.clusterDef = cd
Copy link
Contributor

Choose a reason for hiding this comment

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

Just use the cluster-def obtained, don't change anything of the object.

// sharding defined in cd topology
if len(c.Cluster.Spec.ClusterDef) > 0 && len(c.Cluster.Spec.Topology) > 0 {
if c.clusterDef == nil {
cd, err := loadClusterDefinition(c, c.Cluster)
Copy link
Contributor

Choose a reason for hiding this comment

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

The availability of the cluster-def should be checked, we should not make decisions based on an unavailable cluster-def.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The availability of the cluster-def should be checked, we should not make decisions based on an unavailable cluster-def.

done

@apecloud-bot apecloud-bot added the approved PR Approved Test label Dec 18, 2024
@Y-Rookie Y-Rookie merged commit fd36c73 into main Dec 18, 2024
36 checks passed
@Y-Rookie Y-Rookie deleted the support/sharding-cluster-cannot-delete branch December 18, 2024 08:12
@Y-Rookie
Copy link
Collaborator Author

/cherry-pick release-1.0-beta

@github-actions github-actions bot added this to the Release 0.9.2 milestone Dec 18, 2024
@apecloud-bot
Copy link
Collaborator

🤖 says: cherry pick action finished successfully 🎉!
See: https://github.com/apecloud/kubeblocks/actions/runs/12388894393

apecloud-bot pushed a commit that referenced this pull request Dec 18, 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/M Denotes a PR that changes 30-99 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] redis sharding cluster is always deleting
4 participants