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

Update query lock up #6

Closed
rightedges opened this issue Oct 25, 2013 · 6 comments
Closed

Update query lock up #6

rightedges opened this issue Oct 25, 2013 · 6 comments

Comments

@rightedges
Copy link

Let me first say this plugin (1.3.0 + es 0.90.5) is really wonderful. It saves my project. However, I notice it is locking up my requests and eventually lock the entire elasticsearch.

Here is my update query

{
    "query" : {
    "bool" : {
       "must" : {
        "term" : {"m":"abc"}
       },
       "must_not": {
        "term" : {"category" : "cde"} 
       }
    }
    },
    "script" : "ctx._source.category=\"cde\""
}

It updates all my entries with m=abc and category!=cde to category=cde.

Some runs are okay but some will just hang and not returning from the call. Below are some errors in elasticsearch.log

----------------
[2013-10-25 22:52:49,907][DEBUG][action.updatebyquery     ] [Kragoff, Ivan] [logstash-2013.10.24][0] error while executing update by query shard request
java.lang.IndexOutOfBoundsException: index 3
    at java.util.concurrent.atomic.AtomicReferenceArray.checkedByteOffset(AtomicReferenceArray.java:78)
    at java.util.concurrent.atomic.AtomicReferenceArray.set(AtomicReferenceArray.java:139)
    at org.elasticsearch.action.updatebyquery.TransportUpdateByQueryAction$MultipleIndexUpdateByQueryActionListener.onResponse(TransportUpdateByQueryAction.java:117)
    at org.elasticsearch.action.updatebyquery.TransportUpdateByQueryAction$MultipleIndexUpdateByQueryActionListener.onResponse(TransportUpdateByQueryAction.java:98)
    at org.elasticsearch.action.updatebyquery.TransportUpdateByQueryAction$UpdateByQueryIndexOperationAction$ShardResponseListener.finalizeAction(TransportUpdateByQueryAction.java:395)
.....
----------------
2013-10-25 22:57:36,261][DEBUG][action.updatebyquery     ] [Kragoff, Ivan] error while executing bulk operations for an update by query action, sending partial response...
java.lang.IndexOutOfBoundsException: index 3
    at java.util.concurrent.atomic.AtomicReferenceArray.checkedByteOffset(AtomicReferenceArray.java:78)
    at java.util.concurrent.atomic.AtomicReferenceArray.set(AtomicReferenceArray.java:139)
    at org.elasticsearch.action.updatebyquery.TransportUpdateByQueryAction$MultipleIndexUpdateByQueryActionListener.onResponse(TransportUpdateByQueryAction.java:117)
    at org.elasticsearch.action.updatebyquery.TransportUpdateByQueryAction$MultipleIndexUpdateByQueryActionListener.onResponse(TransportUpdateByQueryAction.java:98)
--------------------
[2013-10-25 22:57:36,262][DEBUG][action.updatebyquery     ] [Kragoff, Ivan] [logstash-2013.10.24][0] error while executing update by query shard request
org.apache.lucene.store.AlreadyClosedException: this IndexReader is closed
    at org.apache.lucene.index.IndexReader.decRef(IndexReader.java:224)
    at org.apache.lucene.search.SearcherManager.decRef(SearcherManager.java:111)
    at org.apache.lucene.search.SearcherManager.decRef(SearcherManager.java:58)
    at org.apache.lucene.search.ReferenceManager.release(ReferenceManager.java:253)
--------------------
[2013-10-25 22:57:36,264][DEBUG][action.bulk              ] [Kragoff, Ivan] [logstash-2013.10.24][0], node[KOnniIYJTrun0Yk7N6UIvQ], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.bulk.PublicBulkShardRequest@2c9104c4]
java.lang.IndexOutOfBoundsException: index 1
    at java.util.concurrent.atomic.AtomicReferenceArray.checkedByteOffset(AtomicReferenceArray.java:78)
    at java.util.concurrent.atomic.AtomicReferenceArray.set(AtomicReferenceArray.java:139)
    at org.elasticsearch.action.updatebyquery.TransportUpdateByQueryAction$UpdateByQueryIndexOperationAction$ShardResponseListener.handleException(TransportUpdateByQueryAction.java:380)

I can reproduce this quite easily. Let me know if you need more information. Thanks.

@ofavre
Copy link
Contributor

ofavre commented Oct 25, 2013

I'll take a look when I have time.
But maybe you should link this issue at elastic/elasticsearch#2230. (If this mention is not enough.)
As I only adapted pre-existing code into a plugin, I'm not sure I will be of able to fix this, though I will try.

@rightedges
Copy link
Author

Thanks for the quick response. Very much appreciated!

@ofavre
Copy link
Contributor

ofavre commented Aug 20, 2014

I think this issue is related to #22.
It was fixed two weeks ago in v2.0.1, targeting ES 1.1.0.
Feel free to reopen if it happens again.

@ofavre ofavre closed this as completed Aug 20, 2014
@pulkitsinghal
Copy link

@ofavre - if you fixed it in v2.0.1 then based on the version matrix:

| 2.1.0                         │ 1.2.0 ─► 1.2.2         │
├───────────────────────────────┼────────────────────────┤
│ 2.0.x                         │ 1.1.0 ─► 1.1.2         │

Should I not expect the plugin's v2.1.0 to be compatible with es v1.1.2? Or is it simply that it supports es v1.2.x as well now?

@ofavre
Copy link
Contributor

ofavre commented Oct 15, 2014

Starting at v2.1.0, the plugin is no longer compatible with ES <1.2, due to refactoring in the upstream code.
The fix for this issue is part of the plugin since v2.0.1.

If your ElasticSearch version is 1.2.0 upto 1.2.2, you must use the plugin v2.1.0.
You can select the appropriate plugin version depending on your ES version by finding the later in the right column, and reading the former in left one.

I always try to maximize the backward compatibility of my plugin, increasing the major on incompatible plugin-level changes, increasing the minor on incompatible ES-level changes or new features, and increasing the patch when pushing patches.
But ElasticSearch is a fast changing world, and plugins are sometimes outdated quite quickly.

@pulkitsinghal
Copy link

@ofavre Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants