Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cdc rolling upgrade remove status check to prevent false detection. #1996

Merged
merged 2 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/cluster/api/cdcapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
12 changes: 1 addition & 11 deletions pkg/cluster/spec/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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))
Expand Down