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

Pavel Pereslegin updated IGNITE-20385:
--------------------------------------
    Description: 
During execute SQL query we could got Exception with INTERNAL_ERR in case 
remote node left. Node left sholdn't be interpret as INTERNAL ERROR, due to 
it's normal situation and user can be informed about it. 

Let's map the situation to SqlException with code NODE_LEFT_ERR.

Also need to check wich similar situation we could cover here.

As start point need to find all places where used 
ExceptionUtils.withCauseAndCode method 

{code:java}
org.apache.ignite.lang.IgniteException: IGN-CMN-65535 
TraceId:6a9a41f8-a6f4-44f1-87b0-4516c514d1df Unable to send fragment 
[targetNode=idt_n_1, fragmentId=1, cause=Node left the cluster. Node: idt_n_1]

        at 
org.apache.ignite.lang.IgniteExceptionMapperUtil.mapToPublicException(IgniteExceptionMapperUtil.java:106)
        at 
org.apache.ignite.internal.sql.engine.AsyncSqlCursorImpl.wrapIfNecessary(AsyncSqlCursorImpl.java:100)
        at 
org.apache.ignite.internal.sql.engine.AsyncSqlCursorImpl.lambda$requestNextAsync$0(AsyncSqlCursorImpl.java:76)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
        at 
java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
        at 
java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at 
java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$15(ExecutionServiceImpl.java:747)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:946)
        at 
java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2266)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$17(ExecutionServiceImpl.java:726)
        at 
java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
        at 
java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
        at 
java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
        at 
org.apache.ignite.internal.sql.engine.exec.QueryTaskExecutorImpl.lambda$execute$0(QueryTaskExecutorImpl.java:81)
        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:834)
        Suppressed: java.lang.RuntimeException: This is a trimmed root
                ...
Caused by: org.apache.ignite.lang.IgniteInternalException: IGN-CMN-65535 
TraceId:6a9a41f8-a6f4-44f1-87b0-4516c514d1df Unable to send fragment 
[targetNode=idt_n_1, fragmentId=1, cause=Node left the cluster. Node: idt_n_1]
        at 
org.apache.ignite.internal.util.ExceptionUtils.lambda$withCauseAndCode$3(ExceptionUtils.java:440)
        at 
org.apache.ignite.internal.util.ExceptionUtils.withCauseInternal(ExceptionUtils.java:467)
        at 
org.apache.ignite.internal.util.ExceptionUtils.withCauseAndCode(ExceptionUtils.java:440)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$12(ExecutionServiceImpl.java:714)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:946)
        at 
java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2266)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$17(ExecutionServiceImpl.java:698)
        ... 7 more
Caused by: org.apache.ignite.internal.sql.engine.NodeLeftException: IGN-CMN-5 
TraceId:bf122f9c-e697-4dfa-b59f-0692595fa94c Node left the cluster. Node: 
idt_n_1
        at 
org.apache.ignite.internal.sql.engine.message.MessageServiceImpl.send(MessageServiceImpl.java:92)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.sendFragment(ExecutionServiceImpl.java:505)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$17(ExecutionServiceImpl.java:695)
        ... 7 more
{code}


  was:
During execute SQL query we could got Exception with INTERNAL_ERR in case 
remote node left. Node left sholdn't be interpret as INTERNAL ERROR, due to 
it's normal situation and user can be informed about it. 

Let's map the situation to SqlException with code NODE_LEFT_ERR.

Also need to check wich similar situation we could cover here.

As start point need to find all places where used 
ExceptionUtils.withCauseAndCode method

{code:java}
org.apache.ignite.lang.IgniteException: IGN-CMN-65535 
TraceId:6a9a41f8-a6f4-44f1-87b0-4516c514d1df Unable to send fragment 
[targetNode=idt_n_1, fragmentId=1, cause=Node left the cluster. Node: idt_n_1]

        at 
org.apache.ignite.lang.IgniteExceptionMapperUtil.mapToPublicException(IgniteExceptionMapperUtil.java:106)
        at 
org.apache.ignite.internal.sql.engine.AsyncSqlCursorImpl.wrapIfNecessary(AsyncSqlCursorImpl.java:100)
        at 
org.apache.ignite.internal.sql.engine.AsyncSqlCursorImpl.lambda$requestNextAsync$0(AsyncSqlCursorImpl.java:76)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
        at 
java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
        at 
java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at 
java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$15(ExecutionServiceImpl.java:747)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:946)
        at 
java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2266)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$17(ExecutionServiceImpl.java:726)
        at 
java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
        at 
java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
        at 
java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
        at 
org.apache.ignite.internal.sql.engine.exec.QueryTaskExecutorImpl.lambda$execute$0(QueryTaskExecutorImpl.java:81)
        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:834)
        Suppressed: java.lang.RuntimeException: This is a trimmed root
                ...
Caused by: org.apache.ignite.lang.IgniteInternalException: IGN-CMN-65535 
TraceId:6a9a41f8-a6f4-44f1-87b0-4516c514d1df Unable to send fragment 
[targetNode=idt_n_1, fragmentId=1, cause=Node left the cluster. Node: idt_n_1]
        at 
