forked from opencurve/curveadm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(deploy): wait all chunkserver online time (opencurve#114).
Signed-off-by: Wine93 <[email protected]>
- Loading branch information
1 parent
3890e0b
commit 5957f85
Showing
6 changed files
with
32 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Usage: no args, just run it in bash | ||
# Usage: wait_chunkserver 3 | ||
# Created Date: 2022-03-09 | ||
# Author: aspirer | ||
|
||
|
||
# FIXME(P0): wait not works, return -12 | ||
g_total="$1" | ||
|
||
wait=0 | ||
while ((wait<60)) | ||
do | ||
status=$(curve_ops_tool chunkserver-status |grep "offline") | ||
total=$(echo ${status} | grep -c "total num = 0") | ||
offline=$(echo ${status} | grep -c "offline = 0") | ||
if [ ${total} -eq 0 ] && [ ${offline} -eq 1 ]; then | ||
echo "CURVEADM_SUCCESS" | ||
online=$(curve_ops_tool chunkserver-status | sed -nr 's/.*online = ([0-9]+).*/\1/p') | ||
if [[ $online -eq $g_total ]]; then | ||
exit 0 | ||
fi | ||
|
||
sleep 0.5s | ||
wait=$(expr ${wait} + 1) | ||
wait=$((wait+1)) | ||
done | ||
echo "CURVEADM_TIMEOUT" | ||
|
||
echo "wait all chunkserver online timeout, total=$g_total, online=$online" | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters