Cluster stuck in updating: pods missing a role label
Symptoms
- The Cluster resource stays in phase
Updatingafter all pods areRunningand ready. - One or more pods have no value in the
kubeblocks.io/rolelabel while their peers showprimaryorsecondary:
Diagnosis
-
Confirm the database itself is healthy. For a sharded cluster, each shard
-0pod should reportmasterandcluster_state:ok:For standalone, replicated, or Sentinel topologies, use thefalkordbcontainer name instead offalkordb-cluster. -
Check that the role probe ran on the affected pod. The kbagent sidecar logs the probed role:
A healthy probe logs
"output": "primary"(orsecondary). -
Check the KubeBlocks controller for a failed label update:
The signature of this case is an event reconcile error such as:
Root cause
The kbagent role probe reports the role once and re-emits it only when the role changes. If the KubeBlocks event controller loses an optimistic-concurrency conflict while writing thekubeblocks.io/role pod label (common during post-provision churn, when several controllers update the same pod), the write is dropped and never retried. The database is healthy; only the label is missing, which keeps the Cluster in Updating.
Fix
Apply the label the controller failed to write, matching the actual role reported by the database in the diagnosis step:Running as soon as all pods carry a role label:
Only set the label to the role the database actually reports. Labeling a replica as primary misroutes client traffic sent through the read-write Service.