You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Konstantin Orlov (Jira)" <ji...@apache.org> on 2026/03/17 09:54:00 UTC
[jira] [Commented] (IGNITE-21047) Sql. Avoid spamming execution tasks when possible
[ https://issues.apache.org/jira/browse/IGNITE-21047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18066282#comment-18066282 ]
Konstantin Orlov commented on IGNITE-21047:
-------------------------------------------
Besides actual execution, there are also few places related to distributed plan initialization which also contributes to the number of scheduled task. Some of those are:
* {{DistributedQueryManager.close}} in general and {{closeLocalFragments}} in particular (task to bootstrap closing + task per local fragment)
* {{StorageScanNode.requestNextBatch}} + 1 task to return back to sql runtime (especially sensible when {{getByPK}} access method is used)
* {{UpdatableTableImpl.upsertAll}} + 1 task to return back to sql runtime (especially sensible when {{singleRowInsert}} is used)
* {{AsyncRootNode.requestNextAsync}} schedules a task even if execution has ended and all the results resides in buffer
Besides, there are number of places which affects single node / local execution mode:
* {{DistributedQueryManager.sendFragment}} schedules task per fragment
* {{ExchangeServiceImpl}} request + send batch
* {{DistributedQueryManager.executeFragment}} sends acknowledgments
> Sql. Avoid spamming execution tasks when possible
> -------------------------------------------------
>
> Key: IGNITE-21047
> URL: https://issues.apache.org/jira/browse/IGNITE-21047
> Project: Ignite
> Issue Type: Improvement
> Components: sql
> Reporter: Konstantin Orlov
> Priority: Major
> Labels: ignite-3
> Fix For: 3.2
>
> Attachments: IGNITE-21047__Sql__Avoid_spamming_execution_tasks_when_possible.patch
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Need to revise all usages of {{org.apache.ignite.internal.sql.engine.exec.ExecutionContext#execute}} and check whether spawning a new task is legit in every particular case or it's better to do the work right now.
> For example, lets take a look at {{org.apache.ignite.internal.sql.engine.exec.rel.ScanNode#request}}:
>
> {code:java}
> @Override
> public void request(int rowsCnt) throws Exception {
> assert rowsCnt > 0 && requested == 0 : "rowsCnt=" + rowsCnt + ", requested=" + requested;
> checkState();
> requested = rowsCnt;
> if (!inLoop) {
> context().execute(this::push, this::onError);
> }
> }
> {code}
> in case of the very first request we will spawn a new task, but it would be better to drain the first batch of rows as well.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)