[
https://issues.apache.org/jira/browse/FLINK-6682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16055576#comment-16055576
]
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_r122943463
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java
---
@@ -464,6 +464,14 @@ private void collectPartionableStates(
private static void checkParallelismPreconditions(OperatorState
operatorState, ExecutionJobVertex executionJobVertex) {
//----------------------------------------max parallelism
preconditions-------------------------------------
+ if (operatorState.getMaxParallelism() <
executionJobVertex.getParallelism()) {
+ throw new IllegalStateException("The state for task " +
executionJobVertex.getJobVertexId() +
+ " can not be restored. The maximum parallelism
" + operatorState.getMaxParallelism() +
--- End diff --
can you added braces around the (max)parallelism? The error message
currently looks like this:
```
Caused by: java.lang.IllegalStateException: The state for task
adf090656b210b1609ad3203d4ee7329 can not be restored. The maximum parallelism
128 of the restored state is lower than the configured parallelism 140. Please
reduce the parallelism of the task to be lower or equal to the maximum
parallelism.
```
But i think
```
Caused by: java.lang.IllegalStateException: The state for task
adf090656b210b1609ad3203d4ee7329 can not be restored. The maximum parallelism
(128) of the restored state is lower than the configured parallelism (140).
Please reduce the parallelism of the task to be lower or equal to the maximum
parallelism.
```
looks nicer.
> 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)