-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Component/s: Elasticsearch
-
Release Notes Summary:The elastic scroll keepalive duration uses the correct unit.
-
Tags:
-
Backlog priority:700
-
Sprint:nxplatform #100
-
Story Points:3
When we run a computation which executes an Elasticsearch query, it builds an EsScrollResult with a keepAlive value set in seconds:
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