Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ Other Changes
apparently has negligible impact on search performance so it's used now for all queries regardless of
their query limits params. (Andrzej Bialecki)

* PR#3758: Logs: removed webapp=/solr and also removed from internal context map.

================== 9.10.0 ==================
New Features
---------------------
Expand Down
13 changes: 4 additions & 9 deletions solr/core/src/java/org/apache/solr/core/SolrCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -2981,18 +2981,13 @@ public static void preDecorateResponse(SolrQueryRequest req, SolrQueryResponse r
final NamedList<Object> responseHeader = new SimpleOrderedMap<>();
rsp.addResponseHeader(responseHeader);

// toLog is a local ref to the same NamedList used by the response
NamedList<Object> toLog = rsp.getToLog();

// for back compat, we set these now just in case other code
// are expecting them during handleRequest
toLog.add("webapp", req.getContext().get("webapp"));
toLog.add(PATH, req.getContext().get(PATH));
rsp.addToLog(PATH, req.getContext().get(PATH));

// params:
final SolrParams params = req.getParams();
final String lpList = params.get(CommonParams.LOG_PARAMS_LIST);
if (lpList == null) {
toLog.add("params", "{" + req.getParamString() + "}");
rsp.addToLog("params", "{" + req.getParamString() + "}");
} else if (lpList.length() > 0) {

// Filter params by those in LOG_PARAMS_LIST so that we can then call toString
Expand Down Expand Up @@ -3022,7 +3017,7 @@ public String[] getParams(String param) { // assume param is in lpSet
} // assume in lpSet
};

toLog.add("params", "{" + filteredParams + "}");
rsp.addToLog("params", "{" + filteredParams + "}");
}
}

Expand Down
7 changes: 0 additions & 7 deletions solr/core/src/java/org/apache/solr/rest/BaseSolrResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,6 @@ public void doInit(SolrQueryRequest solrRequest, SolrQueryResponse solrResponse)
String responseWriterName = solrRequest.getParams().get(CommonParams.WT, JSON);
responseWriter = solrCore.getQueryResponseWriter(responseWriterName);
contentType = responseWriter.getContentType(solrRequest, solrResponse);
final String path = solrRequest.getPath();
if (!RestManager.SCHEMA_BASE_PATH.equals(path)) {
// don't set webapp property on the request when context and core/collection are excluded
final int cutoffPoint = path.indexOf('/', 1);
final String firstPathElement = -1 == cutoffPoint ? path : path.substring(0, cutoffPoint);
solrRequest.getContext().put("webapp", firstPathElement); // Context path
}

// client application can set a timeout for update requests
String updateTimeoutSecsParam = solrRequest.getParams().get(UPDATE_TIMEOUT_SECS);
Expand Down
4 changes: 0 additions & 4 deletions solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -719,10 +719,6 @@ protected void sendError(int code, String message) throws IOException {
}

protected void executeCoreRequest(SolrQueryResponse rsp) {
// a custom filter could add more stuff to the request before passing it on.
// for example: sreq.getContext().put( "HttpServletRequest", req );
// used for logging query stats in SolrCore.execute()
solrReq.getContext().put("webapp", req.getContextPath());
solrReq.getCore().execute(handler, solrReq, rsp);
}

