Skip to content

[PR-08] No-Op Write Suppression and Safe Status Patches #376

Closed as not planned
Closed as not planned

Description

@amuraru

Delivery bundle: B: Lifecycle correctness and status. See #397 and #368 for the four-PR stack.

Parent: #393
Roadmap: #368
Plan item: PR-08
Priority: P2
Dependencies: None

Kubernetes support: Rolling upstream-maintained minors; use the oldest/newest boundaries pinned in config/kubernetes-versions.env. See #368 for the current policy. Unrun jobs are not passed validation.

Problem Statement

Evidence: Ordinary cluster reconciliation writes Reconciling then Running; ensureFinalizers always updates; KafkaUser status writes are unconditional. Multiple controllers share KafkaCluster status.

Proposed Solution

Files: pkg/k8sutil/status.go, its tests, controllers/kafkacluster_controller.go, controllers/kafkauser_controller.go, Cruise Control status writers, and existing controller tests.

Interface contract: Each writer changes only its owned fields and avoids requests when desired state is unchanged. For contested fields, use a fresh-read retry with optimistic locking; never replay a stale whole status. Lists/finalizers must preserve other writers' entries.

  • Add request-count tests showing settled resources perform no unnecessary status/finalizer writes.
  • Add two-writer tests updating unrelated status fields and finalizers; assert neither loses the other's changes and real conflicts remain retryable.
  • Replace broad writes selectively with no-op-aware updates/patches. Preserve rolling-upgrade and broker-state signals used by other controllers.
  • Retain the PR-01 execution-persistence invariant if modifying that path; JSON merge patch is not a blanket substitute for field ownership.
  • Validate with go test ./controllers ./controllers/tests ./pkg/k8sutil; compare write/conflict metrics on the PR-07 workload.

Done when: Settled reconciles have a documented lower write count and concurrent status writers preserve each other's data.

Delivery: Four consolidated PRs, approved November 16, 2026: A -> B -> C; D branches from A. Foundation is #395. The 22 PR-XX identifiers are work-item IDs, not separate PRs. Preserve every work-item acceptance criterion and native dependency. No gated experiment is automatically enabled, and no issue is complete merely because one PR references it. D must satisfy its native #375 gate, including lifecycle-domain signals assigned to B; branching from A does not waive that merge prerequisite. Write focused regression tests first; record exact commands/results and run make check plus this issue's real-cluster/measurement gates.

Alternatives Considered

Twenty-two individual PRs add unnecessary integration overhead, while one omnibus PR obscures correctness and rollout boundaries. Deliver this scope in its approved dependency-aligned bundle. Do not expand into deferred consistency, storage, or concurrency changes without their own decision gates.

Additional Context

Baseline: 95138e0d; detailed roadmap scope: #368, section PR-08. The roadmap #368 and its native sub-issues are the planning source of truth. No planning document is committed in the final PR diffs. Re-read affected source and overlapping work before implementation. Historical baseline test passes are not validation of this change.

Activity

  1. added theissue type on Nov 16, 2026
  2. amuraru commented on Nov 17, 2026

    @amuraru
    Author

    Concrete status-conflict fixes move to #391; measured redundant-write reductions move to #393 under #368. No blanket status/patch migration. Closing this split tracking scope does not claim all original work implemented.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions