sarkaramrit1993 opened a new pull request, #5239:
URL: https://github.com/apache/solr/pull/5239

   JIRA: [SOLR-18591](https://issues.apache.org/jira/browse/SOLR-18591)
   
   # Description
   
   With `solr.log.cputime=true` and `shards.tolerant=true`, 
`SearchHandler.processComponentsDistrib` adds 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 final `cpuTime` over-reports, and the header ends up with 
several `cpuTime` entries. `NamedList.get` returns the first one, so clients 
see a partial total. The extra add came in with 
[SOLR-17151](https://issues.apache.org/jira/browse/SOLR-17151). This is the 
only double add in `SearchHandler`.
   
   # Solution
   
   Remove the `publishCpuTime` block from the partial-failure branch. The 
bottom-of-loop add and the final header write already cover that response.
   
   Out of scope on purpose: `shortCircuitedResults` never writes the 
accumulated shard `cpuTime`. So when a query limit short-circuits a distributed 
search, the header reports only coordinator CPU. That's already true on `main` 
for every short-circuit. The one case this PR changes is a short-circuit right 
after a tolerant shard failure, where the removed block used to leave a shard 
total in the header. Happy to fold the gap into this PR if reviewers prefer.
   
   # Tests
   
   `TolerantShardCpuTimeTest` has each shard report a fixed `cpuTime` and fails 
one shard. On `main` the 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`, `TestMemAllowedLimit` and 
`TestEarlyTerminatingQueries` still pass.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to