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:
Mark Robert Miller 2012-12-19 18:12:36 +00:00
parent a9356fc3ea
commit 8c91459f5b
2 changed files with 11 additions and 5 deletions

View File

@ -1062,7 +1062,7 @@ public final class ZkController {
private String doGetShardIdProcess(String coreName, CloudDescriptor descriptor) {
final String shardZkNodeName = getNodeName() + "_" + coreName;
int retryCount = 120;
int retryCount = 320;
while (retryCount-- > 0) {
final String shardId = zkStateReader.getClusterState().getShardId(
shardZkNodeName);
@ -1070,7 +1070,7 @@ public final class ZkController {
return shardId;
}
try {
Thread.sleep(500);
Thread.sleep(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}

View File

@ -868,7 +868,7 @@ public class CoreAdminHandler extends RequestHandlerBase {
}
protected void handleWaitForStateAction(SolrQueryRequest req,
SolrQueryResponse rsp) throws IOException, InterruptedException {
SolrQueryResponse rsp) throws IOException, InterruptedException, KeeperException {
final SolrParams params = req.getParams();
String cname = params.get(CoreAdminParams.CORE);
@ -904,6 +904,12 @@ public class CoreAdminHandler extends RequestHandlerBase {
// to accept updates
CloudDescriptor cloudDescriptor = core.getCoreDescriptor()
.getCloudDescriptor();
if (retry == 15 || retry == 60) {
// force a cluster state update
coreContainer.getZkController().getZkStateReader().updateClusterState(true);
}
ClusterState clusterState = coreContainer.getZkController()
.getClusterState();
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,
"I was asked to wait on state " + waitForState + " for "
+ 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);
}