mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(data): limitIO logic fix. #1000158099
Signed-off-by: zhumingze <zhumingze@oppo.com>
This commit is contained in:
parent
41e6934a4c
commit
33c6e2d96d
@ -660,10 +660,12 @@ func (dp *DataPartition) NormalExtentRepairRead(p repl.PacketInterface, connect
|
||||
} else {
|
||||
opType = OpRead
|
||||
}
|
||||
dp.disk.diskLimit(opType, currReadSize, func() {
|
||||
if rs := dp.disk.diskLimit(opType, currReadSize, func() {
|
||||
crc, err = store.Read(reply.GetExtentID(), offset, int64(currReadSize), reply.GetData(), isRepairRead, p.GetOpcode() == proto.OpBackupRead)
|
||||
reply.SetCRC(crc)
|
||||
})
|
||||
}); err == nil && rs != nil {
|
||||
err = rs
|
||||
}
|
||||
|
||||
if log.EnableDebug() {
|
||||
log.LogDebugf("[NormalExtentRepairRead] reply %v crc %v err %v", reply.GetNoPrefixMsg(), crc, err)
|
||||
|
||||
@ -370,7 +370,7 @@ func (d *Disk) diskLimit(
|
||||
ioType string,
|
||||
operationSize uint32,
|
||||
operationFunc func(),
|
||||
) {
|
||||
) (err error) {
|
||||
flowType, iopsType, allocCheckFunc, limiter, allowHang := d.getLimitIoConfig(ioType)
|
||||
|
||||
if operationSize > 0 {
|
||||
@ -378,9 +378,10 @@ func (d *Disk) diskLimit(
|
||||
}
|
||||
allocCheckFunc(iopsType, 1)
|
||||
|
||||
limiter.Run(int(operationSize), allowHang, func() {
|
||||
err = limiter.Run(int(operationSize), allowHang, func() {
|
||||
operationFunc()
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func (d *Disk) tryDiskLimit(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user