You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2018/11/14 10:10:13 UTC
[flink] branch release-1.5 updated: [FLINK-10856] Take latest
checkpoint to resume from in resume from externalized checkpoint e2e test
This is an automated email from the ASF dual-hosted git repository.
trohrmann pushed a commit to branch release-1.5
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.5 by this push:
new 2c63fee [FLINK-10856] Take latest checkpoint to resume from in resume from externalized checkpoint e2e test
2c63fee is described below
commit 2c63feecd5c6c5e6cc70c6449c8d4b551f0753e2
Author: Till Rohrmann <tr...@apache.org>
AuthorDate: Tue Nov 13 15:04:11 2018 +0100
[FLINK-10856] Take latest checkpoint to resume from in resume from externalized checkpoint e2e test
Since it can happen that some empty checkpoint directories are left, we have to take the latest
checkpoint directory in order to resume from an externalized checkpoint. This commit changes the
test_resume_externalized_checkpoint.sh to sort the checkpoint directories in descending order and
then takes the head checkpoint directory.
---
.../test-scripts/test_resume_externalized_checkpoints.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/flink-end-to-end-tests/test-scripts/test_resume_externalized_checkpoints.sh b/flink-end-to-end-tests/test-scripts/test_resume_externalized_checkpoints.sh
index 6e8f462..e0b97d6 100755
--- a/flink-end-to-end-tests/test-scripts/test_resume_externalized_checkpoints.sh
+++ b/flink-end-to-end-tests/test-scripts/test_resume_externalized_checkpoints.sh
@@ -112,19 +112,14 @@ else
cancel_job $DATASTREAM_JOB
fi
-CHECKPOINT_PATH=$(ls -d $CHECKPOINT_DIR/$DATASTREAM_JOB/chk-[1-9]*)
+# take the latest checkpoint
+CHECKPOINT_PATH=$(ls -d $CHECKPOINT_DIR/$DATASTREAM_JOB/chk-[1-9]* | sort -Vr | head -n1)
if [ -z $CHECKPOINT_PATH ]; then
echo "Expected an externalized checkpoint to be present, but none exists."
exit 1
fi
-NUM_CHECKPOINTS=$(echo $CHECKPOINT_PATH | wc -l | tr -d ' ')
-if (( $NUM_CHECKPOINTS > 1 )); then
- echo "Expected only exactly 1 externalized checkpoint to be present, but $NUM_CHECKPOINTS exists."
- exit 1
-fi
-
echo "Restoring job with externalized checkpoint at $CHECKPOINT_PATH ..."
BASE_JOB_CMD=`buildBaseJobCmd $NEW_DOP "-s file://${CHECKPOINT_PATH}"`
@@ -142,6 +137,11 @@ fi
DATASTREAM_JOB=$($JOB_CMD | grep "Job has been submitted with JobID" | sed 's/.* //g')
+if [ -z $DATASTREAM_JOB ]; then
+ echo "Resuming from externalized checkpoint job could not be started."
+ exit 1
+fi
+
wait_job_running $DATASTREAM_JOB
wait_oper_metric_num_in_records ArtificalKeyedStateMapper.0 200