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

testnet: Wait for the leader to initialize before starting the validators #607

Merged
merged 1 commit into from
Jul 13, 2018
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
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