-
Notifications
You must be signed in to change notification settings - Fork 189
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
base: main
Are you sure you want to change the base?
Conversation
@@ -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}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
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}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
MYSQL_STATE=$(tr -d '\0' < ${MYSQL_STATE_FILE}) | |
MYSQL_STATE=$(tr -d '\0' <${MYSQL_STATE_FILE}) |
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 & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shfmt] reported by reviewdog 🐶
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 & |
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
Needs Doc
) and QA (Needs QA
)?Tests
compare/*-oc.yml
)?Config/Logging/Testability