When setting `index.recovery.initial_shards` in the config file, it is ignored, closes #1912.

This commit is contained in:
Shay Banon 2012-05-04 17:06:34 +03:00
parent 0219471c00
commit 76b32a646c
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ public class LocalGatewayAllocator extends AbstractComponent implements GatewayA
int requiredAllocation = 1; int requiredAllocation = 1;
try { try {
IndexMetaData indexMetaData = routingNodes.metaData().index(shard.index()); IndexMetaData indexMetaData = routingNodes.metaData().index(shard.index());
String initialShards = indexMetaData.settings().get("index.recovery.initial_shards", this.initialShards); String initialShards = indexMetaData.settings().get("index.recovery.initial_shards", settings.get("index.recovery.initial_shards", this.initialShards));
if ("quorum".equals(initialShards)) { if ("quorum".equals(initialShards)) {
if (indexMetaData.numberOfReplicas() > 1) { if (indexMetaData.numberOfReplicas() > 1) {
requiredAllocation = ((1 + indexMetaData.numberOfReplicas()) / 2) + 1; requiredAllocation = ((1 + indexMetaData.numberOfReplicas()) / 2) + 1;