fix(inkless:switch): send each partition alone when a batched control-plane init fails [KC-839] #883
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 315 lines diff across 3 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.344
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #883"
general
weight: 0.35
giuseppelillo
AwaitingMetadata.sendBatchsends every queued partition to the control plane in oneinitDisklessLogcall. The Postgres control plane applies the call in one transaction, so a partition whose content it rejects fails the call for the whole batch. The broker then retried every partition of the batch together, and the queue added each partition that reachedAwaitingMetadatalater to the same failing batch. No control-plane row appeared for those partitions, and produce to them failed until leadership moved.InitDisklessLogJobnow throwsControlPlaneRequestRejectedExceptionwhen PostgreSQL rejects the content of the request. A rejection is an error with SQLState class22or23, such as thetimestamp_tdomain check, or withP0001, which the init function raises. If the control plane rejects a batch of several requests, the broker sends each request alone. The other partitions of the batch then complete. A partition that the control plane still rejects stays inAwaitingMetadataand retries with the usual backoff. Each failed attempt logs an error with the exception, and theAwaitingMetadataPartitions,OldestAwaitingMetadataAgeMs, andInitRetriedPerSecmetrics show the partition.A lost connection or a pool timeout doesn't depend on the requests. After such a failure, the broker retries the whole batch with the queue backoff and doesn't send the partitions alone. If such a failure happens during the per-partition pass, the pass stops, and the remaining partitions retry without a call of their own.
Testing
InitDisklessLogManagerTestuses a control plane that rejects every call that contains partition 0. The other partition of the first batch completes after the per-partition resend, and so does a partition that arrives while partition 0 retries. Partition 0 stays tracked inAwaitingMetadata, and the gauge and the retry meter count it. Without the fix, the broker resends the whole batch and the test fails.Other
InitDisklessLogManagerTestcases check that a failing call with one request makes one call, that a failure that isn't a rejection retries the batch without per-partition calls, and that a failure during the per-partition pass stops it.JobUtilsTestchecks which SQLStates count as a rejection, including a Hikari pool timeout.PostgresControlPlaneTestchecks that a producer state timestamp of-6fails the call withControlPlaneRequestRejectedException.Fixes KC-839.
🤖 Generated with Claude Code