mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
refactor(meta): hybrid cloud optimize some error logging
Signed-off-by: true1064 <tangjingyu@oppo.com>
This commit is contained in:
parent
744b001d5c
commit
e05a7c063e
@ -221,7 +221,7 @@ func (mp *metaPartition) deleteWorker() {
|
||||
for _, delayDeleteIno := range delayDeleteInos {
|
||||
mp.freeList.Push(delayDeleteIno)
|
||||
}
|
||||
log.LogDebugf("[deleteWorker] metaPartition[%v] inodes[%v]", mp.config.PartitionId, buffSlice)
|
||||
log.LogDebugf("[deleteWorker] metaPartition[%v] to delete inodes:[%v]", mp.config.PartitionId, buffSlice)
|
||||
|
||||
mp.persistDeletedInodes(buffSlice)
|
||||
mp.deleteMarkedInodes(buffSlice)
|
||||
|
||||
@ -182,12 +182,22 @@ func (mp *metaPartition) getInode(ino *Inode, listAll bool) (resp *InodeResponse
|
||||
resp.Status = proto.OpOk
|
||||
|
||||
i := mp.getInodeByVer(ino)
|
||||
if i == nil || (!listAll && i.ShouldDelete()) {
|
||||
log.LogDebugf("action[getInode] ino %v not found", ino)
|
||||
if i == nil {
|
||||
log.LogDebugf("action[getInode] mp(%v) ino(%v) not found", mp.config.PartitionId, ino.Inode)
|
||||
resp.Status = proto.OpNotExistErr
|
||||
return
|
||||
}
|
||||
// ctime := Now.GetCurrentTimeUnix()
|
||||
|
||||
if i.ShouldDelete() {
|
||||
log.LogDebugf("action[getInode] mp(%v) ino(%v): shouldDelete(true) listAll(%v)",
|
||||
mp.config.PartitionId, ino.Inode, listAll)
|
||||
if listAll == false {
|
||||
resp.Status = proto.OpNotExistErr
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// ctime := timeutil.GetCurrentTimeUnix()
|
||||
/*
|
||||
* FIXME: not protected by lock yet, since nothing is depending on atime.
|
||||
* Shall add inode lock in the future.
|
||||
|
||||
@ -429,11 +429,12 @@ func (mp *metaPartition) GetUidInfo() (info []*proto.UidReportSpaceInfo) {
|
||||
func (mp *metaPartition) ExtentsList(req *proto.GetExtentsRequest, p *Packet) (err error) {
|
||||
log.LogDebugf("action[ExtentsList] inode[%v] verseq [%v]", req.Inode, req.VerSeq)
|
||||
|
||||
// note:don't need m dset reqSeq, extents get be done in next step
|
||||
// note:don't need set reqSeq, extents get be done in next step
|
||||
ino := NewInode(req.Inode, 0)
|
||||
retMsg := mp.getInodeTopLayer(ino)
|
||||
if retMsg.Status != proto.OpOk || retMsg.Msg == nil {
|
||||
err = fmt.Errorf("mpId(%v) inode(%v) not found", mp.config.PartitionId, req.Inode)
|
||||
p.PacketErrorWithBody(retMsg.Status, []byte(err.Error()))
|
||||
log.LogErrorf("[ExtentsList] %v", err.Error())
|
||||
return
|
||||
}
|
||||
@ -447,9 +448,9 @@ func (mp *metaPartition) ExtentsList(req *proto.GetExtentsRequest, p *Packet) (e
|
||||
|
||||
if !proto.IsStorageClassReplica(ino.StorageClass) && (req.IsCache != true && req.IsMigration != true) {
|
||||
status = proto.OpMismatchStorageClass
|
||||
reply = []byte(fmt.Sprintf("ino(%v) storageClass(%v) IsCache(%v) IsMigration(%v) do not support ExtentsList",
|
||||
ino.Inode, ino.StorageClass, req.IsCache, req.IsMigration))
|
||||
p.PacketErrorWithBody(status, reply)
|
||||
err = fmt.Errorf("ino(%v) storageClass(%v) IsCache(%v) IsMigration(%v) do not support ExtentsList",
|
||||
ino.Inode, ino.StorageClass, req.IsCache, req.IsMigration)
|
||||
p.PacketErrorWithBody(status, []byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -1291,7 +1291,7 @@ func (mp *metaPartition) InodeGetWithEk(req *InodeGetReq, p *Packet) (err error)
|
||||
status = proto.OpOk
|
||||
if getAllVerInfo {
|
||||
inode := mp.getInodeTopLayer(ino)
|
||||
log.LogDebugf("req ino %v, toplayer ino %v", retMsg.Msg, inode)
|
||||
log.LogDebugf("[InodeGetWithEk] req ino %v, topLayer ino %v", retMsg.Msg, inode)
|
||||
resp.LayAll = inode.Msg.getAllInodesInfo()
|
||||
}
|
||||
// get cache ek
|
||||
|
||||
@ -653,6 +653,8 @@ func (p *Packet) GetOpMsg() (m string) {
|
||||
m = "OpBatchUnlockNormalExtent"
|
||||
case OpMetaUpdateExtentKeyAfterMigration:
|
||||
m = "OpMetaUpdateExtentKeyAfterMigration"
|
||||
case OpDeleteMigrationExtentKey:
|
||||
m = "OpDeleteMigrationExtentKey"
|
||||
default:
|
||||
m = fmt.Sprintf("op:%v not found", p.Opcode)
|
||||
}
|
||||
|
||||
@ -1619,13 +1619,8 @@ func (mw *MetaWrapper) AppendObjExtentKeys(inode uint64, eks []proto.ObjExtentKe
|
||||
return nil
|
||||
}
|
||||
|
||||
func (mw *MetaWrapper) GetExtents(inode uint64, isCache, openForWrite, isMigration bool) (gen uint64, size uint64, extents []proto.ExtentKey, err error) {
|
||||
//mediaType := mw.GetStorageClass()
|
||||
//if mediaType != proto.MediaType_SSD && mediaType != proto.MediaType_HDD {
|
||||
// return 0, 0, nil, errors.New(fmt.Sprintf("Current media type %v do not support GetExtents",
|
||||
// mw.DefaultStorageClass))
|
||||
//}
|
||||
|
||||
func (mw *MetaWrapper) GetExtents(inode uint64, isCache, openForWrite,
|
||||
isMigration bool) (gen uint64, size uint64, extents []proto.ExtentKey, err error) {
|
||||
mp := mw.getPartitionByInode(inode)
|
||||
if mp == nil {
|
||||
return 0, 0, nil, syscall.ENOENT
|
||||
|
||||
Loading…
Reference in New Issue
Block a user