Skip to content

fix(helm): use Recreate strategy for persistence-backed single-replica deployments - #2

Merged
eksrha merged 1 commit into
mainfrom
fix/deployment-strategy-pvc-conflict
Aug 21, 2026
Merged

fix(helm): use Recreate strategy for persistence-backed single-replica deployments#2
eksrha merged 1 commit into
mainfrom
fix/deployment-strategy-pvc-conflict

Conversation

@eksrha

@eksrha eksrha commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Fast-follow to #1. During the rollout of #1's chart changes, the reranker deployment got stuck: FailedAttachVolume / Multi-Attach error for volume ... already used by pod(s) inference-inference-stack-reranker-... — confirmed live in the cluster.

Root cause: both embedding and reranker default to a single persistence-backed replica sharing one fixed-name ReadWriteOnce PVC. #1 unconditionally switched their update strategy to RollingUpdate (needed for the new replicaCount>1 horizontal-scaling support), but at the default replicaCount: 1 + persistence.enabled: true, RollingUpdate schedules the new pod before the old one releases the volume — an RWO PVC can only be attached to one pod at a time, so the new pod hangs indefinitely while the old one keeps running, and the rollout never completes (this is a hard Kubernetes deadlock, not a transient issue — it does not self-resolve).

Fix

strategy.type is now conditional on the exact same persistence.enabled && replicaCount<=1 guard #1 already uses to disable persistence at replicaCount>1:

Test plan

  • helm lint deploy/helm/ — clean
  • helm template verified for all three relevant cases: default values (persistence=true, replicaCount=1) → Recreate; replicaCount=3 (persistence auto-disabled) → RollingUpdate; persistence.enabled=false, replicaCount=1RollingUpdate
  • No Go code changed — go build ./... sanity-checked anyway
  • CI run on this PR (pending)
  • Manual: confirm a rolling upgrade with default values no longer produces a Multi-Attach error

https://claude.ai/code/session_01A7J6LSaRraBNWn8GtRpJ8t

…a deployments

Production incident during the #1 rollout: both embedding and reranker
default to a single persistence-backed replica sharing one fixed-name
ReadWriteOnce PVC. #1 unconditionally switched their update strategy to
RollingUpdate, which schedules the new pod before the old one releases
the volume — Kubernetes cannot attach an RWO PVC to two pods at once,
so the new pod hangs forever on a Multi-Attach error while the old one
keeps running, and the rollout never completes.

Strategy is now conditional on the same persistence-enabled +
replicaCount<=1 guard #1 already uses to disable persistence at
replicaCount>1: Recreate whenever a single persistence-backed replica
would conflict with itself, RollingUpdate otherwise (replicaCount>1, or
persistence disabled).

Claude-Session: https://claude.ai/code/session_01A7J6LSaRraBNWn8GtRpJ8t
@eksrha
eksrha merged commit 4314051 into main Aug 21, 2026
2 checks passed
@eksrha
eksrha deleted the fix/deployment-strategy-pvc-conflict branch August 21, 2026 10:27
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.

1 participant