You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/11/09 16:33:25 UTC
[lucene-solr] branch reference_impl_dev updated: @1122 Allow
collection cmds that don't modify state to skip state enqueue and write.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/reference_impl_dev by this push:
new a5908a7 @1122 Allow collection cmds that don't modify state to skip state enqueue and write.
a5908a7 is described below
commit a5908a7a93b71fa03df03643b090d552b5c266de
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Mon Nov 9 10:33:01 2020 -0600
@1122 Allow collection cmds that don't modify state to skip state enqueue and write.
---
.../collections/OverseerCollectionMessageHandler.java | 17 +++++++++--------
.../solr/cloud/api/collections/OverseerStatusCmd.java | 2 +-
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java
index a176120..633e54a 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerCollectionMessageHandler.java
@@ -264,19 +264,20 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler,
Cmd command = commandMap.get(action);
if (command != null) {
AddReplicaCmd.Response responce = command.call(clusterState, message, results);
- if (responce == null || responce.clusterState == null) {
- throw new SolrException(ErrorCode.SERVER_ERROR, "CMD did not return a new clusterstate:" + operation);
+ if (responce == null) {
+ throw new SolrException(ErrorCode.SERVER_ERROR, "CMD did not return a response:" + operation);
}
log.info("Command returned clusterstate={} results={}", responce.clusterState, results);
- overseer.getZkStateWriter().enqueueUpdate(responce.clusterState, false);
-
- overseer.writePendingUpdates();
+ if (responce.clusterState != null) {
+ overseer.getZkStateWriter().enqueueUpdate(responce.clusterState, false);
+ overseer.writePendingUpdates();
+ }
// nocommit consider
- if (responce != null && responce.asyncFinalRunner != null && results.get("failure") == null && results.get("exception") == null) {
+ if (responce != null && responce.asyncFinalRunner != null) {
AddReplicaCmd.Response resp = responce.asyncFinalRunner.call();
log.info("Finalize after Command returned clusterstate={}", resp.clusterState);
if (resp.clusterState != null) {
@@ -289,7 +290,7 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler,
if (collection == null) {
collection = message.getStr("name");
}
- if (collection != null) {
+ if (collection != null && responce.clusterState != null) {
Integer version = overseer.getZkStateWriter().lastWrittenVersion(collection);
if (version != null && !action.equals(DELETE)) {
results.add("csver", version); // nocommit - find out which version was written by overseer and return it in response for this
@@ -366,7 +367,7 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler,
AddReplicaCmd.Response response = new AddReplicaCmd.Response();
response.results = results;
// nocommit - we don't change this for this cmd, we should be able to indicate that to caller
- response.clusterState = clusterState;
+ response.clusterState = null;
return response;
}
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerStatusCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerStatusCmd.java
index a240809..7e8a33f 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerStatusCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerStatusCmd.java
@@ -110,7 +110,7 @@ public class OverseerStatusCmd implements OverseerCollectionMessageHandler.Cmd {
AddReplicaCmd.Response response = new AddReplicaCmd.Response();
- response.clusterState = clusterState;
+ response.clusterState = null;
return response;
}