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

K8SPXC-1222: assign MYSQL_VERSION variable in liveness and readiness #1895

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

eleo007
Copy link
Contributor

@eleo007 eleo007 commented Dec 4, 2024

K8SPXC-1222 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
The liveness-check.sh and readiness-check.sh did not use /var/lib/mysql/mysql.state because MYSQL_VERSION was not set.

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Define MYSQL_VERSION for readiness-check.sh did not use /var/lib/mysql/mysql.state

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PXC version?
  • Does the change support oldest and newest supported Kubernetes version?

@@ -22,8 +22,9 @@
#Timeout exists for instances where mysqld may be hung
TIMEOUT=$((${LIVENESS_CHECK_TIMEOUT:-5} - 1))
MYSQL_STATE=ready
MYSQL_VERSION=$(mysqld -V | awk '{print $3}' | awk -F'.' '{print $1"."$2}')
if [[ ${MYSQL_VERSION} == '8.0' ]]; then
MYSQL_STATE=$(tr -d '\0' < ${MYSQL_STATE_FILE})
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
MYSQL_STATE=$(tr -d '\0' < ${MYSQL_STATE_FILE})
MYSQL_STATE=$(tr -d '\0' <${MYSQL_STATE_FILE})

@@ -17,8 +17,9 @@
AVAILABLE_WHEN_DONOR=${AVAILABLE_WHEN_DONOR:-1}
NODE_IP=$(hostname -I | awk ' { print $1 } ')
MYSQL_STATE=ready
MYSQL_VERSION=$(mysqld -V | awk '{print $3}' | awk -F'.' '{print $1"."$2}')
if [[ ${MYSQL_VERSION} == '8.0' ]]; then
MYSQL_STATE=$(tr -d '\0' < ${MYSQL_STATE_FILE})
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
MYSQL_STATE=$(tr -d '\0' < ${MYSQL_STATE_FILE})
MYSQL_STATE=$(tr -d '\0' <${MYSQL_STATE_FILE})

@eleo007 eleo007 marked this pull request as draft December 4, 2024 17:13
@hors hors added this to the v1.16.0 milestone Dec 5, 2024
@pull-request-size pull-request-size bot added size/S 10-29 lines and removed size/XS 0-9 lines labels Dec 5, 2024
if [[ -n ${NOTIFY_SOCKET} && ${MYSQL_VERSION} =~ ^(8\.0|8\.4)$ ]]; then
export NOTIFY_SOCKET=${MYSQL_NOTIFY_SOCKET}
nohup /var/lib/mysql/mysql-state-monitor >/var/lib/mysql/mysql-state-monitor.log 2>&1 < /dev/null &
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
nohup /var/lib/mysql/mysql-state-monitor >/var/lib/mysql/mysql-state-monitor.log 2>&1 < /dev/null &
nohup /var/lib/mysql/mysql-state-monitor >/var/lib/mysql/mysql-state-monitor.log 2>&1 </dev/null &

@pull-request-size pull-request-size bot added size/XS 0-9 lines and removed size/S 10-29 lines labels Dec 5, 2024
@pull-request-size pull-request-size bot added size/L 100-499 lines and removed size/XS 0-9 lines labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L 100-499 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants