Skip to content

Conversation

leon-inf
Copy link
Contributor

No description provided.

@leon-inf leon-inf added this to the Release 1.1.0 milestone Jun 26, 2025
@github-actions github-actions bot added the size/XXL Denotes a PR that changes 1000+ lines. label Jun 26, 2025
@apecloud-bot
Copy link
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.0

@leon-inf
Copy link
Contributor Author

/nopick

@apecloud-bot apecloud-bot added the nopick Not auto cherry-pick when PR merged label Jun 26, 2025
@leon-inf leon-inf force-pushed the support/sharding-template branch 2 times, most recently from 2d1b80d to b4d2dcb Compare June 26, 2025 11:37
@leon-inf leon-inf force-pushed the support/sharding-template branch 2 times, most recently from ede3339 to e79fbfa Compare June 27, 2025 03:44
@leon-inf leon-inf force-pushed the support/sharding-template branch from e79fbfa to 39a2086 Compare June 27, 2025 03:46
Copy link

codecov bot commented Jun 27, 2025

Codecov Report

Attention: Patch coverage is 53.78788% with 183 lines in your changes missing coverage. Please review.

Project coverage is 59.81%. Comparing base (1a52cc5) to head (19b0efb).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
.../apps/cluster/transformer_cluster_normalization.go 40.74% 56 Missing and 8 partials ⚠️
pkg/controller/sharding/utils.go 67.09% 39 Missing and 12 partials ⚠️
pkg/controller/sharding/legacy.go 0.00% 36 Missing ⚠️
pkg/controller/configuration/resource_wrapper.go 37.50% 10 Missing ⚠️
...lers/apps/cluster/transformer_cluster_component.go 65.00% 5 Missing and 2 partials ⚠️
pkg/controller/sharding/types.go 89.47% 3 Missing and 1 partial ⚠️
pkg/operations/ops_comp_helper.go 33.33% 3 Missing and 1 partial ⚠️
pkg/operations/volume_expansion.go 0.00% 3 Missing and 1 partial ⚠️
pkg/constant/labels.go 71.42% 1 Missing and 1 partial ⚠️
...ollers/apps/cluster/transformer_cluster_restore.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9491      +/-   ##
==========================================
+ Coverage   59.51%   59.81%   +0.29%     
==========================================
  Files         517      518       +1     
  Lines       55432    55913     +481     
==========================================
+ Hits        32993    33445     +452     
- Misses      19471    19485      +14     
- Partials     2968     2983      +15     
Flag Coverage Δ
unittests 59.81% <53.78%> (+0.29%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leon-inf leon-inf force-pushed the support/sharding-template branch from 2d4a6da to 88c7186 Compare June 30, 2025 02:23
@leon-inf leon-inf marked this pull request as ready for review June 30, 2025 02:23
@leon-inf leon-inf requested review from a team, ldming, wangyelei and zjx20 as code owners June 30, 2025 02:23
}
}

func (t *shardTemplate) create(generator *shardIDGenerator, shardingName string, cnt int) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will the name be different? How about using generator.shardingName directly instead of passing it via args?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

for i, shardingComp := range shardingCompList {
if shardingComp.Name == r.ComponentName {
compSpec = shardingCompList[i]
return compSpec, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

return shardingCompList[i], nil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@leon-inf leon-inf force-pushed the support/sharding-template branch from 9d8f283 to e46f393 Compare July 1, 2025 02:05
@leon-inf leon-inf force-pushed the support/sharding-template branch from e46f393 to a5e98e0 Compare July 1, 2025 02:17
func precheck(sharding *appsv1.ClusterSharding) error {
shards := int32(0)
shardIDs := sets.NewString()
for _, tpl := range sharding.ShardTemplates {
Copy link
Contributor

Choose a reason for hiding this comment

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

Check the uniqueness of tpl.Name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


func shardNamesTakeOverByTemplate(clusterName string, sharding *appsv1.ClusterSharding) []string {
result := make([]string, 0)
for name := range maps.Keys(shardNamesTakeOverByTemplateMap(clusterName, sharding)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The call to maps.Keys() is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@apecloud-bot apecloud-bot added the approved PR Approved Test label Jul 1, 2025
@leon-inf
Copy link
Contributor Author

leon-inf commented Jul 1, 2025

/approve

@leon-inf leon-inf merged commit 2009fbb into main Jul 1, 2025
62 of 64 checks passed
@leon-inf leon-inf changed the title chore: shard templates for heterogeneous shards chore: introduce the shard template for heterogeneous shards Jul 1, 2025
@leon-inf leon-inf deleted the support/sharding-template branch July 7, 2025 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR Approved Test nopick Not auto cherry-pick when PR merged size/XXL Denotes a PR that changes 1000+ lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants