Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25328

Elasticsearch RestClient raises error on optimistic concurrency

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.2-SNAPSHOT
    • Fix Version/s: 9.10-HF20, 10.2
    • Component/s: Elasticsearch

      Description

      The indexing (not bulk indexing) command that are rejected because a more recent version of the doc is already indexed raise error instead of log silently like with the TransportClient implementation.

      2018-07-06 06:49:59,489 ERROR [Nuxeo-Work-elasticSearchIndexing-4:1808857586917899.1507574677] [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: IndexingWorker(ee3e6523-147f-4327-bb75-0c85aa12c21f, , Progress(?%, ?/0), null)
      [nuxeo/OVErVEWpQg6uHGCRNqJAxA][[nuxeo][0]] ElasticsearchStatusException[Elasticsearch exception [type=version_conflict_engine_exception, reason=[doc][ee3e6523-147f-4327-bb75-0c85aa12c21f]: version conflict, current version [1530859799485651] is higher or equal to the one provided [1530859799484886]]]
              at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)
              at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:653)
              at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:628)
              at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:535)
              at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:508)
              at org.elasticsearch.client.RestHighLevelClient.index(RestHighLevelClient.java:348)
              at org.nuxeo.elasticsearch.client.ESRestClient.index(ESRestClient.java:378)
              at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.processIndexCommand(ElasticSearchIndexingImpl.java:297)
              at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNonRecursive(ElasticSearchIndexingImpl.java:268)
              at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNonRecursive(ElasticSearchIndexingImpl.java:138)
              at org.nuxeo.elasticsearch.ElasticSearchComponent.indexNonRecursive(ElasticSearchComponent.java:405)
              at org.nuxeo.elasticsearch.work.IndexingWorker.doIndexingWork(IndexingWorker.java:73)
              at org.nuxeo.elasticsearch.work.AbstractIndexingWorker.doWork(AbstractIndexingWorker.java:61)
              at org.nuxeo.elasticsearch.work.BaseIndexingWorker.work(BaseIndexingWorker.java:48)
              at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:436)
              at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:356)
              at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
              Suppressed: org.elasticsearch.client.ResponseException: method [PUT], host [http://es:9200], URI [/nuxeo/doc/ee3e6523-147f-4327-bb75-0c85aa12c21f?version_type=external&version=1530859799484886&timeout=1m], status line [HTTP/1.1 409 Conflict]
      {"error":{"root_cause":[{"type":"version_conflict_engine_exception","reason":"[doc][ee3e6523-147f-4327-bb75-0c85aa12c21f]: version conflict, current version [1530859799485651] is higher or equal to the one provided [1530859799484886]","index_uuid":"OVErVEWpQg6uHGCRNqJAxA","shard":"0","index":"nuxeo"}],"type":"version_conflict_engine_exception","reason":"[doc][ee3e6523-147f-4327-bb75-0c85aa12c21f]: version conflict, current version [1530859799485651] is higher or equal to the one provided [1530859799484886]","index_uuid":"OVErVEWpQg6uHGCRNqJAxA","shard":"0","index":"nuxeo"},"status":409}
                      at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:705)
                      at org.elasticsearch.client.RestClient.performRequest(RestClient.java:235)
                      at org.elasticsearch.client.RestClient.performRequest(RestClient.java:198)
                      at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:522)
                      ... 16 more
              Caused by: org.elasticsearch.client.ResponseException: method [PUT], host [http://es:9200], URI [/nuxeo/doc/ee3e6523-147f-4327-bb75-0c85aa12c21f?version_type=external&version=1530859799484886&timeout=1m], status line [HTTP/1.1 409 Conflict]
      {"error":{"root_cause":[{"type":"version_conflict_engine_exception","reason":"[doc][ee3e6523-147f-4327-bb75-0c85aa12c21f]: version conflict, current version [1530859799485651] is higher or equal to the one provided [1530859799484886]","index_uuid":"OVErVEWpQg6uHGCRNqJAxA","shard":"0","index":"nuxeo"}],"type":"version_conflict_engine_exception","reason":"[doc][ee3e6523-147f-4327-bb75-0c85aa12c21f]: version conflict, current version [1530859799485651] is higher or equal to the one provided [1530859799484886]","index_uuid":"OVErVEWpQg6uHGCRNqJAxA","shard":"0","index":"nuxeo"},"status":409}
                      at org.elasticsearch.client.RestClient$1.completed(RestClient.java:377)
                      at org.elasticsearch.client.RestClient$1.completed(RestClient.java:366)
                      at org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:119)
                      at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:177)
                      at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:436)
                      at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:326)
                      at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265)
                      at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
                      at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
                      at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
                      at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
                      at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
                      at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
                      at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
                      at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
                      at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
                      ... 1 more
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h