Expand Down
14 changes: 7 additions & 7 deletions solr/core/src/test/org/apache/solr/cli/PostLogsToolTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private String sometimesSolr9Format(String record) {
public void testQueryRecord() throws Exception {
String record =
sometimesSolr9Format(
"2019-12-09 15:05:11.931 INFO (qtp2103763750-21) [c:logs4 s:shard1 r:core_node2 x:logs4_shard1_replica_n1] o.a.s.c.S.Request [logs4_shard1_replica_n1] webapp=/solr path=/select params={q=*:*&_=1575835181759&shards.purpose=36&isShard=true&wt=javabin&distrib=false} hits=234868 status=0 QTime=8\n");
"2019-12-09 15:05:11.931 INFO (qtp2103763750-21) [c:logs4 s:shard1 r:core_node2 x:logs4_shard1_replica_n1] o.a.s.c.S.Request [logs4_shard1_replica_n1] path=/select params={q=*:*&_=1575835181759&shards.purpose=36&isShard=true&wt=javabin&distrib=false} hits=234868 status=0 QTime=8\n");
List<SolrInputDocument> docs = readDocs(record);
assertEquals(docs.size(), 1);
SolrInputDocument doc = docs.get(0);
Expand Down Expand Up @@ -99,7 +99,7 @@ public void testQueryRecord() throws Exception {
public void testRecordsFirstInstanceOfSingleValuedParams() throws Exception {
final String record =
sometimesSolr9Format(
"2019-12-09 15:05:01.931 INFO (qtp2103763750-21) [c:logs4 s:shard1 r:core_node2 x:logs4_shard1_replica_n1] o.a.s.c.S.Request [logs4_shard1_replica_n1] webapp=/solr path=/select params={q=*:*&q=inStock:true&_=1575835181759&shards.purpose=36&isShard=true&wt=javabin&wt=xml&distrib=false} hits=234868 status=0 QTime=8\n");
"2019-12-09 15:05:01.931 INFO (qtp2103763750-21) [c:logs4 s:shard1 r:core_node2 x:logs4_shard1_replica_n1] o.a.s.c.S.Request [logs4_shard1_replica_n1] path=/select params={q=*:*&q=inStock:true&_=1575835181759&shards.purpose=36&isShard=true&wt=javabin&wt=xml&distrib=false} hits=234868 status=0 QTime=8\n");

List<SolrInputDocument> docs = readDocs(record);
assertEquals(docs.size(), 1);
Expand All @@ -116,7 +116,7 @@ public void testRecordsFirstInstanceOfSingleValuedParams() throws Exception {
public void testRTGRecord() throws Exception {
final String record =
sometimesSolr9Format(
"2020-03-19 20:00:30.845 INFO (qtp1635378213-20354) [c:logs4 s:shard8 r:core_node63 x:logs4_shard8_replica_n60] o.a.s.c.S.Request [logs4_shard8_replica_n60] webapp=/solr path=/get params={qt=/get&_stateVer_=logs4:104&ids=id1&ids=id2&ids=id3&wt=javabin} status=0 QTime=61");
"2020-03-19 20:00:30.845 INFO (qtp1635378213-20354) [c:logs4 s:shard8 r:core_node63 x:logs4_shard8_replica_n60] o.a.s.c.S.Request [logs4_shard8_replica_n60] path=/get params={qt=/get&_stateVer_=logs4:104&ids=id1&ids=id2&ids=id3&wt=javabin} status=0 QTime=61");

List<SolrInputDocument> docs = readDocs(record);
assertEquals(docs.size(), 1);
Expand All @@ -139,8 +139,8 @@ public void testRTGRecord() throws Exception {
public void testUpdateRecords() throws Exception {
String record =
sometimesSolr9Format(
"2019-12-25 20:38:23.498 INFO (qtp2103763750-126) [c:logs3 s:shard1 r:core_node2 x:logs3_shard1_replica_n1] o.a.s.u.p.LogUpdateProcessorFactory [logs3_shard1_replica_n1] webapp=/solr path=/update params={commitWithin=1000&overwrite=true&wt=json&_=1577306114481}{deleteByQuery=*:* (-1653925534487281664)} 0 11\n"
+ "2019-12-25 20:42:13.411 INFO (qtp2103763750-303) [c:logs5 s:shard1 r:core_node2 x:logs5_shard1_replica_n1] o.a.s.u.p.LogUpdateProcessorFactory [logs5_shard1_replica_n1] webapp=/solr path=/update params={commitWithin=1000&overwrite=true&wt=json&_=1577306114481}{delete=[03bbe975-728a-4df8-aa25-fe25049dc0ef (-1653925775577972736)]} 0 1\n");
"2019-12-25 20:38:23.498 INFO (qtp2103763750-126) [c:logs3 s:shard1 r:core_node2 x:logs3_shard1_replica_n1] o.a.s.u.p.LogUpdateProcessorFactory [logs3_shard1_replica_n1] path=/update params={commitWithin=1000&overwrite=true&wt=json&_=1577306114481}{deleteByQuery=*:* (-1653925534487281664)} 0 11\n"
+ "2019-12-25 20:42:13.411 INFO (qtp2103763750-303) [c:logs5 s:shard1 r:core_node2 x:logs5_shard1_replica_n1] o.a.s.u.p.LogUpdateProcessorFactory [logs5_shard1_replica_n1] path=/update params={commitWithin=1000&overwrite=true&wt=json&_=1577306114481}{delete=[03bbe975-728a-4df8-aa25-fe25049dc0ef (-1653925775577972736)]} 0 1\n");
List<SolrInputDocument> docs = readDocs(record);
assertEquals(docs.size(), 2);
SolrInputDocument doc = docs.get(0);
Expand Down Expand Up @@ -238,7 +238,7 @@ public void testErrorRecord() throws Exception {
+ "\tat org.apache.solr.parser.SolrQueryParserBase.parse(SolrQueryParserBase.java:262)\n"
+ "\t... 44 more\n"
+ "\n"
+ "2019-12-09 15:05:01.931 INFO (qtp2103763750-21) [c:logs4 s:shard1 r:core_node2 x:logs4_shard1_replica_n1] o.a.s.c.S.Request [logs4_shard1_replica_n1] webapp=/solr path=/select params={q=*:*&_=1575835181759&isShard=true&wt=javabin&distrib=false} hits=234868 status=0 QTime=8\n";
+ "2019-12-09 15:05:01.931 INFO (qtp2103763750-21) [c:logs4 s:shard1 r:core_node2 x:logs4_shard1_replica_n1] o.a.s.c.S.Request [logs4_shard1_replica_n1] path=/select params={q=*:*&_=1575835181759&isShard=true&wt=javabin&distrib=false} hits=234868 status=0 QTime=8\n";
List<SolrInputDocument> docs = readDocs(record);
assertEquals(docs.size(), 2);
SolrInputDocument doc = docs.get(0);
Expand Down Expand Up @@ -270,7 +270,7 @@ public void testErrorRecord() throws Exception {
@Test
public void testCommit() throws Exception {
String record =
"2021-10-08 16:42:10.636 INFO (qtp1080476785-26) [c:collection1 s:shard1 r:core_node2 x:collection1_shard1_replica_n1] o.a.s.u.p.LogUpdateProcessorFactory [collection1_shard1_replica_n1] webapp=/solr path=/update params={waitSearcher=true&commit=true&softCommit=false&wt=javabin}{commit=} 0 152";
"2021-10-08 16:42:10.636 INFO (qtp1080476785-26) [c:collection1 s:shard1 r:core_node2 x:collection1_shard1_replica_n1] o.a.s.u.p.LogUpdateProcessorFactory [collection1_shard1_replica_n1] path=/update params={waitSearcher=true&commit=true&softCommit=false&wt=javabin}{commit=} 0 152";
List<SolrInputDocument> docs = readDocs(record);
assertEquals(docs.size(), 1);
SolrInputDocument doc = docs.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ And you should see the following as output:
"x": "y",
"rows": "10"},
"context":{
"webapp": "/solr",
"path": "/mypath",
"httpMethod": "GET"}}
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ curl http://localhost:8983/solr/gettingstarted/test?omitHeader=true
"params":{
"omitHeader":"true"},
"context":{
"webapp":"/solr",
"path":"/test",
"httpMethod":"GET"},
"class":"org.apache.solr.core.RuntimeLibReqHandler",
Expand Down Expand Up @@ -396,7 +395,6 @@ curl http://localhost:8983/solr/gettingstarted/test?omitHeader=true
"omitHeader": "true"
},
"context": {
"webapp": "/solr",
"path": "/test",
"httpMethod": "GET"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ Solr now lets you access models encoded in ONNX format, commonly sourced from Hu
The DocumentCategorizerUpdateProcessorFactorythat lets you perform sentiment and other classification tasks on fields.
It is available as part of the `analysis-extras` module.



=== Deprecation removals

* The `jaegertracer-configurator` module, which was deprecated in 9.2, is removed. Users should migrate to the `opentelemetry` module.
Expand Down Expand Up @@ -178,6 +176,7 @@ Nowadays, the HTTP request is available via internal APIs: `SolrQueryRequest.get
* There is no longer a distinction between trusted and untrusted configSets; all configSets are now considered trusted. To ensure security, Solr should be properly protected using authentication and authorization mechanisms, allowing only authorized users with administrative privileges to publish them.

=== Upgrade to Jetty 12.x

Solr upgraded to Jetty 12.x from 10.x as Jetty 10 and 11 have reached end-of-life support. Jetty 12.x requires Java 17 or newer and is fully compatible with Solr's new minimum requirement of Java 21. This upgrade brings support for modern HTTP protocols and adopts the Jakarta EE 10 namespace. For more details, see https://webtide.com/jetty-12-has-arrived/.

=== Open Telemetry
Expand All @@ -190,6 +189,10 @@ Solr upgraded to Jetty 12.x from 10.x as Jetty 10 and 11 have reached end-of-lif

The OS version of the official Docker image and provided Dockerfile has been upgraded to Ubuntu 24 (noble) from Ubuntu 22 (jammy).

=== Miscellaneous

Solr logs no longer include webapp=/solr and there's no longer a "webapp" key-value pair in the internal context.

=== Analysis and Tokenizers

==== PathHierarchyTokenizer Behavior Change
Expand Down
Loading