Caused by: java.lang.IndexOutOfBoundsException: index (-2) must not be
negative
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:306)
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:285)
at
org.elasticsearch.common.collect.RegularImmutableList.get(RegularImmutableList.java:65)
at
org.elasticsearch.cluster.routing.IndexShardRoutingTable.preferNodeActiveInitializingShardsIt(IndexShardRoutingTable.java:378)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.preferenceActiveShardIterator(PlainOperationRouting.java:210)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.getShards(PlainOperationRouting.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:42)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:121)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:97)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:74)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:49)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:63)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:49)
at
org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:85)
at
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:174)
... 9 more
My environment is:
Elasticserach 0.90.7
3 nodes in a cluster
Send GET request with preference=_local
Looking into IndexShardRoutingTable class, it seems that "loc" is
an unexpected negative value at the following code. pickIndex method
returns a value of "counter"(incremental value). If "counter" achieves
Integer.MAX_VALUE, I think that "loc" is negative and then
activeShards.get(loc) throws the exception.
int index = pickIndex();
for (int i = 0; i < activeShards.size(); i++) {
int loc = (index + i) % activeShards.size();
pickIndex() will return the absolute value of the count, so it won't return
a negative value. Can you provide more details?
Kevin
On Wednesday, March 26, 2014 3:53:15 PM UTC+11, Shinsuke Sugaya wrote:
Hi
I encountered the following problem:
Caused by: java.lang.IndexOutOfBoundsException: index (-2) must not be
negative
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:306)
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:285)
at
org.elasticsearch.common.collect.RegularImmutableList.get(RegularImmutableList.java:65)
at
org.elasticsearch.cluster.routing.IndexShardRoutingTable.preferNodeActiveInitializingShardsIt(IndexShardRoutingTable.java:378)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.preferenceActiveShardIterator(PlainOperationRouting.java:210)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.getShards(PlainOperationRouting.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:42)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:121)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:97)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:74)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:49)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:63)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:49)
at
org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:85)
at
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:174)
... 9 more
My environment is:
Elasticserach 0.90.7
3 nodes in a cluster
Send GET request with preference=_local
Looking into IndexShardRoutingTable class, it seems that "loc" is
an unexpected negative value at the following code. pickIndex method
returns a value of "counter"(incremental value). If "counter" achieves
Integer.MAX_VALUE, I think that "loc" is negative and then
activeShards.get(loc) throws the exception.
int index = pickIndex();
for (int i = 0; i < activeShards.size(); i++) {
int loc = (index + i) % activeShards.size();
index is NOT negative, but (index + i) is negative.
Regards,
shinsuke
2014年3月26日水曜日 19時43分20秒 UTC+9 Kevin Wang:
pickIndex() will return the absolute value of the count, so it won't
return a negative value. Can you provide more details?
Kevin
On Wednesday, March 26, 2014 3:53:15 PM UTC+11, Shinsuke Sugaya wrote:
Hi
I encountered the following problem:
Caused by: java.lang.IndexOutOfBoundsException: index (-2) must not be
negative
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:306)
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:285)
at
org.elasticsearch.common.collect.RegularImmutableList.get(RegularImmutableList.java:65)
at
org.elasticsearch.cluster.routing.IndexShardRoutingTable.preferNodeActiveInitializingShardsIt(IndexShardRoutingTable.java:378)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.preferenceActiveShardIterator(PlainOperationRouting.java:210)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.getShards(PlainOperationRouting.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:42)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:121)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:97)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:74)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:49)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:63)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:49)
at
org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:85)
at
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:174)
... 9 more
My environment is:
Elasticserach 0.90.7
3 nodes in a cluster
Send GET request with preference=_local
Looking into IndexShardRoutingTable class, it seems that "loc" is
an unexpected negative value at the following code. pickIndex method
returns a value of "counter"(incremental value). If "counter" achieves
Integer.MAX_VALUE, I think that "loc" is negative and then
activeShards.get(loc) throws the exception.
int index = pickIndex();
for (int i = 0; i < activeShards.size(); i++) {
int loc = (index + i) % activeShards.size();
that is actually a bug IMO - Math.abs() can return -1 if it hits
Integer.MIN_VALUE
this code is just broken - can you open an issue!
On Wednesday, March 26, 2014 11:43:20 AM UTC+1, Kevin Wang wrote:
pickIndex() will return the absolute value of the count, so it won't
return a negative value. Can you provide more details?
Kevin
On Wednesday, March 26, 2014 3:53:15 PM UTC+11, Shinsuke Sugaya wrote:
Hi
I encountered the following problem:
Caused by: java.lang.IndexOutOfBoundsException: index (-2) must not be
negative
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:306)
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:285)
at
org.elasticsearch.common.collect.RegularImmutableList.get(RegularImmutableList.java:65)
at
org.elasticsearch.cluster.routing.IndexShardRoutingTable.preferNodeActiveInitializingShardsIt(IndexShardRoutingTable.java:378)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.preferenceActiveShardIterator(PlainOperationRouting.java:210)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.getShards(PlainOperationRouting.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:42)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:121)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:97)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:74)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:49)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:63)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:49)
at
org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:85)
at
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:174)
... 9 more
My environment is:
Elasticserach 0.90.7
3 nodes in a cluster
Send GET request with preference=_local
Looking into IndexShardRoutingTable class, it seems that "loc" is
an unexpected negative value at the following code. pickIndex method
returns a value of "counter"(incremental value). If "counter" achieves
Integer.MAX_VALUE, I think that "loc" is negative and then
activeShards.get(loc) throws the exception.
int index = pickIndex();
for (int i = 0; i < activeShards.size(); i++) {
int loc = (index + i) % activeShards.size();
On Wednesday, March 26, 2014 5:53:15 AM UTC+1, Shinsuke Sugaya wrote:
Hi
I encountered the following problem:
Caused by: java.lang.IndexOutOfBoundsException: index (-2) must not be
negative
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:306)
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:285)
at
org.elasticsearch.common.collect.RegularImmutableList.get(RegularImmutableList.java:65)
at
org.elasticsearch.cluster.routing.IndexShardRoutingTable.preferNodeActiveInitializingShardsIt(IndexShardRoutingTable.java:378)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.preferenceActiveShardIterator(PlainOperationRouting.java:210)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.getShards(PlainOperationRouting.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:42)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:121)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:97)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:74)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:49)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:63)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:49)
at
org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:85)
at
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:174)
... 9 more
My environment is:
Elasticserach 0.90.7
3 nodes in a cluster
Send GET request with preference=_local
Looking into IndexShardRoutingTable class, it seems that "loc" is
an unexpected negative value at the following code. pickIndex method
returns a value of "counter"(incremental value). If "counter" achieves
Integer.MAX_VALUE, I think that "loc" is negative and then
activeShards.get(loc) throws the exception.
int index = pickIndex();
for (int i = 0; i < activeShards.size(); i++) {
int loc = (index + i) % activeShards.size();
On Wednesday, March 26, 2014 5:53:15 AM UTC+1, Shinsuke Sugaya wrote:
Hi
I encountered the following problem:
Caused by: java.lang.IndexOutOfBoundsException: index (-2) must not be
negative
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:306)
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:285)
at
org.elasticsearch.common.collect.RegularImmutableList.get(RegularImmutableList.java:65)
at
org.elasticsearch.cluster.routing.IndexShardRoutingTable.preferNodeActiveInitializingShardsIt(IndexShardRoutingTable.java:378)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.preferenceActiveShardIterator(PlainOperationRouting.java:210)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.getShards(PlainOperationRouting.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:42)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:121)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:97)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:74)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:49)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:63)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:49)
at
org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:85)
at
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:174)
... 9 more
My environment is:
Elasticserach 0.90.7
3 nodes in a cluster
Send GET request with preference=_local
Looking into IndexShardRoutingTable class, it seems that "loc" is
an unexpected negative value at the following code. pickIndex method
returns a value of "counter"(incremental value). If "counter" achieves
Integer.MAX_VALUE, I think that "loc" is negative and then
activeShards.get(loc) throws the exception.
int index = pickIndex();
for (int i = 0; i < activeShards.size(); i++) {
int loc = (index + i) % activeShards.size();
On Wednesday, March 26, 2014 5:53:15 AM UTC+1, Shinsuke Sugaya wrote:
Hi
I encountered the following problem:
Caused by: java.lang.IndexOutOfBoundsException: index (-2) must not be
negative
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:306)
at
org.elasticsearch.common.base.Preconditions.checkElementIndex(Preconditions.java:285)
at
org.elasticsearch.common.collect.RegularImmutableList.get(RegularImmutableList.java:65)
at
org.elasticsearch.cluster.routing.IndexShardRoutingTable.preferNodeActiveInitializingShardsIt(IndexShardRoutingTable.java:378)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.preferenceActiveShardIterator(PlainOperationRouting.java:210)
at
org.elasticsearch.cluster.routing.operation.plain.PlainOperationRouting.getShards(PlainOperationRouting.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:80)
at
org.elasticsearch.action.get.TransportGetAction.shards(TransportGetAction.java:42)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:121)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:97)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:74)
at
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:49)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:63)
at
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:49)
at
org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:85)
at
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:174)
... 9 more
My environment is:
Elasticserach 0.90.7
3 nodes in a cluster
Send GET request with preference=_local
Looking into IndexShardRoutingTable class, it seems that "loc" is
an unexpected negative value at the following code. pickIndex method
returns a value of "counter"(incremental value). If "counter" achieves
Integer.MAX_VALUE, I think that "loc" is negative and then
activeShards.get(loc) throws the exception.
int index = pickIndex();
for (int i = 0; i < activeShards.size(); i++) {
int loc = (index + i) % activeShards.size();
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.