[ 
https://issues.apache.org/jira/browse/FLINK-6682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16053967#comment-16053967
 ] 

ASF GitHub Bot commented on FLINK-6682:
---------------------------------------

Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4125#discussion_r122686915
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java
 ---
    @@ -225,7 +225,16 @@ private void assignAttemptState(ExecutionJobVertex 
executionJobVertex, List<Oper
     
     
        public void checkParallelismPreconditions(List<OperatorState> 
operatorStates, ExecutionJobVertex executionJobVertex) {
    -
    +           //----------------------------------------parallelism compare 
preconditions-------------------------------------
    +
    +           // if the max parallelism is lower than parallelism, we will 
throw an exception.
    +           if (executionJobVertex.getMaxParallelism() < 
executionJobVertex.getParallelism()) {
    +                   throw new IllegalArgumentException("JobVertex: " + 
executionJobVertex.getJobVertex()  +
    --- End diff --
    
    We don't usually refer to JobVertices in exceptions, a more user-known 
"equivalent" are tasks.
    
    We should also throw an IllegalStateException to be consistent with 
existing exceptions in this area.
    
    Finally, let's reword this a bit:
    
    "The state for task (<executionJobVertex.getJobVertexId()>) cannot be 
restored. The maximum parallelism (<operatorState.getMaxParallelism()>) of the 
restored state is lower than the configured parallelism 
(<executionJobVertex.getParallelism()>). Please reduce the parallelism of the 
task to be lower or equal to the maximum parallelism."


> Improve error message in case parallelism exceeds maxParallelism
> ----------------------------------------------------------------
>
>                 Key: FLINK-6682
>                 URL: https://issues.apache.org/jira/browse/FLINK-6682
>             Project: Flink
>          Issue Type: Improvement
>          Components: State Backends, Checkpointing
>    Affects Versions: 1.3.0, 1.4.0
>            Reporter: Chesnay Schepler
>            Assignee: mingleizhang
>
> When restoring a job with a parallelism that exceeds the maxParallelism we're 
> not providing a useful error message, as all you get is an 
> IllegalArgumentException:
> {code}
> Caused by: org.apache.flink.runtime.client.JobExecutionException: Job 
> execution failed
>         at 
> org.apache.flink.runtime.client.JobClient.awaitJobResult(JobClient.java:343)
>         at 
> org.apache.flink.runtime.client.JobClient.submitJobAndWait(JobClient.java:396)
>         at 
> org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:467)
>         ... 22 more
> Caused by: java.lang.IllegalArgumentException
>         at 
> org.apache.flink.util.Preconditions.checkArgument(Preconditions.java:123)
>         at 
> org.apache.flink.runtime.checkpoint.StateAssignmentOperation.createKeyGroupPartitions(StateAssignmentOperation.java:449)
>         at 
> org.apache.flink.runtime.checkpoint.StateAssignmentOperation.assignAttemptState(StateAssignmentOperation.java:117)
>         at 
> org.apache.flink.runtime.checkpoint.StateAssignmentOperation.assignStates(StateAssignmentOperation.java:102)
>         at 
> org.apache.flink.runtime.checkpoint.CheckpointCoordinator.restoreLatestCheckpointedState(CheckpointCoordinator.java:1038)
>         at 
> org.apache.flink.runtime.checkpoint.CheckpointCoordinator.restoreSavepoint(CheckpointCoordinator.java:1101)
>         at 
> org.apache.flink.runtime.jobmanager.JobManager$$anonfun$org$apache$flink$runtime$jobmanager$JobManager$$submitJob$1.apply$mcV$sp(JobManager.scala:1386)
>         at 
> org.apache.flink.runtime.jobmanager.JobManager$$anonfun$org$apache$flink$runtime$jobmanager$JobManager$$submitJob$1.apply(JobManager.scala:1372)
>         at 
> org.apache.flink.runtime.jobmanager.JobManager$$anonfun$org$apache$flink$runtime$jobmanager$JobManager$$submitJob$1.apply(JobManager.scala:1372)
>         at 
> scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
>         at 
> scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
>         at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
>         at 
> akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
>         at 
> scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
>         at 
> scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
>         at 
> scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
>         at 
> scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to