nick-boss-tech opened a new pull request, #5171:
URL: https://github.com/apache/solr/pull/5171

   🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*
   
   
   https://issues.apache.org/jira/browse/SOLR-17752
   
   ## What happens today
   
   **A corrupted shard response is logged with the whole shard request and the 
whole response, and the query text can appear in both.**
   
   When a shard response lacks the expected section and does not set partial 
results, the warning logs the shard request and the full response at WARN 
([SolrResponseUtil.java#L55](https://github.com/nick-boss-tech/solr/blob/56ec140e3636d5f4150fa87fbf7103529536ac99/solr/core/src/java/org/apache/solr/util/SolrResponseUtil.java#L55)).
 These links point to the merge-base commit, `56ec140e3636`, which is the code 
before this change. The response header can echo the request params. SolrCore 
adds them when echoParams is explicit or all 
([SolrCore.java#L3004-L3007](https://github.com/nick-boss-tech/solr/blob/56ec140e3636d5f4150fa87fbf7103529536ac99/solr/core/src/java/org/apache/solr/core/SolrCore.java#L3004-L3007)),
 and the default configset sets explicit on `/select` 
([solrconfig.xml#L597](https://github.com/nick-boss-tech/solr/blob/56ec140e3636d5f4150fa87fbf7103529536ac99/solr/server/solr/configsets/_default/conf/solrconfig.xml#L597))
 and on `/query` ([solrconfig.xml#L605](https://github.c
 
om/nick-boss-tech/solr/blob/56ec140e3636d5f4150fa87fbf7103529536ac99/solr/server/solr/configsets/_default/conf/solrconfig.xml#L605)).
 The ticket notes that a query can carry customer data.
   
   ## What this change does
   
   **The warning now names the responding node and lists the response's 
top-level key names. It no longer prints the shard request or the response.**
   
   The new line reads `corrupted response on <node> : response contains keys 
[<top-level key names>]`. The node is the responding node name, or the shard 
address when the node name is null 
([SolrResponseUtil.java#L58-L61](https://github.com/nick-boss-tech/solr/blob/e5c0a64f993c7ce5e9a594f5a6eb0679925e9de9/solr/core/src/java/org/apache/solr/util/SolrResponseUtil.java#L58-L61)).
 The key-name helper, with a comment on why values are left out, is at [lines 
84-94](https://github.com/nick-boss-tech/solr/blob/e5c0a64f993c7ce5e9a594f5a6eb0679925e9de9/solr/core/src/java/org/apache/solr/util/SolrResponseUtil.java#L84-L94).
   
   The warning no longer shows the request's params, its purpose or its 
response count, or any response values. The exception thrown after the warning 
is unchanged.
   
   ## Proof
   
   **TestShardResponseLogging passed 1 of 1 at head e5c0a64f993c, verified 
2026-10-04.**
   
   The test builds a shard response whose request and response header both 
carry a query term. It checks that the warning names the node and does not 
contain the term 
([TestShardResponseLogging.java#L34-L70](https://github.com/nick-boss-tech/solr/blob/e5c0a64f993c7ce5e9a594f5a6eb0679925e9de9/solr/core/src/test/org/apache/solr/handler/component/TestShardResponseLogging.java#L34-L70)).
 On the unpatched code the test fails at the node-name assertion, and the 
warning it captures holds the query text in both the request and the response 
header. The formatting check, the Error Prone compile, and the core module 
check with tests excluded also passed at this head.
   
   ## Limits
   
   **The test builds its response by hand, and other log lines still print 
request params.**
   
   - The test builds the shard response by hand. It does not run a cluster with 
echoParams set.
   - Other log lines print request params at INFO or DEBUG, for example 
[SuggestComponent.java#L181](https://github.com/nick-boss-tech/solr/blob/56ec140e3636d5f4150fa87fbf7103529536ac99/solr/core/src/java/org/apache/solr/handler/component/SuggestComponent.java#L181),
 at the merge-base commit. They are not changed here. I can open that follow-up 
on request.
   
   Changelog: 
[changelog/unreleased/SOLR-17752.yml](https://github.com/nick-boss-tech/solr/blob/e5c0a64f993c7ce5e9a594f5a6eb0679925e9de9/changelog/unreleased/SOLR-17752.yml)
   
   ### AI assistance
   
   AI agents assisted with research, implementation, review, and drafting. Nick 
Shanin directed the work and takes responsibility for this contribution.
   


-- 
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