SOLR-18591: Don't double-count shard cpuTime on tolerant partial failure #5239
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 237 lines diff across 2 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.327
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #5239"
general
weight: 0.35
sigram
JIRA: SOLR-18591
Description
With
solr.log.cputime=trueandshards.tolerant=true,SearchHandler.processComponentsDistribadds a shard request's CPU in the partial-failure branch and again at the bottom of the response loop. So when one shard fails, the finalcpuTimeover-reports, and the header ends up with severalcpuTimeentries.NamedList.getreturns the first one, so clients see a partial total. The extra add came in with SOLR-17151. This is the only double add inSearchHandler.Solution
Remove the
publishCpuTimeblock from the partial-failure branch. The bottom-of-loop add and the final header write already cover that response.Out of scope on purpose:
shortCircuitedResultsnever writes the accumulated shardcpuTime, so a query-limit short-circuit in a distributed search reports only coordinator CPU. I found it while checking whether the removed block, which SOLR-17151 added alongside thecheckLimitsBeforecalls, was there to keep shard CPU on a short-circuit. It isn't: no short-circuit return inprocessComponentsDistribwrites shardcpuTimeonmain. The only case this PR changes is a short-circuit right after a tolerant shard failure, where the removed block happened to leave a shard total in the header. Happy to fold the gap into this PR if reviewers prefer.Tests
TolerantShardCpuTimeTesthas each shard report a fixedcpuTimeand fails one shard. Onmainthe single-pass case gets[1000, 2000](expected[1000]) and the two-phase case gets[1000, 3000](expected[2000]). Both pass with the fix.TestCpuTimeSearch,TestCpuAllowedLimit,ComponentStageLimitsTest,TestQueryLimits,TestMemAllowedLimitandTestEarlyTerminatingQueriesstill pass.