pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.22k stars 493 forks source link

It should be forbidden to switch between mutiple operators if they use different kind of StatefulSet. #3693

Open cvvz opened 3 years ago

cvvz commented 3 years ago

Bug Report

What did you do?

  1. Deploy mutiple operators, some with AdvancedStatefulset=true, which means use AdvancedStatefulset, some use Kubernetes built-in Statefulset.
  2. Switch between these operators by changing the labels of TidbCluster.

What did you expect to see? Because different operators use different Statefulsets, it should not be able to switch between them.

What did you see instead? When tidb-controller-manager taked over TidbCluster after labels are matched with label selector, it will create AdvancedStatefulset or built-in StatefulSet according to the feature , which may lead to two different kind of Statefulset exist at the same time, but the new Statefulset can't create any Pod, because Pod names are being used.

cvvz commented 3 years ago

/assign

cvvz commented 3 years ago

@DanielZhangQD @shonge