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

ENG-MAINT-11111 #248

Open
wants to merge 1 commit into
base: next-release
Choose a base branch
from
Open

ENG-MAINT-11111 #248

wants to merge 1 commit into from

Conversation

kitherill
Copy link
Collaborator

@kitherill kitherill commented Jan 15, 2025

Addresses https://github.com/trilogy-group/eng-maintenance/issues/11111

This PR fixes the latest MySQL package version evaluation logic that currently yields incorrect value.

@kitherill kitherill marked this pull request as ready for review January 15, 2025 23:23
@@ -1,8 +1,8 @@
lock_major_version = `[ -f "/db/.lock_db_version" ] && grep -E -o '^[0-9]+\.[0-9]+' /db/.lock_db_version `
db_stack = lock_major_version == "" ? attribute["dna"]["engineyard"]["environment"]["db_stack_name"] : "mysql#{lock_major_version.gsub(/\./, '_').strip}"

default["latest_version_57"] = `apt-cache madison percona-server-common-5.7 |awk '{print $3'} | tail -1`.split("-")[0]
default["latest_version_80"] = `apt-cache madison percona-server-common |awk '{print $3'} | tail -1`.split("-")[0]
default["latest_version_57"] = `apt-cache madison percona-server-common-5.7 | sort -V | awk '{print $3'} | tail -1`.split("-")[0]
Copy link
Collaborator Author

@kitherill kitherill Jan 15, 2025

Choose a reason for hiding this comment

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

The command currently used returns the last item from the list of cached versions. The list is sorted in descending order (from newer version to older). The fix enforces the ascending order so that latest version appears on the bottom line.

Below screenshot demonstrates the issue:

Screenshot 2025-01-15 at 14 10 19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant