You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by th...@apache.org on 2020/09/02 22:45:25 UTC
[lucene-solr] branch reference_impl_dev updated: Have the
CoreAdminHandler create the async_id znode the
OverseerCollectionMessageHandler#waitForCoreAdminAsyncCallToComplete is
waiting on
This is an automated email from the ASF dual-hosted git repository.
thelabdude 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 8d95bab Have the CoreAdminHandler create the async_id znode the OverseerCollectionMessageHandler#waitForCoreAdminAsyncCallToComplete is waiting on
8d95bab is described below
commit 8d95babc7171aaa23a7517be4f4c225b302e7dca
Author: Timothy Potter <th...@gmail.com>
AuthorDate: Wed Sep 2 16:44:06 2020 -0600
Have the CoreAdminHandler create the async_id znode the OverseerCollectionMessageHandler#waitForCoreAdminAsyncCallToComplete is waiting on
---
.../api/collections/OverseerCollectionMessageHandler.java | 9 +++++----
.../java/org/apache/solr/handler/admin/CoreAdminHandler.java | 11 +++++++++++
2 files changed, 16 insertions(+), 4 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 44823db..a90a8e1 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
@@ -888,6 +888,9 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler,
sreq.params = params;
CountDownLatch latch = new CountDownLatch(1);
+ // mn- from DistributedMap
+ final String asyncPathToWaitOn = Overseer.OVERSEER_ASYNC_IDS + "/mn-" + requestId;
+
Watcher waitForAsyncId = new Watcher() {
@Override
public void process(WatchedEvent event) {
@@ -899,7 +902,7 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler,
} else {
Stat rstats2 = null;
try {
- rstats2 = zkStateReader.getZkClient().exists(Overseer.OVERSEER_ASYNC_IDS + "/" + requestId, this);
+ rstats2 = zkStateReader.getZkClient().exists(asyncPathToWaitOn, this);
} catch (KeeperException e) {
log.error("ZooKeeper exception", e);
} catch (InterruptedException e) {
@@ -913,14 +916,12 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler,
}
};
- Stat rstats = zkStateReader.getZkClient().exists(Overseer.OVERSEER_ASYNC_IDS + "/" + requestId, waitForAsyncId);
+ Stat rstats = zkStateReader.getZkClient().exists(asyncPathToWaitOn, waitForAsyncId);
if (rstats != null) {
latch.countDown();
}
- // TJP TODO: Getting weird timeout issues when trying to delete a collection that was
- // created using processAndWait b/c of this latch.await ... need to dig in further.
latch.await(15, TimeUnit.SECONDS); // nocommit - still need a central timeout strat
shardHandler.submit(sreq, replica, sreq.params);
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
index 4c69a94..309fc71 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
@@ -49,6 +49,7 @@ import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.security.AuthorizationContext;
import org.apache.solr.security.PermissionNameProvider;
+import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
@@ -192,6 +193,16 @@ public class CoreAdminHandler extends RequestHandlerBase implements PermissionNa
} else {
addTask("completed", taskObject, true);
}
+
+ // Claim the task so the caller that's waiting for async status knows we're done
+ // TODO: TJP ~ not sure if this the correct place for this ...
+ if (coreContainer.getZkController() != null) {
+ try {
+ coreContainer.getZkController().claimAsyncId(taskId);
+ } catch (KeeperException e) {
+ log.error("Failed to claim async task {}", taskId, e);
+ }
+ }
}
});
} finally {