Skip to content

[BUG] Config restart timestamp is overwritten after a previous Restart OpsRequest #10910

Description

@leon-ape

Problem

On release-1.0 and release-1.1, a previous Restart OpsRequest can cause a later file-template configuration change to lose its restart signal. This was reported with KubeBlocks 1.0.3-beta.13 during RustFS/MinIO horizontal scaling: existing replicas can retain their old process configuration while new replicas start with the expanded configuration.

Reproduction

  1. Use a component with a config template that enables restartOnFileChange.
  2. Complete a Restart OpsRequest. Its timestamp T0 remains in the component annotations in the Cluster spec.
  3. Change a template variable, for example by scaling the component so the rendered config changes.
  4. The component controller writes a newer timestamp T1 to InstanceSet.spec.template.annotations["kubeblocks.io/restart"].
  5. On the next reconciliation, the ConfigMap already contains the desired data. The rebuilt pod template carries T0 from the Component spec and overwrites T1.

The restart signal can disappear before the workload controller finishes consuming it. Two concurrent Restart OpsRequests are not required; rollout behavior depends on reconciliation timing.

Expected behavior and fix

Merge valid RFC3339 restart timestamps by retaining the later instant. Preserve the existing representation for equal instants, and retain existing annotation merge behavior when either value is not a timestamp. A subsequent newer Restart OpsRequest must still propagate.

Apply this fix to release-1.1 and verify automatic picking to release-1.0. Main uses config hashes and spec.configs[].restart for config-driven restarts, so this conflict does not occur on that path. The separate parameters-controller config.kubeblocks.io/restart-* annotations are outside this defect.

Validation

  • Regression cases for older/newer timestamps, equal instants, timezone offsets, fractional seconds, missing values, opaque values, and repeated reconciliation.
  • Component controller integration tests for config-triggered restart after an earlier explicit restart, retaining the signal, and accepting a subsequent explicit restart.
  • Local pick and equivalent tests on release-1.0.

Related report: https://github.com/apecloud/apecloud/issues/20826

Tracking

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions