kubeblocks icon indicating copy to clipboard operation
kubeblocks copied to clipboard

[BUG] 0-Replica component start gets stuck in Starting phase

Open zero2hj opened this issue 3 months ago • 7 comments

Describe the bug When stopping a component that originally had 0 replicas (e.g., dmmonitor in standalone mode), it enters an unrecoverable status. If it is subsequently started:

  1. The snapshot annotation apps.kubeblocks.io/stop-replicas-snapshot is never removed from etcd.
  2. Desired replica modifications (e.g., scaling from 0 to 1) are discarded.
  3. The component remains permanently stuck in the Starting phase, and the parent Cluster remains permanently stuck in Updating.

To Reproduce Steps to reproduce the behavior:

  1. Deploy a cluster that contain 0-replica component
  2. Stop the cluster
  3. Start the cluster

Expected behavior The 0-replica component can clear its stop-snapshot and can be furtuer used.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

zero2hj avatar Aug 27 '26 07:08 zero2hj

  • on 1.0.x , we failed to start a stoped zero-replica compont
  • on 1.1.x, we can start a stopped zero-replica compont, but failed to scale it from 0 -> 1.

shanshanying avatar Aug 28 '26 07:08 shanshanying

We added focused regression tests on release-1.1 (HEAD 96b1ddf61) but could not reproduce the reported 0 -> 1 scaling failure in the core controllers. The following paths all passed:

  • Start a stopped zero-replica Cluster component, then scale it from 0 to 1.
  • Start and scale the Cluster component from 0 to 1 in the same update.
  • The corresponding Component -> InstanceSet propagation paths.
  • Stop/start readiness and observed-generation convergence for a zero-replica InstanceSet.
  • HorizontalScaling OpsRequest from 0 to 1.

The relevant controller code is also unchanged between v1.1.0-beta.10 and the tested release-1.1 HEAD. We do not have the damengdb addon, so we could not reproduce the exact addon scenario.

Could you please provide the following information from the failing environment?

  1. Exact KubeBlocks version and controller image tag/digest.
  2. Exact damengdb addon version.
  3. The commands or OpsRequest YAML used to start and scale the component.
  4. Cluster, Component, and InstanceSet YAML after the start operation and again after the 0 -> 1 scale operation (including metadata generation, spec, status, and conditions).
  5. KubeBlocks controller logs covering both operations.

Please redact any credentials or other sensitive values.

leon-ape avatar Aug 28 '26 07:08 leon-ape

i used etcd cmpd as an example here in v 1.1. to reproduce

  1. update etcd cmpd , set replica limits to alow min 0 replcias
  2. create a etcd cluster with 0 replicas
  3. stop it --> stopped
  4. start it --> running
  5. scale it from 0 to 1 replicas --> running

but not pod is created, kubeblocks logs error

2026-08-28T10:23:09.612Z	INFO	build error: no available pod to dump data	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "Component": {"name":"etcd-cluster-etcd","namespace":"demo"}, "namespace": "demo", "name": "etcd-cluster-etcd", "reconcileID": "04b84a19-abe5-4176-98b0-f0ba025f7194", "component": {"name":"etcd-cluster-etcd","namespace":"demo"}}
2026-08-28T10:23:09.616Z	INFO	reconcile object *v1.Component with action STATUS OK	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "Component": {"name":"etcd-cluster-etcd","namespace":"demo"}, "namespace": "demo", "name": "etcd-cluster-etcd", "reconcileID": "04b84a19-abe5-4176-98b0-f0ba025f7194", "component": {"name":"etcd-cluster-etcd","namespace":"demo"}}
2026-08-28T10:23:09.617Z	INFO	no available pod to dump data	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "Component": {"name":"etcd-cluster-etcd","namespace":"demo"}, "namespace": "demo", "name": "etcd-cluster-etcd", "reconcileID": "04b84a19-abe5-4176-98b0-f0ba025f7194", "component": {"name":"etcd-cluster-etcd","namespace":"demo"}}
2026-08-28T10:23:09.617Z	ERROR	Reconciler error	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "Component": {"name":"etcd-cluster-etcd","namespace":"demo"}, "namespace": "demo", "name": "etcd-cluster-etcd", "reconcileID": "04b84a19-abe5-4176-98b0-f0ba025f7194", "error": "no available pod to dump data"}

It is confusing that cluster and compont are RUNNIING WITHOUT any replicas while expecting ONE.

shanshanying avatar Aug 28 '26 10:08 shanshanying

As the kubeblocks log indicated, ETCD failed to dump data (dump from existing replicas which is none) That's to say the combination of zero-replica and 'dump data' lifecycle action is invalid .

shanshanying avatar Aug 28 '26 11:08 shanshanying

Related test-coverage PR: #10824.

This PR only repairs the existing stopped-component scale tests and adds focused coverage for the zero-replica/data-action paths. It does not change controller or status behavior and is not intended to close this issue.

leon-ape avatar Aug 31 '26 02:08 leon-ape

just tested, it works on v1.0.3-beta.12

zero2hj avatar Sep 03 '26 09:09 zero2hj

This issue has been marked as stale because it has been open for 30 days with no activity

github-actions[bot] avatar Oct 05 '26 00:10 github-actions[bot]