-
Notifications
You must be signed in to change notification settings - Fork 499
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
scaling for tiflash #2237
scaling for tiflash #2237
Conversation
@@ -305,7 +305,6 @@ func (fpc *FakePodControl) UpdateMetaInfo(_ *v1alpha1.TidbCluster, pod *corev1.P | |||
} | |||
|
|||
setIfNotEmpty(pod.Labels, label.NameLabelKey, TestName) | |||
setIfNotEmpty(pod.Labels, label.ComponentLabelKey, TestComponentName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to set it here, the caller function already set it and this will overwrite the setting in the cases.
@@ -127,6 +127,7 @@ func (rpc *realPVCControl) UpdateMetaInfo(tc *v1alpha1.TidbCluster, pvc *corev1. | |||
if pvc.Labels[label.ClusterIDLabelKey] == clusterID && | |||
pvc.Labels[label.MemberIDLabelKey] == memberID && | |||
pvc.Labels[label.StoreIDLabelKey] == storeID && | |||
pvc.Labels[label.AnnPodNameKey] == podName && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add pod name label so we can list all the PVCs of one Pod.
@weekface comments addressed, PTAL. |
Thanks for the fix. Is there a rc release for this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can directly manage tiflash in webhook.
return err | ||
} | ||
|
||
if controller.PodWebhookEnabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can manage tiflash scaling in the webhook instead of in the controller as webhook would be the default choice to manage the lifecyle of each component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When will Webhook be the default choice? I think it's not decided yet, btw, before v1.15, all of the requests for Pod will be sent to the Webhook if enabled, if something wrong with the Webhook, it will block the whole cluster, so I would like to support it in controller first.
ns := tc.GetNamespace() | ||
// for unit test | ||
skipReason := map[int32]string{} | ||
skipReason := map[string]string{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change the skipReason type here, is it for the legibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now there will be multiple PVCs for one Pod, the string
will be podName if no PVC found for the Pod and will be the pvcName if any PVC found, and then we can verify the result in the UT cases.
5c44dd2
to
b4253a1
Compare
@Yisaer comments addressed, PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-e2e-tests |
1 similar comment
/run-e2e-tests |
skipReason[ordinal] = skipReasonScalerPVCNotFound | ||
return skipReason, nil | ||
} | ||
// pvcName := ordinalPVCName(memberType, setName, ordinal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line
/run-cherry-picker |
cherry pick to release-1.1 failed |
* scaling for tiflash * address comments * remove minor fixes * revert incorrect changes
What problem does this PR solve?
Scaling for TiFlash
What is changed and how does it work?
Add new function to support scaling TiFlash
Check List
Tests
Code changes
Does this PR introduce a user-facing change?: