Skip to content

reconcile: updated conditions for STS recreate#1925

Merged
AndrewChubatiuk merged 1 commit intomasterfrom
changed-sts-recreation-conditions
Mar 4, 2026
Merged

reconcile: updated conditions for STS recreate#1925
AndrewChubatiuk merged 1 commit intomasterfrom
changed-sts-recreation-conditions

Conversation

@AndrewChubatiuk
Copy link
Contributor

@AndrewChubatiuk AndrewChubatiuk commented Mar 4, 2026

  • do not recreate STS if VCT size was increased decreased and recreate in other cases
  • use 3-way merge for labels and annotations for VCT metadata
  • do not throw error on STS recreation

Summary by cubic

Refined StatefulSet recreation: we recreate when VCT spec/metadata or other immutable fields change; we expand PVCs in place on size increase, while downsizing still recreates. Recreation waits for deletion with orphaned pods and returns clearer, namespaced errors.

  • Bug Fixes
    • Recreate STS on VCT changes and immutable spec changes; ServiceName changes also recreate pods. Expand in place on PVC size increase; downsizing recreates. Uses 3-way merge for VCT labels/annotations to avoid unnecessary recreations.
    • Wait for StatefulSet deletion during recreation without throwing an error; error messages include the namespaced StatefulSet and PVC context.
    • Stabilized reconcile tests with testing/synctest; updated changelog.

Written for commit 10d4737. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/CHANGELOG.md">

<violation number="1" location="docs/CHANGELOG.md:28">
P1: Custom agent: **Changelog Review Agent**

These new BUGFIX entries violate the changelog mandatory structure by missing required issue/PR references.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): fix PVC being owned by StatefulSet and top-level object simultaenously. See [#1845](https://github.com/VictoriaMetrics/operator/issues/1845).
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): remove unneeded finalizer from core K8s resources. See [#835](https://github.com/VictoriaMetrics/operator/issues/835).
* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): remove finalizers from VMServiceScrape and VMPodScrape objects, and keep finalizers on VMAgent, VMCluster, and VMAuth when DeletionTimestamp is not empty.
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): recreate STS only if PVC immutable fields were changed or PVC size was decreased, before any PVC spec change led to STS recreation.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Custom agent: Changelog Review Agent

These new BUGFIX entries violate the changelog mandatory structure by missing required issue/PR references.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/CHANGELOG.md, line 28:

<comment>These new BUGFIX entries violate the changelog mandatory structure by missing required issue/PR references.</comment>

<file context>
@@ -25,6 +25,8 @@ aliases:
 * BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): fix PVC being owned by StatefulSet and top-level object simultaenously. See [#1845](https://github.com/VictoriaMetrics/operator/issues/1845).
 * BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): remove unneeded finalizer from core K8s resources. See [#835](https://github.com/VictoriaMetrics/operator/issues/835).
 * BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): remove finalizers from VMServiceScrape and VMPodScrape objects, and keep finalizers on VMAgent, VMCluster, and VMAuth when DeletionTimestamp is not empty.
+* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): recreate STS only if PVC immutable fields were changed or PVC size was decreased, before any PVC spec change led to STS recreation.
+* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): wait for STS deletion in case of recreation without throwing an error.
 
</file context>
Fix with Cubic

@vrutkovs vrutkovs force-pushed the changed-sts-recreation-conditions branch from 3eb934d to f165aeb Compare March 4, 2026 12:53
@vrutkovs vrutkovs force-pushed the changed-sts-recreation-conditions branch from f165aeb to bee5dc2 Compare March 4, 2026 13:00
@AndrewChubatiuk AndrewChubatiuk marked this pull request as draft March 4, 2026 13:05
@vrutkovs vrutkovs mentioned this pull request Mar 4, 2026
@AndrewChubatiuk AndrewChubatiuk force-pushed the changed-sts-recreation-conditions branch 2 times, most recently from c2761b4 to 082385b Compare March 4, 2026 13:40
@AndrewChubatiuk AndrewChubatiuk marked this pull request as ready for review March 4, 2026 13:42
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/CHANGELOG.md">

<violation number="1" location="docs/CHANGELOG.md:28">
P1: Custom agent: **Changelog Review Agent**

Both new BUGFIX entries violate the required changelog structure because they do not include issue/PR references, which are mandatory.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): fix PVC being owned by StatefulSet and top-level object simultaenously. See [#1845](https://github.com/VictoriaMetrics/operator/issues/1845).
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): remove unneeded finalizer from core K8s resources. See [#835](https://github.com/VictoriaMetrics/operator/issues/835).
* BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): remove finalizers from VMServiceScrape and VMPodScrape objects, and keep finalizers on VMAgent, VMCluster, and VMAuth when DeletionTimestamp is not empty.
* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): do not recreate STS if VCT size was increased and recreate in other cases.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Custom agent: Changelog Review Agent

Both new BUGFIX entries violate the required changelog structure because they do not include issue/PR references, which are mandatory.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/CHANGELOG.md, line 28:

<comment>Both new BUGFIX entries violate the required changelog structure because they do not include issue/PR references, which are mandatory.</comment>

<file context>
@@ -25,6 +25,8 @@ aliases:
 * BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): fix PVC being owned by StatefulSet and top-level object simultaenously. See [#1845](https://github.com/VictoriaMetrics/operator/issues/1845).
 * BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): remove unneeded finalizer from core K8s resources. See [#835](https://github.com/VictoriaMetrics/operator/issues/835).
 * BUGFIX: [vmdistributed](https://docs.victoriametrics.com/operator/resources/vmdistributed/): remove finalizers from VMServiceScrape and VMPodScrape objects, and keep finalizers on VMAgent, VMCluster, and VMAuth when DeletionTimestamp is not empty.
+* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): do not recreate STS if VCT size was increased and recreate in other cases.
+* BUGFIX: [vmoperator](https://docs.victoriametrics.com/operator/): wait for STS deletion in case of recreation without throwing an error.
 
</file context>
Fix with Cubic

@AndrewChubatiuk AndrewChubatiuk force-pushed the changed-sts-recreation-conditions branch from 082385b to ed53c0f Compare March 4, 2026 13:48
* do not recreate STS if VCT size was increased decreased and recreate in other cases
* do not throw error on STS recreation
@AndrewChubatiuk AndrewChubatiuk force-pushed the changed-sts-recreation-conditions branch from ed53c0f to 10d4737 Compare March 4, 2026 13:53
@AndrewChubatiuk AndrewChubatiuk merged commit e43073d into master Mar 4, 2026
6 checks passed
@AndrewChubatiuk AndrewChubatiuk deleted the changed-sts-recreation-conditions branch March 4, 2026 15:05
AndrewChubatiuk added a commit that referenced this pull request Mar 4, 2026
* do not recreate STS if VCT size was increased decreased and recreate in other cases
* do not throw error on STS recreation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants