mirror of https://github.com/apache/lucene.git
somehow didn't make it in the previous commit
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1245213 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9897a0e792
commit
8a2bc76e2f
|
@ -354,6 +354,10 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
|||
if (opts != null)
|
||||
cd.setShardId(opts);
|
||||
|
||||
opts = params.get(CoreAdminParams.ROLES);
|
||||
if (opts != null)
|
||||
cd.setRoles(opts);
|
||||
|
||||
Integer numShards = params.getInt(ZkStateReader.NUM_SHARDS_PROP);
|
||||
if (numShards != null)
|
||||
cd.setNumShards(numShards);
|
||||
|
@ -402,13 +406,9 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
|||
|
||||
if (cname.equals(name)) return doPersist;
|
||||
|
||||
SolrCore core = coreContainer.getCore(cname);
|
||||
if (core != null) {
|
||||
doPersist = coreContainer.isPersistent();
|
||||
coreContainer.register(name, core, false);
|
||||
coreContainer.remove(cname);
|
||||
core.close();
|
||||
}
|
||||
coreContainer.rename(cname, name);
|
||||
|
||||
return doPersist;
|
||||
}
|
||||
|
||||
|
@ -601,7 +601,11 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
|||
SolrCore core = null;
|
||||
try {
|
||||
core = coreContainer.getCore(cname);
|
||||
if (core != null) {
|
||||
core.getUpdateHandler().getSolrCoreState().doRecovery(core);
|
||||
} else {
|
||||
SolrException.log(log, "Cound not find core to call recovery:" + cname);
|
||||
}
|
||||
} finally {
|
||||
// no recoveryStrat close for now
|
||||
if (core != null) {
|
||||
|
@ -630,7 +634,7 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
|||
if (core == null) {
|
||||
throw new SolrException(ErrorCode.BAD_REQUEST, "core not found:" + cname);
|
||||
}
|
||||
String state;
|
||||
String state = null;
|
||||
int retry = 0;
|
||||
while (true) {
|
||||
// wait until we are sure the recovering node is ready
|
||||
|
@ -640,15 +644,20 @@ public class CoreAdminHandler extends RequestHandlerBase {
|
|||
CloudState cloudState = coreContainer
|
||||
.getZkController()
|
||||
.getCloudState();
|
||||
String collection = cloudDescriptor.getCollectionName();
|
||||
ZkNodeProps nodeProps =
|
||||
cloudState.getSlice(cloudDescriptor.getCollectionName(),
|
||||
cloudState.getSlice(collection,
|
||||
cloudDescriptor.getShardId()).getShards().get(coreNodeName);
|
||||
boolean live = false;
|
||||
if (nodeProps != null) {
|
||||
|
||||
state = nodeProps.get(ZkStateReader.STATE_PROP);
|
||||
boolean live = cloudState.liveNodesContain(nodeName);
|
||||
live = cloudState.liveNodesContain(nodeName);
|
||||
if (nodeProps != null && state.equals(ZkStateReader.RECOVERING)
|
||||
&& live) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (retry++ == 30) {
|
||||
throw new SolrException(ErrorCode.BAD_REQUEST,
|
||||
|
|
Loading…
Reference in New Issue