From f90408be4d6197ecee3eb5416db3b42fdb23d80c Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 29 Mar 2022 15:22:27 +0530 Subject: [PATCH] rbd: increase force promote timeout to 2 minutes Increase the timeout to 2 minutes to give enough time for rollback to complete. As rollback is performed by the force-promote command it, at times, may take more than a minute (based on dirty blocks that need to be rolled back approximately) to rollback. The added extra 1 minute is useful though to avoid multiple calls to complete the rollback and in extremely corner cases to avoid failures in the first instance of the call when the mirror watcher is not yet removed (post scaling down the RBD mirror instance) Signed-off-by: Madhu Rajanna --- internal/rbd/mirror.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/rbd/mirror.go b/internal/rbd/mirror.go index 504268a12..08a5e52b8 100644 --- a/internal/rbd/mirror.go +++ b/internal/rbd/mirror.go @@ -88,8 +88,8 @@ func (ri *rbdImage) promoteImage(force bool) error { return nil } -// forcePromoteImage promotes image to primary with force option with 1 minute -// timeout. If there is no response within 1 minute,the rbd CLI process will be +// forcePromoteImage promotes image to primary with force option with 2 minutes +// timeout. If there is no response within 2 minutes,the rbd CLI process will be // killed and an error is returned. func (rv *rbdVolume) forcePromoteImage(cr *util.Credentials) error { promoteArgs := []string{ @@ -102,7 +102,8 @@ func (rv *rbdVolume) forcePromoteImage(cr *util.Credentials) error { } _, stderr, err := util.ExecCommandWithTimeout( context.TODO(), - time.Minute, + // 2 minutes timeout as the Replication RPC timeout is 2.5 minutes. + 2*time.Minute, "rbd", promoteArgs..., )