You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ge...@apache.org on 2024/02/13 13:40:16 UTC
(solr) branch branch_9x updated: SOLR-17145: Add 'requestid' to INSTALLSHARD response (#2252)
This is an automated email from the ASF dual-hosted git repository.
gerlowskija pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 8dd17691a73 SOLR-17145: Add 'requestid' to INSTALLSHARD response (#2252)
8dd17691a73 is described below
commit 8dd17691a731c8c28304e16b140f685f345c6553
Author: Jason Gerlowski <ge...@apache.org>
AuthorDate: Tue Feb 13 08:32:06 2024 -0500
SOLR-17145: Add 'requestid' to INSTALLSHARD response (#2252)
The field is commonly found on other admin requests, so we've added it
here for consistency.
---
solr/CHANGES.txt | 2 ++
.../org/apache/solr/handler/admin/api/InstallShardData.java | 11 ++++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 78fc3dd561a..3eb685a9b85 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -24,6 +24,8 @@ Improvements
* SOLR-16858: KnnQParser's "Pre-Filtering" behavior is now controlable via local params (hossman)
+* SOLR-17145: The INSTALLSHARDDATA API now includes a 'requestid' field when run asynchronously (Jason Gerlowski)
+
Optimizations
---------------------
* SOLR-17144: Close searcherExecutor thread per core after 1 minute (Pierre Salagnac, Christine Poerschke)
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/api/InstallShardData.java b/solr/core/src/java/org/apache/solr/handler/admin/api/InstallShardData.java
index 54d53d64f4a..0d9b6020cfb 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/api/InstallShardData.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/api/InstallShardData.java
@@ -23,8 +23,8 @@ import static org.apache.solr.security.PermissionNameProvider.Name.COLL_EDIT_PER
import jakarta.inject.Inject;
import java.util.HashMap;
import org.apache.solr.client.api.endpoint.InstallShardDataApi;
+import org.apache.solr.client.api.model.AsyncJerseyResponse;
import org.apache.solr.client.api.model.InstallShardDataRequestBody;
-import org.apache.solr.client.api.model.SolrJerseyResponse;
import org.apache.solr.client.solrj.SolrResponse;
import org.apache.solr.cloud.api.collections.InstallShardDataCmd;
import org.apache.solr.common.SolrException;
@@ -59,9 +59,9 @@ public class InstallShardData extends AdminAPIBase implements InstallShardDataAp
@Override
@PermissionName(COLL_EDIT_PERM)
- public SolrJerseyResponse installShardData(
+ public AsyncJerseyResponse installShardData(
String collName, String shardName, InstallShardDataRequestBody requestBody) throws Exception {
- final SolrJerseyResponse response = instantiateJerseyResponse(SolrJerseyResponse.class);
+ final var response = instantiateJerseyResponse(AsyncJerseyResponse.class);
final CoreContainer coreContainer = fetchAndValidateZooKeeperAwareCoreContainer();
recordCollectionForLogAndTracing(collName, solrQueryRequest);
if (requestBody == null) {
@@ -99,6 +99,11 @@ public class InstallShardData extends AdminAPIBase implements InstallShardDataAp
throw remoteResponse.getException();
}
+ if (requestBody.async != null) {
+ response.requestId = requestBody.async;
+ return response;
+ }
+
return response;
}