[ 
https://issues.apache.org/jira/browse/IGNITE-17699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konstantin Orlov updated IGNITE-17699:
--------------------------------------
    Description: 
Current implementation is based on StrippedThreadExecutor which has major 
downside: long-living task prevents others task from the same stripe from being 
executed. This means that the sql engine can be blocked by any query that will 
take a thread for a long time (most simple example is UDF invoking a 
{{Thread.sleep()}}).

Let's think about how we can improve this.

Every implementation of QueryTaskExecuter must meet following requirements:
# tasks with the same (queryId, fragmentId) can't be reordered
# tasks with the same (queryId, fragmentId) can't be executed in parallel: if 
T1 and T2 are tasks, submit_time(T1) < submit_time(T2), then end_time(T1) < 
start_time(T2)
# there must be 'happens-before' relation between execution of task with the 
same (queryId, fragmentId)

  was:
Current implementation is based on StrippedThreadExecutor which has major 
downside: long-living task prevents others task from the same stripe from being 
executed. This means that the sql engine can be blocked by any query that will 
take a thread for a long time (most simple example is UDF invoking a 
{{Thread.sleep()}}).

Let's think about how we can improve this.

Every implementation of QueryTaskExecuter must meet following requirements:
1) tasks with the same (queryId, fragmentId) can't be reordered
2) tasks with the same (queryId, fragmentId) can't be executed in parallel: if 
T1 and T2 are tasks, submit_time(T1) < submit_time(T2), then end_time(T1) < 
start_time(T2)
3) there must be 'happens-before' relation between execution of task with the 
same (queryId, fragmentId)


> Improve implementation of QueryTaskExecuter
> -------------------------------------------
>
>                 Key: IGNITE-17699
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17699
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Yury Gerzhedovich
>            Priority: Major
>              Labels: calcite2-required, calcite3-required, ignite-3, tech-debt
>
> Current implementation is based on StrippedThreadExecutor which has major 
> downside: long-living task prevents others task from the same stripe from 
> being executed. This means that the sql engine can be blocked by any query 
> that will take a thread for a long time (most simple example is UDF invoking 
> a {{Thread.sleep()}}).
> Let's think about how we can improve this.
> Every implementation of QueryTaskExecuter must meet following requirements:
> # tasks with the same (queryId, fragmentId) can't be reordered
> # tasks with the same (queryId, fragmentId) can't be executed in parallel: if 
> T1 and T2 are tasks, submit_time(T1) < submit_time(T2), then end_time(T1) < 
> start_time(T2)
> # there must be 'happens-before' relation between execution of task with the 
> same (queryId, fragmentId)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to