← Back to PureKit

How an Unbounded K8s CSI Retry Loop Burned 2.4 TiB/Day on System SSDs

#Kubernetes#CSI#SSD SMART#Write Amplification
How an Unbounded K8s CSI Retry Loop Burned 2.4 TiB/Day on System SSDs

The Symptom

System SSDs on a multi-node Linux storage cluster triggered rapid media-wear alerts. Using four independent sampling methods—including SMART 24-hour deltas, /proc/<pid>/io, and a 1.85-hour high-precision window—we measured a sustained 2.38–2.44 TiB/day write rate, accelerating by 1.53×.

Even more concerning, SMART attribute 180 (Unused_Rsvd_Blk_Cnt_Tot) had started dropping alongside reallocated-sector counters, proving real physical flash degradation with only 56–65 days of projected life left.

Tracing the Write-Amplification Chain

Process-level IO attribution ruled out regular log files (which accounted for <0.01% of writes) and exposed an unexpected cross-layer chain:

  1. Upstream trigger: Kubernetes external-provisioner was reconciling 36 deleted NFS PersistentVolumes whose underlying directories were non-empty.
  2. Permanent error retried forever: The storage API rejected non-empty directory deletion with HTTP 400. Although Kubernetes CSI uses exponential backoff (1s up to 5m), it has no retry cap and does not distinguish permanent 400 errors from transient failures.
  3. Database write amplification: Every failed delete logged a new audit record into a local database, and the cluster leader repeatedly synced full database copies (shutil.copyfile)—amplifying tiny failed API calls into 2.4 TiB/day of flash writes.

6-Step Remediation Order

  1. Confirm data disposability with PV owners and enable recursive force-delete for the 36 stuck volumes to stop new retries.
  2. Prune bloated audit records and run VACUUM to shrink the database footprint.
  3. Enable pre-sync compression (~80% write reduction) so normal replication never amplifies writes again.
  4. Only after write rates return to baseline, replace the worn system SSDs—swapping disks first would just burn through brand-new drives.

Enjoyed this note or seen a similar bug?

Feel free to drop a line—always glad to exchange ideas with fellow engineers.

Say hi · [email protected]