Skip to content

Commit

Permalink
issue-745: Set timeoutSeconds to 50sec
Browse files Browse the repository at this point in the history
  • Loading branch information
shunki-fujita committed Oct 4, 2024
1 parent ffb5b0a commit 81ab6a5
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 81ab6a5

Please sign in to comment.