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

Dynamically Adjusting MySQL StatefulSet Partition to Control MySQL Pod Update Timing #622

Closed
4 tasks done
d-kuro opened this issue Dec 5, 2023 · 0 comments
Closed
4 tasks done
Assignees

Comments

@d-kuro
Copy link
Collaborator

d-kuro commented Dec 5, 2023

What

This issue aims to address the situation of adjusting the update timing of MySQL pods by dynamically changing the partition of MySQL StatefulSet.

In the past, we encountered an issue where the MySQLCluster became unhealhty due to node failure resulting in a non-functional MySQL Pod. During this unhealthy state, an update to the MySQLCluster triggered a rolling update of the StatefulSet. The cluster became unavailable, as two MySQL Pods were down simultaneously due to the failure and update.

Even though PDB was set, the cluster state or existing pod status are not considered during a StatefulSet update. Therefore, the MySQL pod was updated despite the cluster being unhealthy.

How

We plan to dynamically adjust the partition of MySQL StatefulSet to modify the MySQL pod update timing.

The implementation steps are as follows:

  • Add a reconciler to update the partition of MySQL StatefulSet.
  • In general, set the partition to 99 (a value greater than the replicas that can be set by MOCO, it need not be 99).
  • If there is an update to the podTemplate of the sts (currentRevision != updateRevision), look at the Ready state of MySQL Pods, decrease the partition, and update one MySQL Pod at a time.
  • If there is a non-Ready MySQL Pod, do not decrease the partition and stop the sts update. We want this behavior equivalent to PDB + Eviction API.
  • Aside from these, there are more detailed specifications that need to be considered.

Please note that this feature will be disabled from the initial MySQLCluster deployment until it first becomes Healthy.

Checklist

  • Finish implementation of the issue
  • Test all functions
  • Have enough logs to trace activities
  • Notify developers of necessary actions
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

No branches or pull requests

2 participants