How an Unbounded K8s CSI Retry Loop Burned 2.4 TiB/Day on System SSDs
#Kubernetes#CSI#SSD SMART#Write Amplification
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:
- Upstream trigger: Kubernetes
external-provisionerwas reconciling 36 deleted NFS PersistentVolumes whose underlying directories were non-empty. - 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 permanent400errors from transient failures. - 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
- Confirm data disposability with PV owners and enable recursive force-delete for the 36 stuck volumes to stop new retries.
- Prune bloated audit records and run
VACUUMto shrink the database footprint. - Enable pre-sync compression (~80% write reduction) so normal replication never amplifies writes again.
- 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.