Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

bugfix: the dfget will always receive fail result when change supernode #752

Merged
merged 1 commit into from
Aug 1, 2019
Merged
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
6 changes: 4 additions & 2 deletions supernode/server/0.3_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ func (s *Server) pullPieceTask(ctx context.Context, rw http.ResponseWriter, req
if !cutil.IsEmptyStr(dstCID) {
dstDfgetTask, err := s.DfgetTaskMgr.Get(ctx, dstCID, taskID)
if err != nil {
return err
logrus.Warnf("failed to get dfget task by dstCID(%s) and taskID(%s), and the srcCID is %s, err: %v",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not a good idea to ignore the error here. Instead, maybe we can delete the dstCID after migrate for dfget.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think so. Here, dstCID is used to obtain the corresponding peerID, and then the state of the corresponding peerID is updated. If there is no corresponding dfgetTask at suopernode, then there is no need to update the state of the peerID. So you can continue to execute.
Of course, dfget can delete the dstCID and what's more, it need to delete dstCID for all items which are stored in the queue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I agree with you. And I think we should speed ​​up the progress of HA. @yunfeiyangbuaa 😄

dstCID, taskID, srcCID, err)
} else {
request.DstPID = dstDfgetTask.PeerID
}
request.DstPID = dstDfgetTask.PeerID
}

isFinished, data, err := s.TaskMgr.GetPieces(ctx, taskID, srcCID, request)
Expand Down