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

Fix unit used for keepAlive when scrolling over an Elasticsearch request

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.10
    • Fix Version/s: 2023.4, 2021.46
    • Component/s: Elasticsearch
    • Release Notes Summary:
      The elastic scroll keepalive duration uses the correct unit.
    • Backlog priority:
      700
    • Sprint:
      nxplatform #100
    • Story Points:
      3

      Description

      When we run a computation which executes an Elasticsearch query, it builds an EsScrollResult with a keepAlive value set in seconds:

      ElasticSearchScroll#fetch
                      esScroll = ess.scroll(new NxQueryBuilder(session).nxql(request.getQuery())
                                                                       .limit(request.getSize())
                                                                       .onlyElasticsearchResponse(),
                              request.getTimeout().toSeconds());
      

      However buildEsSearchScrollRequest#buildEsSearchScrollRequest will call the SearchRequest#scroll method by providing a TimeValue object initialized with the keepAlive value (set in seconds) whereas the constructor of TimeValue expects a value in milliseconds

      As a consequence, with a keepAlive set to 60 seconds, we observe a message in the logs which shows this value in milliseconds

      DEBUG [scrollerPool-00,in:6,inCheckpoint:6,out:504,lastRead:1696280650944,lastTimer:0,wm:222334897469784065,loop:17367,checkpoint] [ElasticSearchServiceImpl] Search query: curl -XGET 'http://localhost:9200/nuxeo/doc/_search?pretty&search_type=dfs_query_then_fetch&scroll=Scroll{keepAlive=60ms}' -d '{.......
      

       

      Expected behavior: the scroll method must be called with a keepAlive value converted into milliseconds

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: