From 81ab6a51033c7fe66409ddb28f7583d5e25c4b1a Mon Sep 17 00:00:00 2001 From: shunki-fujita Date: Fri, 4 Oct 2024 08:57:04 +0000 Subject: [PATCH] issue-745: Set timeoutSeconds to 50sec --- clustering/operations.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clustering/operations.go b/clustering/operations.go index 630c9274..6a4887ec 100644 --- a/clustering/operations.go +++ b/clustering/operations.go @@ -19,8 +19,7 @@ import ( ) const ( - switchOverTimeoutSeconds = 70 - failOverTimeoutSeconds = 3600 + timeoutSeconds = 50 ) var ( @@ -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 } @@ -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 }