diff --git a/pkg/cluster/api/cdcapi.go b/pkg/cluster/api/cdcapi.go index a57b4470ca..c5c2f8ede6 100644 --- a/pkg/cluster/api/cdcapi.go +++ b/pkg/cluster/api/cdcapi.go @@ -195,7 +195,7 @@ func (c *CDCOpenAPIClient) GetAllCaptures() (result []*Capture, err error) { } return nil }, utils.RetryOption{ - Timeout: 20 * time.Second, + Timeout: 10 * time.Second, }) return result, err } @@ -260,7 +260,7 @@ func (c *CDCOpenAPIClient) GetStatus() (result ServerStatus, err error) { } return nil }, utils.RetryOption{ - Timeout: 20 * time.Second, + Timeout: 10 * time.Second, }) return result, err diff --git a/pkg/cluster/spec/cdc.go b/pkg/cluster/spec/cdc.go index 4ed7bacbb5..71750d232a 100644 --- a/pkg/cluster/spec/cdc.go +++ b/pkg/cluster/spec/cdc.go @@ -237,16 +237,11 @@ func (i *CDCInstance) PreRestart(ctx context.Context, topo Topology, apiTimeoutS return nil } - if i.Status(ctx, 5*time.Second, tlsCfg) == "Down" { - logger.Debugf("cdc pre-restart skipped, instance is down, trigger hard restart, addr: %s", address) - return nil - } - start := time.Now() client := api.NewCDCOpenAPIClient(ctx, []string{address}, 5*time.Second, tlsCfg) captures, err := client.GetAllCaptures() if err != nil { - logger.Warnf("cdc pre-restart failed, cannot get all captures, trigger hard restart, addr: %s, elapsed: %+v", address, time.Since(start)) + logger.Warnf("cdc pre-restart skipped, cannot get all captures, trigger hard restart, addr: %s, elapsed: %+v", address, time.Since(start)) return nil } @@ -306,13 +301,8 @@ func (i *CDCInstance) PostRestart(ctx context.Context, topo Topology, tlsCfg *tl start := time.Now() address := i.GetAddr() - if i.Status(ctx, 5*time.Second, tlsCfg) == "Down" { - logger.Debugf("cdc post-restart skipped, instance is down, addr: %s, elapsed: %+v", address, time.Since(start)) - return nil - } client := api.NewCDCOpenAPIClient(ctx, []string{address}, 5*time.Second, tlsCfg) - err := client.IsCaptureAlive() if err != nil { logger.Debugf("cdc post-restart finished, get capture status failed, addr: %s, err: %+v, elapsed: %+v", address, err, time.Since(start))