From 6171ffbced3869d713307f45878b37a7f5b73846 Mon Sep 17 00:00:00 2001 From: ZhenyuLeng Date: Sat, 23 Apr 2016 18:45:55 +0800 Subject: [PATCH] The function op_is_discardable introduces lock overhead which can 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 --- src/common/config_opts.h | 2 ++ src/osd/PG.cc | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index e018f1e3ebc3..c7dba32cd323 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -892,6 +892,8 @@ OPTION(osd_bench_large_size_max_throughput, OPT_U64, 100 << 20) // 100 MB/s 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) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index c2dfabd66a8b..fa6b8375bba6 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5257,8 +5257,7 @@ ostream& operator<<(ostream& out, const PG& pg) bool PG::can_discard_op(OpRequestRef& op) { MOSDOp *m = static_cast(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; } -- 2.47.3