Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update parse start script to handle the case that fsimage txid is cov… #78

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions dynamometer-workload/src/main/bash/parse-start-timestamp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@ else
edits_dir="`pwd`"
fi

edits_file_count=`ls -1 ${edits_dir} | grep -E "^edits_[[:digit:]]+-0*$image_txid\$" | wc -l`
# try to find the edit logs whose transaction range covers the txid from the fsimage
# first find the first txid which is greater or equal to the fsimage txid
ending_txid=`ls -1 ${edits_dir} | grep -E "^edits_[[:digit:]]+-[[:digit:]]+\$" | \
awk -v t="$image_txid" -F'-' '{if ($2 >= t) {print $2}}' | head -1`
if [ -z "$ending_txid" ]; then
echo "Error; found 0 covering edit files."
exit 1
fi
# then grep the file ending with the ending_txid, exit if duplicated edits exist
edits_file_count=`ls -1 ${edits_dir} | grep -E "^edits_[[:digit:]]+-0*$ending_txid\$" | wc -l`
if [ "$edits_file_count" != 1 ]; then
echo "Error; found $edits_file_count matching edit files."
exit 1
fi
edits_file=`ls -1 ${edits_dir} | grep -E "^edits_[[:digit:]]+-0*$image_txid\$"`
edits_file=`ls -1 ${edits_dir} | grep -E "^edits_[[:digit:]]+-0*$ending_txid\$"`

awk_script='/TIMESTAMP/ { line=$0 } \
END { match(line, />([[:digit:]]+)</, output); print output[1] }'
Expand Down