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

Add a retry to remove the vttablet directory during upgrade/downgrade backup tests #14753

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/upgrade_downgrade_test_backups_manual.yml'
- 'examples/**'

- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/upgrade_downgrade_test_backups_manual_next_release.yml'
- 'examples/**'

- name: Set up Go
if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true'
Expand Down
20 changes: 19 additions & 1 deletion examples/backups/stop_tablets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,25 @@ for tablet in 100 200 300; do
CELL=zone1 TABLET_UID=$uid ../common/scripts/mysqlctl-down.sh
echo "Removing tablet directory zone1-$uid"
vtctldclient DeleteTablets --allow-primary zone1-$uid
rm -Rf $VTDATAROOT/vt_0000000$uid

for ((i=0; i<30; i++)); do
# Redirect stderr to a temporary file
temp_file=$(mktemp)
rm -Rf $VTDATAROOT/vt_0000000$uid 2>"$temp_file"

if grep -q 'Directory not empty' "$temp_file"; then
echo "Directory not empty, retrying..."
elif [ ! -s "$temp_file" ]; then
echo "Deletion succeeded."
rm -f "$temp_file"
break
else
echo "An error occurred."
cat "$temp_file"
fi
rm -f "$temp_file"
sleep 1
done
done
fi
done
Loading