Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 72699200CC1 for ; Sun, 25 Jun 2017 08:44:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6FF27160C05; Sun, 25 Jun 2017 06:44:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BC046160BF4 for ; Sun, 25 Jun 2017 08:44:47 +0200 (CEST) Received: (qmail 7312 invoked by uid 500); 25 Jun 2017 06:44:46 -0000 Mailing-List: contact commits-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list commits@flink.apache.org Received: (qmail 7237 invoked by uid 99); 25 Jun 2017 06:44:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Jun 2017 06:44:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5B629E1897; Sun, 25 Jun 2017 06:44:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chesnay@apache.org To: commits@flink.apache.org Date: Sun, 25 Jun 2017 06:44:57 -0000 Message-Id: In-Reply-To: <72a33389b16b4af7bdecf6bec611aa57@git.apache.org> References: <72a33389b16b4af7bdecf6bec611aa57@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [14/21] flink git commit: [FLINK-6682] [checkpoints] Improve error message in case parallelism exceeds maxParallelism archived-at: Sun, 25 Jun 2017 06:44:48 -0000 [FLINK-6682] [checkpoints] Improve error message in case parallelism exceeds maxParallelism This closes #4125. Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/c736ba2e Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/c736ba2e Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/c736ba2e Branch: refs/heads/master Commit: c736ba2ef15e9e81a54a3fc02ccffadcbf594767 Parents: 7216407 Author: zhangminglei Authored: Tue Jun 20 19:43:44 2017 +0800 Committer: zentol Committed: Fri Jun 23 14:14:30 2017 +0200 ---------------------------------------------------------------------- .../flink/runtime/checkpoint/StateAssignmentOperation.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/c736ba2e/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java b/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java index 1042d5a..5712ea1 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java @@ -464,6 +464,14 @@ public class StateAssignmentOperation { 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() + + ") 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." + ); + } + // check that the number of key groups have not changed or if we need to override it to satisfy the restored state if (operatorState.getMaxParallelism() != executionJobVertex.getMaxParallelism()) {