Amrit Sarkar created SOLR-18582:
-----------------------------------

             Summary: Query Insights: optionally keep top queries across a node 
restart
                 Key: SOLR-18582
                 URL: https://issues.apache.org/jira/browse/SOLR-18582
             Project: Solr
          Issue Type: Sub-task
          Components: metrics
            Reporter: Amrit Sarkar


Top queries live only in memory, so a node restart empties its current and 
previous window. This adds an opt-in snapshot so a quick restart, such as a 
rolling restart, keeps them.

*Scope*
* Off by default, enabled with {{solr.queryinsights.snapshot.enabled=true}}.
* Write one JSON file on clean shutdown and at each window rotation, on a 
background thread. Nothing is written per query, so the search path is 
unchanged.
* Write to a temp file and move it into place, so a crash mid-write never 
leaves a partial file.
* On startup, load only windows that haven't ended yet. If the window size or 
top-N size changed, or the file can't be read, log once and start empty.
* File lives under the Solr home, checked with {{assertPathAllowed}}.
* Size is small: about 0.35 MB at defaults, 3.4 MB at the max settings.

*Limits*
* With the default 5 minute window, a restart longer than that restores 
nothing. This is not stored history; that stays a separate step on a time 
routed collection.
* The file holds query text on disk. Params are redacted before recording, so 
{{params.hidden}} values never reach it.

*Tests*: record queries, stop and restart the node within the window, check the 
same top-N comes back. Check an expired or corrupt snapshot starts empty.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

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

Reply via email to