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

Elasticsearch indexing command that fails on optimistic concurrency should not log error

    XMLWordPrintable

    Details

    • Tags:
    • Sprint:
      nxcore 10.2.2
    • Story Points:
      5

      Description

      Since NXP-19283 we use external version on elasticsearch indexing command so that we have optimistic concurrency that prevent to index an older version of a document.

      These case of race condition are normal if 2 indexing command on the same documents are triggered and we should only add an info logs.

      This is done for the bulk indexing command but not for the index command.

      The results is an uncaught error that kill the indexing worker thread. The thread pool will create a new thread but this should be catched and logged as info level.

            "exception_class": "org.elasticsearch.ElasticsearchStatusException",
            "exception_message": "Elasticsearch exception [type=version_conflict_engine_exception, reason=[doc][138edc3f-991f-4d2b-8964-9d4100be8d7b]: version conflict, current version [1520352442251634] is higher or equal to the one provided [1520352442245742]]",
            "stacktrace": "[nuxeo/Bk9EJ63hQh2HnzroreihmQ][[nuxeo][2]] ElasticsearchStatusException[Elasticsearch exception [type=version_conflict_engine_exception, reason=[doc][138edc3f-991f-4d2b-8964-9d4100be8d7b]: version conflict, current version [1520352442251634] is higher or equal to the one provided [1520352442245742]]]\n\tat org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)\n\tat org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:526)\n\tat org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:502)\n\tat org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:409)\n\tat org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:382)\n\tat org.elasticsearch.client.RestHighLevelClient.index(RestHighLevelClient.java:267)\n\tat org.nuxeo.elasticsearch.client.ESRestClient.index(ESRestClient.java:369)\n\tat org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.processIndexCommand(ElasticSearchIndexingImpl.java:292)\n\tat org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNonRecursive(ElasticSearchIndexingImpl.java:265)\n\tat org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNonRecursive(ElasticSearchIndexingImpl.java:137)\n\tat org.nuxeo.elasticsearch.ElasticSearchComponent.indexNonRecursive(ElasticSearchComponent.java:405)\n\tat org.nuxeo.elasticsearch.work.IndexingWorker.doIndexingWork(IndexingWorker.java:73)\n\tat org.nuxeo.elasticsearch.work.AbstractIndexingWorker.doWork(AbstractIndexingWorker.java:61)\n\tat org.nuxeo.elasticsearch.work.BaseIndexingWorker.work(BaseIndexingWorker.java:48)\n\tat org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:435)\n\tat org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:355)\n\tat org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:748)\n\tSuppressed: org.elasticsearch.client.ResponseException: PUT http://10.1.8.145:9200/nuxeo/doc/138edc3f-991f-4d2b-8964-9d4100be8d7b?version_type=external&version=1520352442245742&timeout=1m: HTTP/1.1 409 Conflict\n{\"error\":{\"root_cause\":[{\"type\":\"version_conflict_engine_exception\",\"reason\":\"[doc][138edc3f-991f-4d2b-8964-9d4100be8d7b]: version conflict, current version [1520352442251634] is higher or equal to the one provided [1520352442245742]\",\"index_uuid\":\"Bk9EJ63hQh2HnzroreihmQ\",\"shard\":\"2\",\"index\":\"nuxeo\"}],\"type\":\"version_conflict_engine_exception\",\"reason\":\"[doc][138edc3f-991f-4d2b-8964-9d4100be8d7b]: version conflict, current version [1520352442251634] is higher or equal to the one provided [1520352442245742]\",\"index_uuid\":\"Bk9EJ63hQh2HnzroreihmQ\",\"shard\":\"2\",\"index\":\"nuxeo\"},\"status\":409}\n\t\tat org.elasticsearch.client.RestClient$1.completed(RestClient.java:354)\n\t\tat org.elasticsearch.client.RestClient$1.completed(RestClient.java:343)\n\t\tat org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:119)\n\t\tat org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:177)\n\t\tat org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:436)\n\t\tat org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:326)\n\t\tat org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265)\n\t\tat org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)\n\t\tat org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)\n\t\tat org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)\n\t\tat org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)\n\t\tat org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)\n\t\tat org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)\n\t\tat org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)\n\t\tat org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)\n\t\tat org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)\n\t\t... 1 more"
          },
          "file": "AbstractWork.java",
          "method": "cleanUp",
          "level": "ERROR",
          "thread_name": "Nuxeo-Work-elasticSearchIndexing-415:1689597893346209.1996975126",
          "logger_name": "org.nuxeo.ecm.core.work.AbstractWork",
          "message": "Exception during work: IndexingWorker(138edc3f-991f-4d2b-8964-9d4100be8d7b, , Progress(?%, ?/0), null)",
          "class": "org.nuxeo.ecm.core.work.AbstractWork",
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bdelbosc Benoit Delbosc
                Reporter:
                bdelbosc Benoit Delbosc
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: