Skip to content

Commit

Permalink
Merge pull request #746 from cybozu-go/issue-745
Browse files Browse the repository at this point in the history
issue-745: Set timeoutSeconds to 50sec
  • Loading branch information
ymmt2005 authored Oct 7, 2024
2 parents ffb5b0a + 81ab6a5 commit 9e10394
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clustering/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import (
)

const (
switchOverTimeoutSeconds = 70
failOverTimeoutSeconds = 3600
timeoutSeconds = 50
)

var (
Expand Down Expand Up @@ -163,7 +162,7 @@ func (p *managerProcess) switchover(ctx context.Context, ss *StatusSet) error {
return fmt.Errorf("failed to get the primary status: %w", err)
}

err = ss.DBOps[ss.Candidate].WaitForGTID(ctx, pst.GlobalVariables.ExecutedGTID, switchOverTimeoutSeconds)
err = ss.DBOps[ss.Candidate].WaitForGTID(ctx, pst.GlobalVariables.ExecutedGTID, timeoutSeconds)
if err != nil {
return err
}
Expand Down Expand Up @@ -241,7 +240,7 @@ func (p *managerProcess) failover(ctx context.Context, ss *StatusSet) error {

gtid := candidates[candidate].ReplicaStatus.RetrievedGtidSet
log.Info("waiting for the new primary to execute all retrieved transactions", "index", candidate, "gtid", gtid)
err = ss.DBOps[candidate].WaitForGTID(ctx, gtid, failOverTimeoutSeconds)
err = ss.DBOps[candidate].WaitForGTID(ctx, gtid, timeoutSeconds)
if err != nil {
return err
}
Expand Down

0 comments on commit 9e10394

Please sign in to comment.