Skip to content

Commit

Permalink
[FLINK-10856] Find latest completed checkpoint for resume from extern…
Browse files Browse the repository at this point in the history
…alized checkpoint e2e test
  • Loading branch information
tillrohrmann committed Nov 16, 2018
1 parent 0027423 commit bddfe23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions flink-end-to-end-tests/test-scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -656,3 +656,10 @@ function wait_for_restart_to_complete {
fi
done
}

function find_latest_completed_checkpoint {
local checkpoint_root_directory=$1
# a completed checkpoint must contain the _metadata file
local checkpoint_meta_file=$(ls -d ${checkpoint_root_directory}/chk-[1-9]*/_metadata | sort -Vr | head -n1)
echo "$(dirname "${checkpoint_meta_file}")"
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ else
fi

# take the latest checkpoint
CHECKPOINT_PATH=$(ls -d $CHECKPOINT_DIR/$DATASTREAM_JOB/chk-[1-9]* | sort -Vr | head -n1)
CHECKPOINT_PATH=$(find_latest_completed_checkpoint ${CHECKPOINT_DIR}/${DATASTREAM_JOB})

if [ -z $CHECKPOINT_PATH ]; then
echo "Expected an externalized checkpoint to be present, but none exists."
Expand Down

0 comments on commit bddfe23

Please sign in to comment.