Skip to content

[fix] Harden PVC lifecycle and cross-namespace FDB references - #531

Merged
morningman merged 3 commits into
apache:masterfrom
Al-assad:fix/pvc-lifecycle-and-fdb-references
Nov 2, 2026
Merged

morningman merged 3 commits into
apache:masterfrom
Al-assad:fix/pvc-lifecycle-and-fdb-references

Conversation

@Al-assad

@Al-assad Al-assad commented Nov 1, 2026

Copy link
Copy Markdown
Member

What problem does this PR solve?

Compute-group PVC cleanup can race with scale transitions and delete claims needed by the desired replicas. Storage expansion may also be rejected when an existing claim carries historical or API-defaulted storage fields. Separately, an explicitly deleted PVC can remain blocked by an operator finalizer after its parent cluster has disappeared.

A namespace-scoped operator can also fail to resolve an FDB connection ConfigMap in another namespace because that object is outside its informer cache. Later changes to the referenced connection string may not trigger reconciliation.

This PR addresses these cases by:

  • Protecting claims used by current or desired compute-group replicas and checking live Pod references before deletion.
  • Allowing storage-request increases on operator-managed compute-group claims while continuing to reject unsupported storage-template changes.
  • Reading external FDB ConfigMaps through the uncached API reader and periodically reconciling cross-namespace references without expanding the cache watch scope. The operator still needs permission to get the referenced ConfigMap.
  • Reconciling already-deleting operator-managed PVCs independently of the parent DCR or DDC. Finalization waits for scheduled Pod references to disappear, preserves Kubernetes and third-party finalizers, and uses identity/concurrency checks to avoid modifying replacement claims.

The PVC finalizer controller does not initiate deletion of retained claims. This PR uses the existing manager namespace scope and does not introduce namespace-selector configuration or CRD changes.

Release note

Fix compute-group PVC cleanup and expansion during scaling, allow deleted Doris PVCs to complete finalization after their parent cluster is removed, and refresh cross-namespace FDB connection references for namespace-scoped operators.

Check List (For Author)

  • Test

    • Unit Test
      • Scale-transition and PVC storage-template regression cases.
      • Live-reader and cross-namespace FDB reference refresh cases.
      • PVC finalization with missing parents, active or terminating Pods, unrelated finalizers, API failures, conflicts and replacement claims.
      • go test ./... -count=1
      • go vet ./...
  • Behavior changed:

    • Yes. The affected scaling, resize, external-reference refresh and explicit deletion paths now converge; retained PVCs and unrelated finalizers remain protected.
  • Does this need documentation?

    • No. No new user-facing configuration or CRD fields are introduced.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@morningman
morningman merged commit eb08159 into apache:master Nov 2, 2026
3 checks passed
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