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

pump: getSafeGCTSOForDrainers should be usable after Close #617

Merged
merged 1 commit into from May 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions pump/server.go
Expand Up @@ -500,7 +500,7 @@ func (s *Server) gcBinlogFile() {
continue
}

safeTSO, err := s.getSafeGCTSOForDrainers()
safeTSO, err := s.getSafeGCTSOForDrainers(s.ctx)
if err != nil {
log.Warn("get save gc tso for drainers failed", zap.Error(err))
continue
Expand All @@ -518,10 +518,10 @@ func (s *Server) gcBinlogFile() {
}
}

func (s *Server) getSafeGCTSOForDrainers() (int64, error) {
func (s *Server) getSafeGCTSOForDrainers(ctx context.Context) (int64, error) {
pumpNode := s.node.(*pumpNode)

drainers, err := pumpNode.Nodes(s.ctx, "drainers")
drainers, err := pumpNode.Nodes(ctx, "drainers")
if err != nil {
return 0, errors.Trace(err)
}
Expand Down Expand Up @@ -702,7 +702,7 @@ func (s *Server) waitSafeToOffline(ctx context.Context) error {
for {
select {
case <-time.After(time.Second):
safeTSO, err := s.getSafeGCTSOForDrainers()
safeTSO, err := s.getSafeGCTSOForDrainers(ctx)
if err != nil {
log.Error("Failed to get safe GCTS", zap.Error(err))
break
Expand Down