moco
moco copied to clipboard
pods are deleted without waiting for completion when switchover takes a long time
Describe the bug If switchover is performed while replication is delayed, the WaitForGTID function will take a long time to execute, during which time it will not be possible to write. https://github.com/cybozu-go/moco/blob/ffb5b0acdecbf805faf669d8c59f67fcac0ec8ad/clustering/operations.go#L166
It is better to make sure that the replication delay is resolved before starting the switchover process.
Also, when DeletionTimestamp is given, pod deletion is executed after the time specified by PreStopSeconds, so a mechanism is needed to prevent pods from being deleted when waiting for switchover processing. https://github.com/cybozu-go/moco/blob/de8e67a80869f92736aa41d064b70b3e55bcc602/pkg/constants/container.go#L62