Skip to content

Commit

Permalink
Wait for the leader to initialize before starting the validators
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jul 13, 2018
1 parent 05cea4c commit 28d2449
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions ci/refresh-testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ done < <(gcloud compute instances list --filter="labels.testnet-mode=validator"


echo "--- Refreshing"
nodeConfig="mode=leader+drone enable-cuda=1 metrics-config=$SOLANA_METRICS_CONFIG"
leader=true
for info in "${vmlist[@]}"; do
vmName=${info%:*}
vmZone=${info#*:}
echo "Starting refresh for $vmName"

(
echo "--- Processing $vmName in zone $vmZone"
if $leader; then
nodeConfig="mode=leader+drone enable-cuda=1 metrics-config=$SOLANA_METRICS_CONFIG"
else
nodeConfig="mode=validator metrics-config=$SOLANA_METRICS_CONFIG"
fi
cat > "autogen-refresh-$vmName.sh" <<EOF
set -x
sudo snap remove solana
Expand All @@ -53,10 +58,17 @@ EOF
--ssh-flag="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -t" \
--command="bash ./autogen-refresh-$vmName.sh"
) > "log-$vmName.txt" 2>&1 &
nodeConfig="mode=validator metrics-config=$SOLANA_METRICS_CONFIG"

if $leader; then
echo Waiting for leader...
# Wait for the leader to initialize before starting the validators
# TODO: Remove this limitation eventually.
wait
fi
leader=false
done

echo "Waiting..."
echo Waiting for validators...
wait

for info in "${vmlist[@]}"; do
Expand Down

0 comments on commit 28d2449

Please sign in to comment.