]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
The function op_is_discardable introduces lock overhead which can 8717/head
authorZhenyuLeng <lengzhenyu@ict.ac.cn>
Sat, 23 Apr 2016 10:45:55 +0000 (18:45 +0800)
committerZhenyuLeng <lengzhenyu@ict.ac.cn>
Mon, 16 May 2016 01:55:24 +0000 (09:55 +0800)
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>
src/common/config_opts.h
src/osd/PG.cc

index e018f1e3ebc34697655d15893ee82a2a14ecc757..c7dba32cd323de4ec47739566f975e1dff935f90 100644 (file)
@@ -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)
index c2dfabd66a8be125a2fb79a39f942af13dcce02f..fa6b8375bba6a482bfa45606657438d4caaa993c 100644 (file)
@@ -5257,8 +5257,7 @@ ostream& operator<<(ostream& out, const PG& pg)
 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;
   }