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:04:41 UTC

[flink] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f15c17  [FLINK-10856] Take latest checkpoint to resume from in resume from externalized checkpoint e2e test
6f15c17 is described below

commit 6f15c1729156f23d69c870eff894d1cbd18d868f
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 fe23190..c147757 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
@@ -111,19 +111,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}"`
@@ -141,6 +136,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 SemanticsCheckMapper.0 200