mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
refactor(client): hybrid cloud print warn log when OpMetaExtentsList returns proto.OpMismatchStorageClass
#22004328 Signed-off-by: true1064 <tangjingyu@oppo.com>
This commit is contained in:
parent
57c8f26829
commit
cc025affe3
@ -486,8 +486,8 @@ func (mp *metaPartition) ExtentsList(req *proto.GetExtentsRequest, p *Packet) (e
|
||||
if !(ino.HybridCouldExtentsMigration.storageClass == proto.StorageClass_Unspecified &&
|
||||
ino.HybridCouldExtentsMigration.sortedEks == nil) {
|
||||
status = proto.OpErr
|
||||
reply = []byte(fmt.Sprintf("ino %v storage type %v not migrate to replica system",
|
||||
ino.Inode, ino.HybridCouldExtentsMigration.storageClass))
|
||||
reply = []byte(fmt.Sprintf("ino(%v) storageClass(%v) not migrate to replica system",
|
||||
ino.Inode, proto.StorageClassString(ino.HybridCouldExtentsMigration.storageClass)))
|
||||
p.PacketErrorWithBody(status, reply)
|
||||
return
|
||||
}
|
||||
|
||||
@ -1315,7 +1315,7 @@ func (mw *MetaWrapper) getExtents(mp *MetaPartition, inode uint64, isCache bool,
|
||||
defer func() {
|
||||
metric.SetWithLabels(err, map[string]string{exporter.Vol: mw.volname})
|
||||
}()
|
||||
// TODO:chi delete this line when the bug fixed
|
||||
// TODO:chi,tangjingyu: delete this line when the bug fixed
|
||||
log.LogDebugf("getExtents req: id(%v) data(%v) stack[%v]", packet.GetReqID(), req, string(debug.Stack()))
|
||||
|
||||
packet, err = mw.sendToMetaPartition(mp, packet)
|
||||
@ -1327,7 +1327,12 @@ func (mw *MetaWrapper) getExtents(mp *MetaPartition, inode uint64, isCache bool,
|
||||
resp.Status = parseStatus(packet.ResultCode)
|
||||
if resp.Status != statusOK {
|
||||
err = errors.New(packet.GetResultMsg())
|
||||
log.LogErrorf("getExtents: packet(%v) mp(%v) result(%v)", packet, mp, packet.GetResultMsg())
|
||||
msg := fmt.Sprintf("getExtents: packet(%v) mp(%v) result(%v)", packet, mp, packet.GetResultMsg())
|
||||
if packet.ResultCode == proto.OpMismatchStorageClass {
|
||||
log.LogWarnf(msg)
|
||||
} else {
|
||||
log.LogError(msg)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user