Skip to content

Commit

Permalink
Add || fail to handle backup failures in shard backup process.
Browse files Browse the repository at this point in the history
Signed-off-by: Shail Pujan <[email protected]>
  • Loading branch information
shailpujan88 committed Oct 11, 2024
1 parent 811bc3b commit ad14a73
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions examples/local/401_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ done
# Backup all shards of the customer keyspace
for shard in "${SHARDS[@]}"; do
echo "Backing up shard $shard in keyspace $KEYSPACE..."
if vtctldclient BackupShard "$KEYSPACE/$shard"; then
echo "Backup succeeded for shard $shard."
else
echo "Backup failed for shard $shard."
exit 1
fi
vtctldclient BackupShard "$KEYSPACE/$shard" || fail "Backup failed for shard $shard."
echo "Backup succeeded for shard $shard."
done

echo "Backup process completed successfully for all shards in $KEYSPACE."

0 comments on commit ad14a73

Please sign in to comment.