ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] AMashenkov commented on a change in pull request #6917: IGNITE-12189 Implementation correct limit for TextQuery
Date Tue, 22 Oct 2019 14:06:50 GMT
AMashenkov commented on a change in pull request #6917: IGNITE-12189 Implementation correct
limit for TextQuery
URL: https://github.com/apache/ignite/pull/6917#discussion_r337537966
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
 ##########
 @@ -327,9 +331,15 @@ protected void onNodeLeft(UUID evtNodeId) {
     protected void enqueue(Collection<?> col) {
         assert Thread.holdsLock(this);
 
-        queue.add((Collection<R>)col);
-
-        cnt.addAndGet(col.size());
+        if(limitCnt <= 0 || limitCnt >= col.size()) {
+            queue.add((Collection<R>)col);
+            cnt.addAndGet(col.size());
+            limitCnt -= col.size();
+        } else {
+            int toAdd = limitCnt;
 
 Review comment:
   This is true for local query, but isn't for distributed
   .
   enqueue() method is called on every page received from remote node.
   
   Assume we receive 2 pages from 2 nodes and try to enqueue them concurrently.
   Both pages will be trimmed and added to queue, but the only first is expected to be added.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message