Skip to content
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
24 changes: 18 additions & 6 deletions scripts/rpm-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,25 @@ if [[ $package_version == "$old_version" ]]; then
exit
fi

# //TEMP upgrade does not work without this but why? Can't we fix it?
if [[ "$test_type" =~ ^(major|distro)$ ]]; then
bb_log_info "remove old packages for major upgrade"
packages_to_remove=$(rpm -qa | grep -E '^(MariaDB|mariadb)-' | awk -F'-' '{print $1"-"$2}')
echo "$packages_to_remove" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" remove
rpm -qa | grep -iE 'maria|mysql' || true
# ------------------------------------------------------------------------------
# -- MDBF-1121 / MDEV-33459 --
# ------------------------------------------------------------------------------

# Major upgrades within the same family (>10) and vendor (!=distro)
# should work without removing old packages first.

old_family=$(echo "$prev_major_version" | sed -n -e 's,^\([1-9][0-9]*\)\..*$,\1,p')
new_family=$(echo "$major_version" | sed -n -e 's,^\([1-9][0-9]*\)\..*$,\1,p')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is extracting before the .?

so ${prev_major_version%%.*} is the same right?

@RazvanLiviuVarzaru RazvanLiviuVarzaru Sep 15, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I used the same rule as in MDEV-33459 commit.
That happens to match the number before ..

if [[ "$test_type" == "distro" ||
( "$old_family" -lt 11 && "$test_type" != "minor" ) ||
"$old_family" -ne "$new_family" ]]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is MDEV-9584 so it might be that the server upgrade needs to allow 11 -> 12 without removal first.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested 11 -> 12. It does not work.
Have a look at: https://github.com/MariaDB/server/blob/main/support-files/rpm/server-prein.sh

@RazvanLiviuVarzaru RazvanLiviuVarzaru Sep 15, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case, the scope of this MDBF is to align the two buildbots.
Further scenarios are welcome and to be treated separately.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - the prein.sh is the bit of dated stuff that probably should be removed. as separate task.

bb_log_info "remove old packages for major upgrade"
packages_to_remove=$(rpm -qa | grep -E '^(MariaDB|mariadb)-' | awk -F'-' '{print $1"-"$2}')
echo "$packages_to_remove" | xargs sudo "$pkg_cmd" "$pkg_cmd_options" remove
rpm -qa | grep -iE 'maria|mysql' || true
fi
# ------------------------------------------------------------------------------

rpm_setup_bb_galera_artifacts_mirror
rpm_setup_bb_artifacts_mirror
Expand Down