Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure when applying failed shards during local gateway allocation #903

Closed
kimchy opened this issue May 4, 2011 · 0 comments

Comments

@kimchy
Copy link
Member

commented May 4, 2011

java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
at java.util.HashMap$KeyIterator.next(HashMap.java:828)
at org.elasticsearch.gateway.local.LocalGatewayNodeAllocation.buildShardStores(LocalGatewayNodeAllocation.java:353)
at org.elasticsearch.gateway.local.LocalGatewayNodeAllocation.allocateUnassigned(LocalGatewayNodeAllocation.java:213)
at org.elasticsearch.cluster.routing.allocation.NodeAllocations.allocateUnassigned(NodeAllocations.java:80)
at org.elasticsearch.cluster.routing.allocation.ShardsAllocation.reroute(ShardsAllocation.java:147)
at org.elasticsearch.cluster.routing.allocation.ShardsAllocation.reroute(ShardsAllocation.java:99)
at org.elasticsearch.cluster.routing.RoutingService$RoutingTableUpdater$1.execute(RoutingService.java:124)
at org.elasticsearch.cluster.service.InternalClusterService$2.run(InternalClusterService.java:175)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

Patch provided in mailing list:

--- a/modules/elasticsearch/src/main/java/org/elasticsearch/gateway/local/LocalGatewayNodeAllocation.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/gateway/local/LocalGatewayNodeAllocation.java
@@ -350,9 +350,10 @@ public class LocalGatewayNodeAllocation extends
NodeAllocation {
} else {
nodesIds = Sets.newHashSet();
// clean nodes that have failed
- for (DiscoveryNode node : shardStores.keySet()) {
- if (!nodes.nodeExists(node.id())) {
- shardStores.remove(node);
+ for (Iterator i =
shardStores.keySet().iterator(); i.hasNext();) {
+ DiscoveryNode node = i.next();
+ if (!nodes.nodeExists(node.id())) {
+ i.remove();
}
}

@kimchy kimchy closed this in 3000dc7 May 4, 2011

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.