Skip to content

Commit

Permalink
update: qos cache2 path effect means limit alreay happend and not cal…
Browse files Browse the repository at this point in the history
…c again for read blobstore

Signed-off-by: leonrayang <[email protected]>
  • Loading branch information
leonrayang committed Aug 10, 2022
1 parent 86b629d commit 0cbc586
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sdk/data/blobstore/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,14 @@ func (reader *Reader) readSliceRange(ctx context.Context, rs *rwSlice) (err erro
}
}

readLimitOn := false
//read cfs and cache to bcache
if rs.extentKey != (proto.ExtentKey{}) {
//check if dp is exist in preload sence
if err = reader.ec.CheckDataPartitionExsit(rs.extentKey.PartitionId); err == nil {
readLimitOn = true
readN, err = reader.ec.ReadExtent(reader.ino, &rs.extentKey, buf, int(rs.rOffset), int(rs.rSize))
if err == nil && readN == int(rs.rSize) {

// L2 cache hit.
metric := exporter.NewTPCnt("L2CacheGetHit")
stat.EndStat("CacheHit-L2", nil, bgTime, 1)
Expand All @@ -333,8 +334,10 @@ func (reader *Reader) readSliceRange(ctx context.Context, rs *rwSlice) (err erro
}
log.LogDebugf("TRACE blobStore readSliceRange. cfs block miss.extentKey=%v,err=%v", rs.extentKey, err)
}
if !readLimitOn {
reader.limitManager.ReadAlloc(ctx, int(rs.rSize))
}

reader.limitManager.ReadAlloc(ctx, int(rs.rSize))
readN, err = reader.ebs.Read(ctx, reader.volName, buf, rs.rOffset, uint64(rs.rSize), rs.objExtentKey)
if err != nil {
reader.err <- err
Expand Down

0 comments on commit 0cbc586

Please sign in to comment.