Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit fca0915

Browse files
gianlucaborelloowainlewis
authored andcommitted
Fix restarting the entire cluster when volumes are persisted. (#157)
1 parent d9b3b4f commit fca0915

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

pkg/util/mysqlsh/mysqlsh.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,24 @@ func (r *runner) run(ctx context.Context, python string) ([]byte, error) {
197197
}
198198

199199
func (r *runner) RebootClusterFromCompleteOutage(ctx context.Context) error {
200-
python := fmt.Sprintf("dba.reboot_cluster_from_complete_outage('%s')", innodb.DefaultClusterName)
200+
// Reset the seed list. This is needed if the cluster is going
201+
// through a full restart and the pods are being created in order,
202+
// because the StatefulSet will not create the service names
203+
// pointing to the other pods until the previous pods are fully up.
204+
// This causes MySQL to fail initializing the group replication
205+
// plugin because it assumes that all the peer names must be valid
206+
// hostnames and, even if they are not reachable from a
207+
// connectivity point of view, they still must resolve to a valid
208+
// IP address, which is not the case considering the StatefulSet
209+
// behavior.
210+
python := fmt.Sprintf("session.query('SET GLOBAL group_replication_group_seeds = \"\"')")
201211
_, err := r.run(ctx, python)
212+
if err != nil {
213+
return err
214+
}
215+
216+
python = fmt.Sprintf("dba.reboot_cluster_from_complete_outage('%s')", innodb.DefaultClusterName)
217+
_, err = r.run(ctx, python)
202218
return err
203219
}
204220

0 commit comments

Comments
 (0)