The function op_is_discardable introduces lock overhead which can
not be ignored.It would be better to judge if to discard op when
the connection disconnected as a parameter whether the network is
believable or extremely unlikelihood.
add g_conf osd_discard_disconnected_ops to control whether to
discard op when the connection disconnected
Waiting for test
Signed-off-by: ZhenyuLeng <lengzhenyu@ict.ac.cn>
OPTION(osd_bench_max_block_size, OPT_U64, 64 << 20) // cap the block size at 64MB
OPTION(osd_bench_duration, OPT_U32, 30) // duration of 'osd bench', capped at 30s to avoid triggering timeouts
+OPTION(osd_discard_disconnected_ops, OPT_BOOL, true)
+
OPTION(memstore_device_bytes, OPT_U64, 1024*1024*1024)
OPTION(memstore_page_set, OPT_BOOL, true)
OPTION(memstore_page_size, OPT_U64, 64 << 10)
bool PG::can_discard_op(OpRequestRef& op)
{
MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
-
- if (OSD::op_is_discardable(m)) {
+ if (g_conf->osd_discard_disconnected_ops && OSD::op_is_discardable(m)) {
dout(20) << " discard " << *m << dendl;
return true;
}