mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(metanode): hybrid cloud assign migration hdd ek in UpdateExtentKeyAfterMigration
Signed-off-by: chihe <chihe@oppo.com>
This commit is contained in:
parent
4c73097a3d
commit
a2c2d4a704
@ -1059,7 +1059,8 @@ func (mp *metaPartition) RenewalForbiddenMigration(req *proto.RenewalForbiddenMi
|
||||
func (mp *metaPartition) UpdateExtentKeyAfterMigration(req *proto.UpdateExtentKeyAfterMigrationRequest, p *Packet,
|
||||
remoteAddr string) (err error) {
|
||||
ino := NewInode(req.Inode, 0)
|
||||
if item := mp.inodeTree.Get(ino); item == nil {
|
||||
var item BtreeItem
|
||||
if item = mp.inodeTree.Get(ino); item == nil {
|
||||
err = fmt.Errorf("mp %v inode %v reqeust cann't found", mp.config.PartitionId, ino.Inode)
|
||||
log.LogErrorf("action[UpdateExtentKeyAfterMigration] %v", err)
|
||||
p.PacketErrorWithBody(proto.OpNotExistErr, []byte(err.Error()))
|
||||
@ -1094,8 +1095,13 @@ func (mp *metaPartition) UpdateExtentKeyAfterMigration(req *proto.UpdateExtentKe
|
||||
if req.StorageClass == proto.StorageClass_BlobStore {
|
||||
ino.HybridCouldExtentsMigration.sortedEks = NewSortedObjExtentsFromObjEks(req.NewObjExtentKeys)
|
||||
} else if req.StorageClass == proto.MediaType_HDD {
|
||||
//do nothing, ek has been stored in ino.HybridCouldExtentsMigration before UpdateExtentKeyAfterMigration
|
||||
//is called
|
||||
if item.(*Inode).HybridCouldExtentsMigration.storageClass != proto.MediaType_HDD {
|
||||
err = fmt.Errorf("mp %v inode %v migration class now is %v",
|
||||
mp.config.PartitionId, ino.Inode, item.(*Inode).HybridCouldExtentsMigration.storageClass)
|
||||
log.LogErrorf("action[UpdateExtentKeyAfterMigration] %v", err)
|
||||
p.PacketErrorWithBody(proto.OpErr, []byte(err.Error()))
|
||||
}
|
||||
ino.HybridCouldExtentsMigration.sortedEks = item.(*Inode).HybridCouldExtentsMigration.sortedEks
|
||||
} else {
|
||||
err = fmt.Errorf("mp %v inode %v unsupport new migration storage class %v",
|
||||
mp.config.PartitionId, ino.Inode, req.StorageClass)
|
||||
|
||||
@ -41,7 +41,7 @@ func OpTypeToStorageType(op string) uint32 {
|
||||
case OpTypeStorageClassEBS:
|
||||
return StorageClass_BlobStore
|
||||
}
|
||||
return 0
|
||||
return StorageClass_Unspecified
|
||||
}
|
||||
|
||||
type LcConfiguration struct {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user