ygerzhedovich commented on code in PR #4662: URL: https://github.com/apache/ignite-3/pull/4662#discussion_r1828941004
########## modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/rel/AsyncRootNodeTest.java: ########## @@ -78,8 +93,115 @@ void ensurePrefetchFutureIsNotCompletedByRequestedOfBatch() throws InterruptedEx assertFalse(prefetchFuture.isDone()); } + /** + * Test to make sure root node won't return false-positive result in {@link BatchedResult#hasMore()}. + * + * <p>Such problem may arise when incoming request drains the internal buffer of the node empty, while source node has no more data + * left yet {@link Downstream#end()} has not been called. + * + * <p>Test below is a simplified reproducer: data source has exactly the same number of rows that the size of the buffer. + * + * <p>Another scenario may involve one exchange: one remote should fulfill the demand with all the rows it has, while another remote + * doesn't have data at all, but batch message from that remote is delayed. + */ + @Test + void ensureNodeWontReturnFalsePositiveHasMoreFlag() { Review Comment: After adding the test I see new error in log: `[2024-11-05T10:38:02,357][ERROR][%no_node%sql-execution-pool-0][FailureManager] Critical system error detected. Will be handled accordingly to configured handler [hnd=NoOpFailureHandler [super=AbstractFailureHandler [ignoredFailureTypes=UnmodifiableSet [SYSTEM_WORKER_BLOCKED, SYSTEM_CRITICAL_OPERATION_TIMEOUT]]], failureCtx=CRITICAL_ERROR] org.apache.ignite.lang.IgniteException: Unexpected error during execute fragment 0 of query 728719ba-e338-4adf-a124-809ced6e007c at org.apache.ignite.internal.sql.engine.exec.QueryTaskExecutorImpl.lambda$execute$0(QueryTaskExecutorImpl.java:96) ~[main/:?] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.base/java.lang.Thread.run(Thread.java:829) [?:?] Caused by: java.util.concurrent.RejectedExecutionException: Task org.apache.ignite.internal.sql.engine.exec.QueryTaskExecutorImpl$$Lambda$734/0x0000000800422440@4093a51b rejected from java.util.concurrent.ThreadPoolExecutor@730d5d47[Shutting down, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 4] at java.base/java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2055) ~[?:?] at java.base/java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:825) ~[?:?] at java.base/java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1355) ~[?:?] at org.apache.ignite.internal.thread.AbstractStripedThreadPoolExecutor.execute(AbstractStripedThreadPoolExecutor.java:61) ~[main/:?]` -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org