-
Notifications
You must be signed in to change notification settings - Fork 773
bugfix: the dfget will always receive fail result when change supernode #752
Conversation
We found this is your first time to contribute to Dragonfly, @wybzju |
Codecov Report
@@ Coverage Diff @@
## master #752 +/- ##
==========================================
- Coverage 46.55% 46.53% -0.02%
==========================================
Files 113 113
Lines 6352 6354 +2
==========================================
Hits 2957 2957
- Misses 3156 3158 +2
Partials 239 239
Continue to review full report at Codecov.
|
could you put the error in github |
#682 does the error is the same as the second bug in this pr |
supernode/server/0.3_bridge.go
Outdated
@@ -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("srcCID:%s, failed to get dfget task by dstCID(%s) and taskID(%s), err: %v", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please output the log as the following format: logrus.Warnf("failed to ........")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it may be better
if err!=nil{
logrus.Warnf("failed to ......")
return err
}
request.DstPID=.....
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the end,I want you to show me the detail error log.I recently work on this part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@yunfeiyangbuaa It is not the same with #682. In this pr, if the pr #682 is merged. when supernode down, dfget will register to another supernode. However, anther supernode don't have the dst dfgettask, it will return date not found err. The dfget will receive error again |
I get what do you mean,so it means the multiple supernodes pattern can't work in fact? |
@yunfeiyangbuaa yes, you are right, but it can be fixed.
then the dfget will always receive the data not found error until try all supernode 1 some dfclients start to pull images |
Thanks! |
@yunfeiyangbuaa what's more, you need to fix the panic problem first. Or you won't see above error, because the dfget will panic and not register to another supernode |
I have make the res be nil.but I think the team should do more with the multiple supernodes pattern.because dfget can register to another supernode but can't download file in fact.I and you just do with the err.WDYT? @lowzj |
@@ -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", |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 😄
LGTM. |
Signed-off-by: wybzju <[email protected]>
bugfix: the dfget will always receive fail result when change supernode
bugfix: the dfget will always receive fail result when change supernode
Signed-off-by: Jim Ma <[email protected]>
Signed-off-by: wybzju [email protected]
Ⅰ. Describe what this PR did
1 there have two supernode A and B
2 dfget registers to A and download some piece from A
3 suddenly, the A down
4 dfget will get error when pull piece task from A, then dfget register to node B
5 it will pull piece task again, but the item has dstCID. However, B doesn't have the task, and can't get dfgettask by dstCID and taskID. Then B will return err. Finally, dfget will receive error again
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews