You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by no...@apache.org on 2023/09/28 05:46:28 UTC

[solr] branch jira/wrong_coll_name_in_coordinator created (now 62b4e2d7c98)

This is an automated email from the ASF dual-hosted git repository.

noble pushed a change to branch jira/wrong_coll_name_in_coordinator
in repository https://gitbox.apache.org/repos/asf/solr.git


      at 62b4e2d7c98 Wrong collection name in tracing span

This branch includes the following new commits:

     new 62b4e2d7c98 Wrong collection name in tracing span

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[solr] 01/01: Wrong collection name in tracing span

Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

noble pushed a commit to branch jira/wrong_coll_name_in_coordinator
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 62b4e2d7c98f31cac85bf59692cecb0100e65430
Author: noblepaul <no...@gmail.com>
AuthorDate: Thu Sep 28 15:46:18 2023 +1000

    Wrong collection name in tracing span
---
 .../org/apache/solr/servlet/CoordinatorHttpSolrCall.java    |  5 +++++
 .../core/src/java/org/apache/solr/servlet/HttpSolrCall.java | 13 +++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/servlet/CoordinatorHttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/CoordinatorHttpSolrCall.java
index 82664b23623..0c52282f9d5 100644
--- a/solr/core/src/java/org/apache/solr/servlet/CoordinatorHttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/CoordinatorHttpSolrCall.java
@@ -277,6 +277,11 @@ public class CoordinatorHttpSolrCall extends HttpSolrCall {
     }
   }
 
+  @Override
+  protected String getCoreOrColName() {
+    return collectionName;
+  }
+
   public static SolrQueryRequest wrappedReq(
       SolrQueryRequest delegate, String collectionName, HttpSolrCall httpSolrCall) {
     Properties p = new Properties();
diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
index 9137f3ded4e..ce9b1f8e6be 100644
--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
@@ -637,10 +637,7 @@ public class HttpSolrCall {
   // called after init().
   protected void populateTracingSpan(Span span) {
     // Set db.instance
-    String coreOrColName = HttpSolrCall.this.origCorename;
-    if (coreOrColName == null && getCore() != null) {
-      coreOrColName = getCore().getName();
-    }
+    String coreOrColName = getCoreOrColName();
     TraceUtils.setDbInstance(span, coreOrColName);
 
     // Set operation name.
@@ -658,6 +655,14 @@ public class HttpSolrCall {
     span.updateName(verb + ":" + path);
   }
 
+  protected String getCoreOrColName() {
+    String coreOrColName = HttpSolrCall.this.origCorename;
+    if (coreOrColName == null && getCore() != null) {
+      coreOrColName = getCore().getName();
+    }
+    return coreOrColName;
+  }
+
   public boolean shouldAudit() {
     return shouldAudit(cores);
   }