refactor(inkless:delete): improve retention-enforcement observability #725
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 485 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.370
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #725"
general
weight: 0.35
giuseppelillo
Improves observability of diskless retention enforcement and file cleanup. No change to enforcement or cleanup behavior. Three focused commits, all in the
io.aiven.inkless.delete/ control-plane area.What changed
RetentionEnforcementScheduleLagMsgauge: milliseconds the most overdue diskless partition is past its scheduled enforcement time (0 when on schedule; a sustained positive value means enforcement is falling behind its per-partition cadence). Fed by the scheduler's oldest past-due queue entry, read under a lock so the metrics/JMX thread and the enforcement thread don't race thePriorityQueue.EnforceRetentionJobruns one transaction per partition (post-#705), soEnforceRetentionQueryTime/QueryRateare now recorded per partition instead of once per wave. No new metric.Metrics
New:
RetentionEnforcer.RetentionEnforcementScheduleLagMs— gauge (ms).Redefined (operator impact — re-baseline any dashboards/alerts on these):
PostgresControlPlane.EnforceRetentionQueryTimeandEnforceRetentionQueryRatenow measure a singleenforce_retention_v2call (one partition) rather than the whole wave.QueryRaterises by roughly partitions-per-wave with no config change;QueryTimepercentiles become per-partition latencies. Nothing is lost — the whole-wave duration remainsRetentionEnforcer.RetentionEnforcementTotalTimeand the wave count remainsRetentionEnforcementRate. Per-transaction latency is the more accurate thing to measure since each partition is its own transaction.Logs
Enforcing retention for {n} partitions/Enforced retention for {n} partitions in {ms} ms: {b} batches, {y} bytes deleted. One pair per non-empty cycle; empty cycles stay silent (no per-tick heartbeat, since the enforcer ticks every 500ms).Running file cleaner at {now}heartbeat (redundant with the log framework timestamp and the outcome line) with a work-gated pair —Running file cleaner: deleting {n} of {m} marked files/File cleaner deleted {n} files in {ms} ms(them - nfiles are still within the retention grace period).readyPartitionswhile responses align with the delete-policy-filteredrequests); now uses a list kept aligned 1:1 withrequests/responses. Latent today (diskless doesn't support compaction, so the lists don't diverge) but made correct.Operator notes
EnforceRetentionQueryTime/EnforceRetentionQueryRate(semantics changed as above).RetentionEnforcementScheduleLagMsreturns 0 for both "on schedule" and "empty queue" (no diskless delete-policy partitions yet, or during startup); pair it with queue activity if that distinction matters.FileToDeletecarries only the object key, and batches are already deleted by cleanup time.Testing
scheduleLagTracksOverduePartition(empty -> 0, future head -> 0, advance past due -> exact lag).durationCallbackFiresOncePerPartition(3 callbacks for 3 requests, including a non-existent partition).metrics.rstregenerated; checkstyle (main + test) clean.