Wait for bootstrap leader to initialize before starting other validators (#5027)
This commit is contained in:
parent
8781aebe06
commit
41d0db078e
|
@ -125,11 +125,8 @@ startNode() {
|
||||||
echo "log: $log"
|
echo "log: $log"
|
||||||
}
|
}
|
||||||
|
|
||||||
initCompleteFiles=()
|
waitForNodeToInit() {
|
||||||
waitForAllNodesToInit() {
|
declare initCompleteFile=$1
|
||||||
echo "--- ${#initCompleteFiles[@]} nodes booting"
|
|
||||||
SECONDS=
|
|
||||||
for initCompleteFile in "${initCompleteFiles[@]}"; do
|
|
||||||
while [[ ! -r $initCompleteFile ]]; do
|
while [[ ! -r $initCompleteFile ]]; do
|
||||||
if [[ $SECONDS -ge 240 ]]; then
|
if [[ $SECONDS -ge 240 ]]; then
|
||||||
echo "^^^ +++"
|
echo "^^^ +++"
|
||||||
|
@ -140,6 +137,14 @@ waitForAllNodesToInit() {
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
echo "Found $initCompleteFile"
|
echo "Found $initCompleteFile"
|
||||||
|
}
|
||||||
|
|
||||||
|
initCompleteFiles=()
|
||||||
|
waitForAllNodesToInit() {
|
||||||
|
echo "--- ${#initCompleteFiles[@]} nodes booting"
|
||||||
|
SECONDS=
|
||||||
|
for initCompleteFile in "${initCompleteFiles[@]}"; do
|
||||||
|
waitForNodeToInit "$initCompleteFile"
|
||||||
done
|
done
|
||||||
echo "All nodes finished booting in $SECONDS seconds"
|
echo "All nodes finished booting in $SECONDS seconds"
|
||||||
}
|
}
|
||||||
|
@ -162,6 +167,13 @@ startNodes() {
|
||||||
if $addLogs; then
|
if $addLogs; then
|
||||||
logs+=("$(getNodeLogFile "$i" "$cmd")")
|
logs+=("$(getNodeLogFile "$i" "$cmd")")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 1 == bootstrap leader, wait until it boots before starting
|
||||||
|
# other validators
|
||||||
|
if [[ "$i" -eq 1 ]]; then
|
||||||
|
SECONDS=
|
||||||
|
waitForNodeToInit "$initCompleteFile"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
waitForAllNodesToInit
|
waitForAllNodesToInit
|
||||||
|
|
Loading…
Reference in New Issue