mirror of https://github.com/apache/lucene.git
raise timeouts for wait to see state and get assigned shard id
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1423993 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a9356fc3ea
commit
8c91459f5b
|
@ -1062,7 +1062,7 @@ public final class ZkController {
|
||||||
|
|
||||||
private String doGetShardIdProcess(String coreName, CloudDescriptor descriptor) {
|
private String doGetShardIdProcess(String coreName, CloudDescriptor descriptor) {
|
||||||
final String shardZkNodeName = getNodeName() + "_" + coreName;
|
final String shardZkNodeName = getNodeName() + "_" + coreName;
|
||||||
int retryCount = 120;
|
int retryCount = 320;
|
||||||
while (retryCount-- > 0) {
|
while (retryCount-- > 0) {
|
||||||
final String shardId = zkStateReader.getClusterState().getShardId(
|
final String shardId = zkStateReader.getClusterState().getShardId(
|
||||||
shardZkNodeName);
|
shardZkNodeName);
|
||||||
|
@ -1070,7 +1070,7 @@ public final class ZkController {
|
||||||
return shardId;
|
return shardId;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Thread.sleep(500);
|
Thread.sleep(1000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
|
|
|
@ -868,7 +868,7 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void handleWaitForStateAction(SolrQueryRequest req,
|
protected void handleWaitForStateAction(SolrQueryRequest req,
|
||||||
SolrQueryResponse rsp) throws IOException, InterruptedException {
|
SolrQueryResponse rsp) throws IOException, InterruptedException, KeeperException {
|
||||||
final SolrParams params = req.getParams();
|
final SolrParams params = req.getParams();
|
||||||
|
|
||||||
String cname = params.get(CoreAdminParams.CORE);
|
String cname = params.get(CoreAdminParams.CORE);
|
||||||
|
@ -904,6 +904,12 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
||||||
// to accept updates
|
// to accept updates
|
||||||
CloudDescriptor cloudDescriptor = core.getCoreDescriptor()
|
CloudDescriptor cloudDescriptor = core.getCoreDescriptor()
|
||||||
.getCloudDescriptor();
|
.getCloudDescriptor();
|
||||||
|
|
||||||
|
if (retry == 15 || retry == 60) {
|
||||||
|
// force a cluster state update
|
||||||
|
coreContainer.getZkController().getZkStateReader().updateClusterState(true);
|
||||||
|
}
|
||||||
|
|
||||||
ClusterState clusterState = coreContainer.getZkController()
|
ClusterState clusterState = coreContainer.getZkController()
|
||||||
.getClusterState();
|
.getClusterState();
|
||||||
String collection = cloudDescriptor.getCollectionName();
|
String collection = cloudDescriptor.getCollectionName();
|
||||||
|
@ -927,11 +933,11 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retry++ == 30) {
|
if (retry++ == 120) {
|
||||||
throw new SolrException(ErrorCode.BAD_REQUEST,
|
throw new SolrException(ErrorCode.BAD_REQUEST,
|
||||||
"I was asked to wait on state " + waitForState + " for "
|
"I was asked to wait on state " + waitForState + " for "
|
||||||
+ nodeName
|
+ nodeName
|
||||||
+ " but I still do not see the request state. I see state: "
|
+ " but I still do not see the requested state. I see state: "
|
||||||
+ state + " live:" + live);
|
+ state + " live:" + live);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue