You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Kubernetes are you using?
Client Version: v1.31.1
Kustomize Version: v5.4.2
What version of TiDB Operator are you using?
v1.6.0
What did you do?
We deployed a tidb cluster with 3 replicas of pd, tikv and tidb. After the cluster is fully up and healthy, we changed the spec.tidb.config and set status.status-port to 10079.
The last pod terminated and restarted with the updated configuration. However, TiDB operator cannot connect to the restarted pod because the status-port was still set to old port number (10080) in the StatefulSet, which is inconsistent with the TiDB's configuration. TiDB operator uses the port in the StatefulSet to query the health of the TiDB Pods, and fails to get TiDB's status. It mistakens the TiDB Pods as unhealthy and indefinitely waits.
What did you expect to see?
We expected to see the tidb restarts and new configuration takes effect.
What did you see instead?
The last pod terminated and restarted. However, operator cannot connect to the pod because the status-port was still set to 10080 in the statefulset. Thus, the operator thought the last pod still needs time to be ready and hanged.
Root Cause
The operator uses 10080 as default value for the status-port. When user specify the status-port in spec.tidb.config, the operator still creates statefulset using the default value. This causes operator connecting to the pod using wrong port.
The text was updated successfully, but these errors were encountered:
Bug Report
What version of Kubernetes are you using?
Client Version: v1.31.1
Kustomize Version: v5.4.2
What version of TiDB Operator are you using?
v1.6.0
What did you do?
We deployed a tidb cluster with 3 replicas of pd, tikv and tidb. After the cluster is fully up and healthy, we changed the
spec.tidb.config
and setstatus.status-port
to10079
.The last pod terminated and restarted with the updated configuration. However, TiDB operator cannot connect to the restarted pod because the status-port was still set to old port number (10080) in the StatefulSet, which is inconsistent with the TiDB's configuration. TiDB operator uses the port in the StatefulSet to query the health of the TiDB Pods, and fails to get TiDB's status. It mistakens the TiDB Pods as unhealthy and indefinitely waits.
The TiDB operator gets the status of the Pods in
tidb-operator/pkg/manager/member/tidb_member_manager.go
Line 1051 in 1867f39
which constructs the URL with the v1alpha1.DefaultTiDBStatusPort at
tidb-operator/pkg/controller/tidb_control.go
Line 152 in 24fa283
The status port on the TiDB container is also hardcoded:
tidb-operator/pkg/manager/member/tidb_member_manager.go
Line 935 in 1867f39
How to reproduce
status.status-port
to thespec.tidb.config
What did you expect to see?
We expected to see the tidb restarts and new configuration takes effect.
What did you see instead?
The last pod terminated and restarted. However, operator cannot connect to the pod because the
status-port
was still set to10080
in the statefulset. Thus, the operator thought the last pod still needs time to be ready and hanged.Root Cause
The operator uses
10080
as default value for thestatus-port
. When user specify thestatus-port
inspec.tidb.config
, the operator still creates statefulset using the default value. This causes operator connecting to the pod using wrong port.The text was updated successfully, but these errors were encountered: