fabriziofortino commented on code in PR #2271:
URL: https://github.com/apache/jackrabbit-oak/pull/2271#discussion_r2078431439


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/query/async/ElasticResultRowAsyncIterator.java:
##########
@@ -275,7 +279,9 @@ class ElasticQueryScanner {
                                 .highlight(highlight)
                                 // use a smaller size when the query contains 
aggregations. This improves performance
                                 // when the client is only interested in 
insecure facets
-                                .size(needsAggregations.get() ? 
Math.min(SMALL_RESULT_SET_SIZE, getFetchSize(requests)) : 
getFetchSize(requests));
+                                .size(needsAggregations.get() ? 
Math.min(SMALL_RESULT_SET_SIZE, getFetchSize(requests)) : 
getFetchSize(requests))
+                                // consistently route the same queries to the 
same shard copy (primary or replica) within the shard set
+                                .preference(sessionId);

Review Comment:
   added simple unit test to verify preference is set and does not change 
across invocation of the same query



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to