fix(data): limitIO ​​logic fix. #1000158099

Signed-off-by: zhumingze <zhumingze@oppo.com>
This commit is contained in:
zhumingze 2025-06-18 17:51:21 +08:00 committed by zhumingze1108
parent 41e6934a4c
commit 33c6e2d96d
2 changed files with 7 additions and 4 deletions

View File

@ -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)

View File

@ -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(