org.apache.ignite.internal.util.ExceptionUtils.lambda$withCauseAndCode$3(ExceptionUtils.java:440)
        at 
org.apache.ignite.internal.util.ExceptionUtils.withCauseInternal(ExceptionUtils.java:467)
        at 
org.apache.ignite.internal.util.ExceptionUtils.withCauseAndCode(ExceptionUtils.java:440)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$12(ExecutionServiceImpl.java:714)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
        at 
java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:946)
        at 
java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2266)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$17(ExecutionServiceImpl.java:698)
        ... 7 more
Caused by: org.apache.ignite.internal.sql.engine.NodeLeftException: IGN-CMN-5 
TraceId:bf122f9c-e697-4dfa-b59f-0692595fa94c Node left the cluster. Node: 
idt_n_1
        at 
org.apache.ignite.internal.sql.engine.message.MessageServiceImpl.send(MessageServiceImpl.java:92)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.sendFragment(ExecutionServiceImpl.java:505)
        at 
org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$17(ExecutionServiceImpl.java:695)
        ... 7 more
{code}



> Incorrect code INTERNAL_ERROR on node left 
> -------------------------------------------
>
>                 Key: IGNITE-20385
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20385
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Yury Gerzhedovich
>            Assignee: Pavel Pereslegin
>            Priority: Major
>              Labels: ignite-3
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> During execute SQL query we could got Exception with INTERNAL_ERR in case 
> remote node left. Node left sholdn't be interpret as INTERNAL ERROR, due to 
> it's normal situation and user can be informed about it. 
> Let's map the situation to SqlException with code NODE_LEFT_ERR.
> Also need to check wich similar situation we could cover here.
> As start point need to find all places where used 
> ExceptionUtils.withCauseAndCode method 
> {code:java}
> org.apache.ignite.lang.IgniteException: IGN-CMN-65535 
> TraceId:6a9a41f8-a6f4-44f1-87b0-4516c514d1df Unable to send fragment 
> [targetNode=idt_n_1, fragmentId=1, cause=Node left the cluster. Node: idt_n_1]
>       at 
> org.apache.ignite.lang.IgniteExceptionMapperUtil.mapToPublicException(IgniteExceptionMapperUtil.java:106)
>       at 
> org.apache.ignite.internal.sql.engine.AsyncSqlCursorImpl.wrapIfNecessary(AsyncSqlCursorImpl.java:100)
>       at 
> org.apache.ignite.internal.sql.engine.AsyncSqlCursorImpl.lambda$requestNextAsync$0(AsyncSqlCursorImpl.java:76)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:907)
>       at 
> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
>       at 
> java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$15(ExecutionServiceImpl.java:747)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:946)
>       at 
> java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2266)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$17(ExecutionServiceImpl.java:726)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
>       at 
> java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
>       at 
> java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478)
>       at 
> org.apache.ignite.internal.sql.engine.exec.QueryTaskExecutorImpl.lambda$execute$0(QueryTaskExecutorImpl.java:81)
>       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:834)
>       Suppressed: java.lang.RuntimeException: This is a trimmed root
>               ...
> Caused by: org.apache.ignite.lang.IgniteInternalException: IGN-CMN-65535 
> TraceId:6a9a41f8-a6f4-44f1-87b0-4516c514d1df Unable to send fragment 
> [targetNode=idt_n_1, fragmentId=1, cause=Node left the cluster. Node: idt_n_1]
>       at 
> org.apache.ignite.internal.util.ExceptionUtils.lambda$withCauseAndCode$3(ExceptionUtils.java:440)
>       at 
> org.apache.ignite.internal.util.ExceptionUtils.withCauseInternal(ExceptionUtils.java:467)
>       at 
> org.apache.ignite.internal.util.ExceptionUtils.withCauseAndCode(ExceptionUtils.java:440)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$12(ExecutionServiceImpl.java:714)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:930)
>       at 
> java.base/java.util.concurrent.CompletableFuture.uniHandleStage(CompletableFuture.java:946)
>       at 
> java.base/java.util.concurrent.CompletableFuture.handle(CompletableFuture.java:2266)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$17(ExecutionServiceImpl.java:698)
>       ... 7 more
> Caused by: org.apache.ignite.internal.sql.engine.NodeLeftException: IGN-CMN-5 
> TraceId:bf122f9c-e697-4dfa-b59f-0692595fa94c Node left the cluster. Node: 
> idt_n_1
>       at 
> org.apache.ignite.internal.sql.engine.message.MessageServiceImpl.send(MessageServiceImpl.java:92)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.sendFragment(ExecutionServiceImpl.java:505)
>       at 
> org.apache.ignite.internal.sql.engine.exec.ExecutionServiceImpl$DistributedQueryManager.lambda$execute$17(ExecutionServiceImpl.java:695)
>       ... 7 more
> {code}



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

Reply via email to