Apply recovery pause before writes, after commits, and do not apply it to syncs to not block EC pools from functioning
parent
bb2f395f1e
commit
978bdc128a
|
@ -283,6 +283,7 @@ class osd_t
|
|||
void exec_sync_stab_all(osd_op_t *cur_op);
|
||||
void exec_show_config(osd_op_t *cur_op);
|
||||
void exec_secondary(osd_op_t *cur_op);
|
||||
void exec_secondary_real(osd_op_t *cur_op);
|
||||
void secondary_op_callback(osd_op_t *cur_op);
|
||||
|
||||
// primary ops
|
||||
|
|
|
@ -442,7 +442,7 @@ void osd_t::tune_recovery()
|
|||
if (recovery_target_sleep_count < recovery_tune_agg_interval)
|
||||
recovery_target_sleep_count++;
|
||||
recovery_target_sleep_us = recovery_target_sleep_total / recovery_target_sleep_count;
|
||||
if (log_level > 4)
|
||||
if (log_level > 1)
|
||||
{
|
||||
printf(
|
||||
"[OSD %lu] auto-tune: client util: %.2f, recovery util: %.2f, lat: %lu us -> target util %.2f, delay %lu us\n",
|
||||
|
|
|
@ -42,8 +42,10 @@ void osd_t::secondary_op_callback(osd_op_t *op)
|
|||
int retval = op->bs_op->retval;
|
||||
delete op->bs_op;
|
||||
op->bs_op = NULL;
|
||||
if (op->is_recovery_related() && recovery_target_sleep_us)
|
||||
if (op->is_recovery_related() && recovery_target_sleep_us &&
|
||||
op->req.hdr.opcode == OSD_OP_SEC_STABILIZE)
|
||||
{
|
||||
// Apply pause AFTER commit. Do not apply pause to SYNC at all
|
||||
if (!op->tv_end.tv_sec)
|
||||
{
|
||||
clock_gettime(CLOCK_REALTIME, &op->tv_end);
|
||||
|
@ -59,7 +61,25 @@ void osd_t::secondary_op_callback(osd_op_t *op)
|
|||
}
|
||||
}
|
||||
|
||||
void osd_t::exec_secondary(osd_op_t *cur_op)
|
||||
void osd_t::exec_secondary(osd_op_t *op)
|
||||
{
|
||||
if (op->is_recovery_related() && recovery_target_sleep_us &&
|
||||
op->req.hdr.opcode != OSD_OP_SEC_STABILIZE && op->req.hdr.opcode != OSD_OP_SEC_SYNC)
|
||||
{
|
||||
// Apply pause BEFORE write/delete
|
||||
tfd->set_timer_us(recovery_target_sleep_us, false, [this, op](int timer_id)
|
||||
{
|
||||
clock_gettime(CLOCK_REALTIME, &op->tv_begin);
|
||||
exec_secondary_real(op);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
exec_secondary_real(op);
|
||||
}
|
||||
}
|
||||
|
||||
void osd_t::exec_secondary_real(osd_op_t *cur_op)
|
||||
{
|
||||
if (cur_op->req.hdr.opcode == OSD_OP_SEC_READ_BMP)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue