[Backport 2026.2] fix(upgrade): retry package manager commands during rollback to absorb transient mirror failures - #15650
Draft
scylladbbot wants to merge 2 commits into
Draft
Conversation
added 2 commits
August 4, 2026 10:29
…back
sudo yum downgrade scylla\* -y in _rollback_node had no retry= kwarg, so
it defaulted to retry=1, which only retries SSH-transport failures, not
a non-zero yum exit. A transient Rocky 10 AppStream mirrorlist blip
("Cannot prepare internal mirrorlist: No URLs in mirrorlist") therefore
aborted the rollback immediately instead of retrying.
Add retry=3 (and timeout=600 for heavier package operations) to every
yum/apt-get remoter call in _upgrade_node/_rollback_node, matching the
convention already used by ~21 equivalent call sites in sdcm/cluster.py.
The apt-get calls keep their original hand-written command strings
(including the -o Dpkg::Options::=... suffixes) rather than routing
through sdcm/utils/apt.py's apt_cmd() helper: that helper is not yet a
settled convention (sdcm/cluster_cassandra.py still hand-writes
"apt-get update" with retry=3 at several sites) and SCT-704 itself is
Rocky/yum-only, not Debian/apt.
Reproducer: unit_tests/unit/test_upgrade_rollback_retries.py
::test_rollback_node_yum_downgrade_passes_retry_and_timeout
- fails on base, passes with fix
(cherry picked from commit 1b1b530)
…tests Tests: unit_tests/unit/test_upgrade_rollback_retries.py, unit_tests/unit/ -k "apt or upgrade" — passed (cherry picked from commit 46e442b)
Author
|
@soyacz - This PR has conflicts, therefore it was moved to |
Collaborator
❌ Test Summary: FAILED❌ Precommit: FAILED
Failed Hooks
Output
Output❌ Tests: FAILED
Failed Tests
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds retry=3 (and timeout=600 on heavier package-download calls) to the yum remoter calls in UpgradeTest._upgrade_node and UpgradeTest._rollback_node in upgrade_test.py.
Why
Fixes SCT-786: a rolling-upgrade rollback (upgrade_test.UpgradeTest.test_generic_cluster_upgrade) failed when 'sudo yum downgrade scylla* -y' hit a transient Rocky Linux 10 AppStream mirrorlist outage (Cannot prepare internal mirrorlist: No URLs in mirrorlist) while the BaseOS repo, using the same mirrorlist mechanism, succeeded in the same invocation - consistent with a short-lived upstream CDN blip, not an SCT or ScyllaDB defect.
The remoter call for this command had no retry= kwarg, so it defaulted to retry=1, which only retries SSH-transport-level failures, not a non-zero exit from the remote command itself (see sdcm/remote/base.py's RetryMixin._get_retry_params). ~21 equivalent yum call sites in sdcm/cluster.py already pass retry=3/timeout=600 for exactly this class of transient mirror/CDN blip, a documented convention in skills/package-installation/SKILL.md. This PR closes that gap in upgrade_test.py's upgrade/rollback paths.
retry=3 cannot mask a genuinely broken rollback - the retry wrapper re-raises after the final attempt, so a hard failure still fails the test; it only absorbs outages shorter than the retry window (~10s of backoff across 3 attempts) and adds some log noise on a real failure. It does not eliminate SCT-704 recurrence for longer outages.
Scope
Testing
Process
Phases run: plan -> implementer -> reviewer + pragmatist -> implementer (scope-trim revision per review findings). No RCA/reproducer-for-the-flake phase - the underlying event is a non-deterministic upstream mirror outage, not a red/green-reproducible product bug; the fix applies an established, documented repo convention to close a real gap.
Fixes SCT-786
Note
This draft PR was generated by Maia. The root-cause assessment is AI-generated and may be wrong; it requires human review and is never auto-merged.
Testing
🟢 rolling-upgrade-rocky10-test #3
(cherry picked from commit 1b1b530)
(cherry picked from commit 46e442b)
Parent PR: #15610