Repository navigation
SOLR-11994: Add SearchRequestListener hook to SearchHandler - #5232
sarkaramrit1993 wants to merge 2 commits into
Conversation
|
🤖 AI text below 🤖 (reviewed by Nick Shanin) @sarkaramrit1993, two cases turned up while reviewing this, so I prepared fixes on top of your current head (
Diff with fixes and regression tests. There are two follow-up commits: the fixes ( Linux verification at
On the original PR code with the new tests, all three regressions fail as intended: the CPU snapshot reports 14 instead of 7, and distributed/local subquery requests produce 4 and 2 events instead of 1. Linux verification details. To bring both follow-up commits into your PR branch: You're welcome to take these commits or adapt the changes. |
|
Closing in favor of #5238, which has the same change rebased on main as a single commit. Thanks @nick-boss-tech, both findings were real.
|
SOLR-11994
Description
First step of SOLR-18571 (Query Insights). Adds a node-level hook that's notified when each top-level search finishes, so a module can track the slowest queries without parsing logs. Nothing changes unless a listener is registered.
Solution
SearchRequestListener, registered throughCoreContainer.addSearchRequestListener, followingSolrCore.addConfListener.SearchHandler.handleRequestcalls it on the coordinator after the search, with the request,ResponseBuilder, elapsed and CPU time, hits and any failure. Shard sub-requests,/getand/exportaren't reported.SearchHandler:SolrCore.executeruns for every handler, so it would have to filter out updates and admin calls. A lastSearchComponentmisses failed requests and needs solrconfig changes. The slow-query log only gives a text line above a threshold.Tests
SearchRequestListenerTeston a 2-shard cluster covers:/getand/exportskippedshards.tolerant/select