[Enhancement] Optimize the qos for random write

Signed-off-by: Tao Li <tomscut@apache.org>
This commit is contained in:
Tao Li 2022-11-22 20:34:22 +08:00 committed by leonrayang
parent 72610e307c
commit bf8aa1640f
2 changed files with 1 additions and 4 deletions

View File

@ -238,9 +238,6 @@ func (dp *DataPartition) ApplyRandomWrite(command []byte, raftApplyID uint64) (r
raftApplyID, dp.partitionID, opItem.extentID, opItem.offset, opItem.size)
for i := 0; i < 20; i++ {
dp.disk.allocCheckLimit(proto.FlowWriteType, uint32(opItem.size))
dp.disk.allocCheckLimit(proto.IopsWriteType, 1)
err = dp.ExtentStore().Write(opItem.extentID, opItem.offset, opItem.size, opItem.data, opItem.crc, storage.RandomWriteType, opItem.opcode == proto.OpSyncRandomWrite)
if err == nil {
break

View File

@ -92,7 +92,7 @@ func (s *DataNode) checkPartition(p *repl.Packet) (err error) {
return
}
}
if p.IsWriteOperation() {
if p.IsWriteOperation() || p.IsRandomWrite() {
dp.disk.allocCheckLimit(proto.FlowWriteType, uint32(p.Size))
dp.disk.allocCheckLimit(proto.IopsWriteType, 1)
}