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

java.lang.ArrayIndexOutOfBoundsException when indexing a doc #1094

Closed
scoro opened this issue Jul 6, 2011 · 0 comments
Closed

java.lang.ArrayIndexOutOfBoundsException when indexing a doc #1094

scoro opened this issue Jul 6, 2011 · 0 comments

Comments

@scoro
Copy link

scoro commented Jul 6, 2011

The issue was described on a mailing list here:
http://groups.google.com/a/elasticsearch.com/group/users/browse_thread/thread/108019d6c0091abf#

The fallowing exception occurs while creating index for a specific index type and key:


[2011-07-06 05:34:33,187][DEBUG][action.bulk              ] [Astra] [201009][4]: Failed to execute bulk item (index) [index {[201009][message][211d779c-4e6c-4f9b-b74e-5cc502854732], source[{"messageId":["211d779c-4e6c-4f9b-b74e-5cc502854732"],"sourceEndpoint":["81940f97-e84c-42f8-b215-3809d08d69d8"],"destinationEndpoint":["EA217E80-2CE4-11DA-8F53-5BDB61D1C73E"],"dateCreated":"2010-09-24T01:30:31.305Z","messageState":[20],"documentId":["FV/13025/10/KARCZ01"],"messageType":[7]}]}]
java.lang.ArrayIndexOutOfBoundsException: -48
        at org.elasticsearch.index.engine.robin.RobinEngine.dirtyLock(RobinEngine.java:948)
        at org.elasticsearch.index.engine.robin.RobinEngine.innerIndex(RobinEngine.java:388)
        at org.elasticsearch.index.engine.robin.RobinEngine.index(RobinEngine.java:374)
        at org.elasticsearch.index.shard.service.InternalIndexShard.index(InternalIndexShard.java:292)
        at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:131)
        at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:418)
        at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.access$100(TransportShardReplicationOperationAction.java:233)
        at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:331)
        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)

It happens when the hashCode() of Term class returns Integer.MIN_VALUE.
Math.abs(Integer) of this value returns the same (negative value).

JavaDoc:

int java.lang.Math.abs(int a)

Returns the absolute value of an int value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned.

Note that if the argument is equal to the value of Integer.MIN_VALUE, the most negative representable int value, the result is that same value, which is negative.

So be careful using Math.abs()

;-)

Thanks for interesting.

@kimchy kimchy closed this as completed in 6f7b462 Jul 6, 2011
ofavre pushed a commit to yakaz/elasticsearch that referenced this issue Jul 18, 2011
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
williamrandolph pushed a commit to williamrandolph/elasticsearch that referenced this issue Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants