mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(client): enable Datanode with version 3.3.2 compatible with client 3.4.0
Signed-off-by: leonrayang <chl696@sina.com>
This commit is contained in:
parent
0647717f79
commit
fc71116a51
@ -99,7 +99,7 @@ func NewOverwriteByAppendPacket(dp *wrapper.DataPartition, extentID uint64, exte
|
||||
}
|
||||
|
||||
// NewOverwritePacket returns a new overwrite packet.
|
||||
func NewOverwritePacket(dp *wrapper.DataPartition, extentID uint64, extentOffset int, inode uint64, fileOffset int) *Packet {
|
||||
func NewOverwritePacket(dp *wrapper.DataPartition, extentID uint64, extentOffset int, inode uint64, fileOffset int, isSnap bool) *Packet {
|
||||
p := new(Packet)
|
||||
p.PartitionID = dp.PartitionID
|
||||
p.Magic = proto.ProtoMagic
|
||||
@ -110,7 +110,11 @@ func NewOverwritePacket(dp *wrapper.DataPartition, extentID uint64, extentOffset
|
||||
p.Arg = nil
|
||||
p.ArgLen = 0
|
||||
p.RemainingFollowers = 0
|
||||
p.Opcode = proto.OpRandomWriteVer // proto.OpRandomWrite
|
||||
if isSnap {
|
||||
p.Opcode = proto.OpRandomWriteVer // proto.OpRandomWrite
|
||||
} else {
|
||||
p.Opcode = proto.OpRandomWrite // proto.OpRandomWrite
|
||||
}
|
||||
p.inode = inode
|
||||
p.KernelOffset = uint64(fileOffset)
|
||||
p.Data, _ = proto.Buffers.Get(util.BlockSize)
|
||||
|
||||
@ -622,7 +622,8 @@ func (s *Streamer) doOverwrite(req *ExtentRequest, direct bool) (total int, err
|
||||
sc := NewStreamConn(dp, false, s.client.streamRetryTimeout)
|
||||
|
||||
for total < size {
|
||||
reqPacket := NewOverwritePacket(dp, req.ExtentKey.ExtentId, offset-ekFileOffset+total+ekExtOffset, s.inode, offset)
|
||||
reqPacket := NewOverwritePacket(dp, req.ExtentKey.ExtentId, offset-ekFileOffset+total+ekExtOffset,
|
||||
s.inode, offset, s.client.dataWrapper.IsSnapshotEnabled)
|
||||
if s.client.dataWrapper.IsSnapshotEnabled {
|
||||
reqPacket.VerSeq = s.verSeq
|
||||
reqPacket.VerList = make([]*proto.VolVersionInfo, len(s.client.multiVerMgr.verList.VerList))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user