timoninmaxim commented on a change in pull request #9086:
URL: https://github.com/apache/ignite/pull/9086#discussion_r638626435



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
##########
@@ -264,25 +266,7 @@ protected void onNodeLeft(UUID evtNodeId) {
     protected void enqueue(Collection<?> col) {
         assert Thread.holdsLock(this);
 
-        if (limitDisabled) {
-            queue.add((Collection<R>)col);
-
-            cnt.addAndGet(col.size());
-        }
-        else {
-            if (capacity >= col.size()) {
-                queue.add((Collection<R>)col);
-                capacity -= col.size();
-
-                cnt.addAndGet(col.size());
-            }
-            else if (capacity > 0) {
-                queue.add(new ArrayList<>((Collection<R>)col).subList(0, 
capacity));
-                capacity = 0;
-
-                cnt.addAndGet(capacity);
-            }
-        }
+        queue.add((Collection<R>)col);

Review comment:
       Hi! Sorry, could you please clarify which case do you mean? How does the 
cancel() invoke? 
   
   If I understand you correctly, you told that empty collection (that will be 
inserted to the queue after limit exceed) will trigger cancel. But actually 
it's not true. In this case we just check that it's empty and ask for new page 
[1]. So nobody will send cancel().
   
   You can run my test "GridCacheTextQueryPagesTest" from this PR on master 
code base - it will fail. It checks number of pages to be loaded during a query.
   
   [1] 
https://github.com/apache/ignite/blob/7faa57c49118285b830fcf614a12abda65116f51/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java#L213




-- 
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:
[email protected]


Reply via email to