-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fix retry message when gathering mysqld status #559
Conversation
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
clustering/status.go
Outdated
logFromContext(ctx).Error(err, "failed to get mysqld status") | ||
time.Sleep(statusCheckRetryInterval) | ||
continue | ||
if j == statusCheckRetryMax { | ||
logFromContext(ctx).Error(err, "failed to get mysqld status, mysqld is not ready") | ||
return | ||
} else { | ||
logFromContext(ctx).Error(err, "failed to get mysqld status, will retry") | ||
time.Sleep(statusCheckRetryInterval) | ||
continue | ||
} |
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.
Since we have the following lines after for
loop,
ss.MySQLStatus[index] = ist
return
I think it's more readable to change the code like:
if err == dbop.ErrNop {
return
}
if err == nil {
ss.MySQLStatus[index] = ist
return
}
// process errors
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.
Thank you. I was wondering how to write.
I will use the style you suggested.
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
Co-authored-by: Yamamoto, Hirotaka <ymmt2005@gmail.com>
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.
LGTM
Signed-off-by: Masayuki Ishii <masa213f@gmail.com>
This reverts commit 40d0144.
This PR fixes the retry message when gathering mysqld status.
The current error message is confusing whether it's in retrying or MySQL is finally treated as Not-Ready.
Signed-off-by: Masayuki Ishii masa213f@gmail.com