mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(sdk): check whether StorageClass allowed when remoteCacheAutoPrepare is opened.
. #1000083859 Signed-off-by: baihailong <baihailong@oppo.com>
This commit is contained in:
parent
a1fe50c7be
commit
dea4a5ecb6
@ -612,13 +612,22 @@ func (eh *ExtentHandler) appendExtentKey() (err error) {
|
||||
}
|
||||
|
||||
if eh.key.PartitionId > 0 && eh.stream.enableRemoteCacheAutoPrepare() {
|
||||
prepareReq := &PrepareRemoteCacheRequest{
|
||||
ctx: context.Background(),
|
||||
ek: eh.key,
|
||||
inode: eh.stream.inode,
|
||||
inodeInfo, err := eh.stream.client.getInodeInfo(eh.inode)
|
||||
if err != nil {
|
||||
log.LogErrorf("appendExtentKey: getInodeInfo failed. ino(%v) eh(%v) err(%v)", eh.inode, eh, err)
|
||||
return err
|
||||
}
|
||||
|
||||
enableRemoteCacheStorageClass := !eh.stream.client.RemoteCache.remoteCacheOnlyForNotSSD ||
|
||||
(eh.stream.client.RemoteCache.remoteCacheOnlyForNotSSD && inodeInfo.StorageClass != proto.StorageClass_Replica_SSD)
|
||||
if enableRemoteCacheStorageClass {
|
||||
prepareReq := &PrepareRemoteCacheRequest{
|
||||
ctx: context.Background(),
|
||||
ek: eh.key,
|
||||
inode: eh.stream.inode,
|
||||
}
|
||||
eh.stream.sendToPrepareRomoteCacheChan(prepareReq)
|
||||
}
|
||||
eh.stream.sendToPrepareRomoteCacheChan(prepareReq)
|
||||
// eh.stream.prepareRemoteCache(ctx, ek)
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user