cybozu-go / moco

MySQL operator on Kubernetes using GTID-based semi-synchronous replication.

Home Page:https://cybozu-go.github.io/moco/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Long wait for SetReadOnly to complete

shunki-fujita opened this issue · comments

Describe the bug
SetReadOnly waits for a running DML.
Therefore, if it waits for a long time, deleteGracePeriodSeconds may be reached.

if err := pdb.SetReadOnly(ctx, true); err != nil {
return fmt.Errorf("failed to make instance %d read-only: %w", ss.Primary, err)
}

Expected behavior
If SetReadOnly does not complete in a short time, give up and run KillConnections.

The problem is that the switching is not completed within the PreStopSeconds time.
Solution will be considered separately.