Failure when applying failed shards during local gateway allocation, closes #903.
This commit is contained in:
parent
015e46930d
commit
3000dc78fa
|
@ -259,9 +259,10 @@ public class BlobReuseExistingNodeAllocation extends NodeAllocation {
|
|||
} else {
|
||||
nodesIds = Sets.newHashSet();
|
||||
// clean nodes that have failed
|
||||
for (DiscoveryNode node : shardStores.keySet()) {
|
||||
for (Iterator<DiscoveryNode> it = shardStores.keySet().iterator(); it.hasNext();) {
|
||||
DiscoveryNode node = it.next();
|
||||
if (!nodes.nodeExists(node.id())) {
|
||||
shardStores.remove(node);
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -301,9 +301,10 @@ public class LocalGatewayNodeAllocation extends NodeAllocation {
|
|||
nodeIds = nodes.dataNodes().keySet();
|
||||
} else {
|
||||
// clean nodes that have failed
|
||||
for (DiscoveryNode node : shardStates.keySet()) {
|
||||
if (!nodes.nodeExists(node.id())) {
|
||||
shardStates.remove(node);
|
||||
for (TObjectLongIterator<DiscoveryNode> it = shardStates.iterator(); it.hasNext();) {
|
||||
it.advance();
|
||||
if (!nodes.nodeExists(it.key().id())) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
nodeIds = Sets.newHashSet();
|
||||
|
@ -350,9 +351,10 @@ public class LocalGatewayNodeAllocation extends NodeAllocation {
|
|||
} else {
|
||||
nodesIds = Sets.newHashSet();
|
||||
// clean nodes that have failed
|
||||
for (DiscoveryNode node : shardStores.keySet()) {
|
||||
for (Iterator<DiscoveryNode> it = shardStores.keySet().iterator(); it.hasNext();) {
|
||||
DiscoveryNode node = it.next();
|
||||
if (!nodes.nodeExists(node.id())) {
|
||||
shardStores.remove(node);
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue