Change corruption explanation
This commit is contained in:
parent
89c25c5882
commit
08ac66f41e
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.action.admin.cluster.allocation;
|
package org.elasticsearch.action.admin.cluster.allocation;
|
||||||
|
|
||||||
|
import org.apache.lucene.index.CorruptIndexException;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresResponse;
|
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresResponse;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
|
@ -148,12 +149,12 @@ public final class ClusterAllocationExplanation implements ToXContent, Writeable
|
||||||
final Throwable storeErr = storeStatus.getStoreException();
|
final Throwable storeErr = storeStatus.getStoreException();
|
||||||
if (storeErr != null) {
|
if (storeErr != null) {
|
||||||
finalDecision = FinalDecision.NO;
|
finalDecision = FinalDecision.NO;
|
||||||
if (ExceptionsHelper.unwrapCause(storeErr) instanceof IOException) {
|
if (ExceptionsHelper.unwrapCause(storeErr) instanceof CorruptIndexException) {
|
||||||
storeCopy = StoreCopy.IO_ERROR;
|
|
||||||
finalExplanation = "there was an IO error reading from data in the shard store";
|
|
||||||
} else {
|
|
||||||
storeCopy = StoreCopy.CORRUPT;
|
storeCopy = StoreCopy.CORRUPT;
|
||||||
finalExplanation = "the copy of data in the shard store is corrupt";
|
finalExplanation = "the copy of data in the shard store is corrupt";
|
||||||
|
} else {
|
||||||
|
storeCopy = StoreCopy.IO_ERROR;
|
||||||
|
finalExplanation = "there was an IO error reading from data in the shard store";
|
||||||
}
|
}
|
||||||
} else if (activeAllocationIds.isEmpty() || activeAllocationIds.contains(storeStatus.getAllocationId())) {
|
} else if (activeAllocationIds.isEmpty() || activeAllocationIds.contains(storeStatus.getAllocationId())) {
|
||||||
// If either we don't have allocation IDs, or they contain the store allocation id, show the allocation
|
// If either we don't have allocation IDs, or they contain the store allocation id, show the allocation
|
||||||
|
|
|
@ -170,8 +170,6 @@ public final class ClusterAllocationExplainIT extends ESIntegTestCase {
|
||||||
", I have: " + noAttrNode + ", " + barAttrNode + ", " + fooBarAttrNode);
|
", I have: " + noAttrNode + ", " + barAttrNode + ", " + fooBarAttrNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertThat(noAttrWeight, greaterThan(barAttrWeight));
|
|
||||||
assertThat(noAttrWeight, greaterThan(fooBarAttrWeight));
|
|
||||||
assertFalse(barAttrWeight == fooBarAttrWeight);
|
assertFalse(barAttrWeight == fooBarAttrWeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue