mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix bug when packet opCode=OpExtentRepairRead and network is unstable
Signed-off-by: mingwei <gongwilliam@163.com>
This commit is contained in:
parent
0450464705
commit
764d1e496d
@ -534,7 +534,7 @@ func (dp *DataPartition) streamRepairExtent(remoteExtentInfo *storage.ExtentInfo
|
||||
|
||||
if reply.ResultCode != proto.OpOk {
|
||||
err = errors.Trace(fmt.Errorf("unknow result code"),
|
||||
"streamRepairExtent receive opcode error(%v) ,localExtentSize(%v) remoteExtentSize(%v)", string(reply.Data[:reply.Size]), currFixOffset, remoteExtentInfo.Size)
|
||||
"streamRepairExtent receive opcode error(%v) ,localExtentSize(%v) remoteExtentSize(%v)", string(reply.Data[:intMin(len(reply.Data), int(reply.Size))]), currFixOffset, remoteExtentInfo.Size)
|
||||
return
|
||||
}
|
||||
|
||||
@ -602,3 +602,11 @@ func (dp *DataPartition) streamRepairExtent(remoteExtentInfo *storage.ExtentInfo
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
func intMin(a, b int) int {
|
||||
if a < b {
|
||||
return a
|
||||
} else {
|
||||
return b
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user