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
@JNKPercona
Copy link
Collaborator

Test name Status
affinity-8-0 failure
auto-tuning-8-0 failure
cross-site-8-0 failure
custom-users-8-0 failure
demand-backup-cloud-8-0 failure
demand-backup-encrypted-with-tls-8-0 failure
demand-backup-8-0 failure
haproxy-5-7 passed
haproxy-8-0 failure
init-deploy-5-7 passed
init-deploy-8-0 failure
limits-8-0 failure
monitoring-2-0-8-0 failure
one-pod-5-7 passed
one-pod-8-0 failure
pitr-8-0 failure
pitr-gap-errors-8-0 failure
proxy-protocol-8-0 failure
proxysql-sidecar-res-limits-8-0 failure
pvc-resize-5-7 passed
pvc-resize-8-0 failure
recreate-8-0 failure
restore-to-encrypted-cluster-8-0 failure
scaling-proxysql-8-0 failure
scaling-8-0 failure
scheduled-backup-5-7 passed
scheduled-backup-8-0 failure
security-context-8-0 failure
smart-update1-8-0 failure
smart-update2-8-0 failure
storage-8-0 failure
tls-issue-cert-manager-ref-8-0 failure
tls-issue-cert-manager-8-0 failure
tls-issue-self-8-0 failure
upgrade-consistency-8-0 failure
upgrade-haproxy-5-7 failure
upgrade-haproxy-8-0 failure
upgrade-proxysql-5-7 failure
upgrade-proxysql-8-0 failure
users-5-7 failure
users-8-0 failure
validation-hook-8-0 failure
We run 42 out of 42

commit: c638ccd
image: perconalab/percona-xtradb-cluster-operator:PR-1895-c638ccd5

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.

4 participants