Repository navigation
feat(provisioner): report PVCs the sweep kept on missing records - #643
Conversation
Closes rossoctl#625. SweepResult gains kept (this pass's and earlier lone claims), orphanSweeper logs a summary every pass while any are kept, and docs/context-service.md says they count against moca-sandbox's ResourceQuota, with commands to list and remove them. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jeremy Cohn <[email protected]>
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Summary
Looks good. kept counts both paths correctly: the lone claim kept on an earlier pass (now kept, not skipped, and still excluded from the emptied-Redis guard), and the claim kept in this pass's sweepDue, counted only when the PVC was actually there. The summary line repeats every pass, and the new test pins that it stops once the record says deleted. The quota figures in the docs match provisioner.yaml, and SweepResult has no other consumers. One docs nit inline.
Author: moonlight16 (MEMBER — maintainer)
Areas reviewed: TypeScript (provisioner), tests, docs
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing
| known to be unwanted: | ||
|
|
||
| ```bash | ||
| kubectl -n moca-sandbox get pvc -l app=moca-workload-sandbox -L moca.dev/workload |
There was a problem hiding this comment.
nit: this lists every workload PVC, live ones included, so the reader still has to cross-check them against StatefulSets by hand (the note under the block says so). Consider printing the kept ones directly, e.g.:
comm -23 <(kubectl -n moca-sandbox get pvc -l app=moca-workload-sandbox -o name | sed 's|.*/||' | sort) \
<(kubectl -n moca-sandbox get sts -l app=moca-workload-sandbox -o name | sed 's|.*/||' | sort)(A claim still inside its grace window, between its create and its StatefulSet's, can show up briefly too. Re-run before deleting anything.)
There was a problem hiding this comment.
Good idea, done in a02b33c: the block now uses your comm -23 to print only the kept PVCs, and says to run it again before deleting, since a workload still being created can show up briefly.
Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jeremy Cohn <[email protected]>
Follow-up to Paolo's review of #615 (the cleanup sweep). Closes #625.
Today
moca-sandboxquota (32 PVCs and 320Gi by default), and the only sign is a per-workload log line that's easy to miss. Once enough pile up, new workloads with storage fail to get a PVC, with no obvious reason why.With this PR
keptcount: PVCs kept in this pass, plus ones kept earlier that are still there.N PVC(s) kept on missing records; they count against the moca-sandbox ResourceQuota until deleted by hand.docs/context-service.mdexplains that kept PVCs count against the quota, with commands to list them and to delete one. Nothing is deleted automatically: that stays a human decision.Tested: typecheck is clean, and all 111 provisioner tests pass. A new test checks the summary appears on every pass and stops once the PVC is gone. The existing tests now check the exact
keptcount.🤖 Generated with Claude Code