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:37:36 UTC

[lucene-solr] branch reference_impl_dev updated: @1123 Update the rest of the collection commands that don't return state.

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 67dff1b  @1123 Update the rest of the collection commands that don't return state.
67dff1b is described below

commit 67dff1bc47f879c995c43c9d47c2168d2235d87a
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Mon Nov 9 10:37:18 2020 -0600

    @1123 Update the rest of the collection commands that don't return state.
---
 .../src/java/org/apache/solr/cloud/api/collections/BackupCmd.java | 3 +--
 .../org/apache/solr/cloud/api/collections/CreateAliasCmd.java     | 8 ++++++--
 .../org/apache/solr/cloud/api/collections/CreateSnapshotCmd.java  | 6 +++++-
 .../org/apache/solr/cloud/api/collections/DeleteSnapshotCmd.java  | 6 +++++-
 .../apache/solr/cloud/api/collections/MaintainRoutedAliasCmd.java | 6 +++++-
 .../org/apache/solr/cloud/api/collections/OverseerRoleCmd.java    | 6 +++++-
 .../apache/solr/cloud/api/collections/ReindexCollectionCmd.java   | 6 +++++-
 .../java/org/apache/solr/cloud/api/collections/RestoreCmd.java    | 6 +++++-
 8 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/BackupCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/BackupCmd.java
index 666bd71..9b793bb 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/BackupCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/BackupCmd.java
@@ -141,8 +141,7 @@ public class BackupCmd implements OverseerCollectionMessageHandler.Cmd {
 
     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/CreateAliasCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateAliasCmd.java
index 1cb9771..fb68c3d 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateAliasCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateAliasCmd.java
@@ -79,8 +79,12 @@ public class CreateAliasCmd extends AliasCmd {
     // We could levy this requirement on the client but they would probably always add an obligatory sleep, which is
     // just kicking the can down the road.  Perhaps ideally at this juncture here we could somehow wait until all
     // Solr nodes in the cluster have the latest aliases?
-    Thread.sleep(100);
-    return null;
+    // Thread.sleep(100);
+    AddReplicaCmd.Response response = new AddReplicaCmd.Response();
+
+    response.clusterState = null;
+
+    return response;
   }
 
   private void callCreatePlainAlias(ZkNodeProps message, String aliasName, ZkStateReader zkStateReader) {
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateSnapshotCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateSnapshotCmd.java
index 3e85afc..0487785 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateSnapshotCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateSnapshotCmd.java
@@ -198,6 +198,10 @@ public class CreateSnapshotCmd implements OverseerCollectionMessageHandler.Cmd {
       }
       throw new SolrException(ErrorCode.SERVER_ERROR, "Failed to create snapshot on shards " + failedShards);
     }
-    return null;
+    AddReplicaCmd.Response response = new AddReplicaCmd.Response();
+
+    response.clusterState = null;
+
+    return response;
   }
 }
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/DeleteSnapshotCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/DeleteSnapshotCmd.java
index 7455ad3..912cf4c 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/DeleteSnapshotCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/DeleteSnapshotCmd.java
@@ -169,6 +169,10 @@ public class DeleteSnapshotCmd implements OverseerCollectionMessageHandler.Cmd {
       log.info("Deleted Zookeeper snapshot metdata for collection={} with commitName={}", collectionName, commitName);
       log.info("Successfully deleted snapshot for collection={} with commitName={}", collectionName, commitName);
     }
-    return null;
+    AddReplicaCmd.Response response = new AddReplicaCmd.Response();
+
+    response.clusterState = null;
+
+    return response;
   }
 }
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/MaintainRoutedAliasCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/MaintainRoutedAliasCmd.java
index a48f2d9..260d66f 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/MaintainRoutedAliasCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/MaintainRoutedAliasCmd.java
@@ -163,7 +163,11 @@ public class MaintainRoutedAliasCmd extends AliasCmd {
           throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Unknown action type!");
       }
     }
-    return null;
+    AddReplicaCmd.Response response = new AddReplicaCmd.Response();
+
+    response.clusterState = null;
+
+    return response;
   }
 
   @SuppressWarnings({"unchecked"})
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java
index d97490b..ba55cd3 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/OverseerRoleCmd.java
@@ -98,7 +98,11 @@ public class OverseerRoleCmd implements OverseerCollectionMessageHandler.Cmd {
 //      }
 //
 //    }).start();
-    return null;
+    AddReplicaCmd.Response response = new AddReplicaCmd.Response();
+
+    response.clusterState = null;
+
+    return response;
   }
 
 }
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/ReindexCollectionCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/ReindexCollectionCmd.java
index 8d61ef2..bd9045a 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/ReindexCollectionCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/ReindexCollectionCmd.java
@@ -508,7 +508,11 @@ public class ReindexCollectionCmd implements OverseerCollectionMessageHandler.Cm
       }
       results.add(REINDEX_STATUS, reindexingState);
     }
-    return null;
+    AddReplicaCmd.Response response = new AddReplicaCmd.Response();
+
+    response.clusterState = null;
+
+    return response;
   }
 
   private static final String REINDEXING_STATE_PATH = "/.reindexing";
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/RestoreCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/RestoreCmd.java
index 219f304..9916c35 100644
--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/RestoreCmd.java
+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/RestoreCmd.java
@@ -420,7 +420,11 @@ public class RestoreCmd implements OverseerCollectionMessageHandler.Cmd {
     }
 
     log.info("Completed restoring collection={} backupName={}", restoreCollection, backupName);
-    return null;
+    AddReplicaCmd.Response response = new AddReplicaCmd.Response();
+
+    response.clusterState = null;
+
+    return response;
   }
 
   private int getInt(ZkNodeProps message, String propertyName, Integer count, int defaultValue) {