From 2d6966f7e1f4c6dab12f7500746f1021b52d91af Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Wed, 17 Aug 2016 11:24:01 -0400 Subject: [PATCH] rgw file: allow RGWLibFS::write_completion_interval_s to be set in conf Signed-off-by: Matt Benjamin (cherry picked from commit 70dad0fba561edaf0bb4e746e29b92a4e9b014b2) --- src/common/config_opts.h | 3 +++ src/rgw/librgw.cc | 4 ++++ src/rgw/rgw_file.cc | 5 ++++- src/rgw/rgw_file.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 7be42312fd781..c2d3d5c1766d8 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -1324,6 +1324,9 @@ OPTION(rgw_nfs_lru_lanes, OPT_INT, 5) OPTION(rgw_nfs_lru_lane_hiwat, OPT_INT, 911) OPTION(rgw_nfs_fhcache_partitions, OPT_INT, 3) OPTION(rgw_nfs_fhcache_size, OPT_INT, 2017) /* 3*2017=6051 */ +OPTION(rgw_nfs_write_completion_interval_s, OPT_INT, 10) /* stateless (V3) + * commit + * delay */ OPTION(rgw_zone, OPT_STR, "") // zone name OPTION(rgw_zone_root_pool, OPT_STR, ".rgw.root") // pool where zone specific info is stored diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc index c129a21430b7e..e1b4ee5e9b488 100644 --- a/src/rgw/librgw.cc +++ b/src/rgw/librgw.cc @@ -81,6 +81,10 @@ namespace rgw { void RGWLibProcess::run() { + /* write completion interval */ + RGWLibFS::write_completion_interval_s = + cct->_conf->rgw_nfs_write_completion_interval_s; + /* start write timer */ RGWLibFS::write_timer.resume(); diff --git a/src/rgw/rgw_file.cc b/src/rgw/rgw_file.cc index e58dd0653945f..2741d838cd655 100644 --- a/src/rgw/rgw_file.cc +++ b/src/rgw/rgw_file.cc @@ -38,6 +38,8 @@ namespace rgw { atomic RGWLibFS::fs_inst; + uint32_t RGWLibFS::write_completion_interval_s = 10; + ceph::timer RGWLibFS::write_timer{ ceph::construct_suspended}; @@ -815,7 +817,8 @@ namespace rgw { /* start write timer */ f->write_req->timer_id = RGWLibFS::write_timer.add_event( - std::chrono::seconds(10), WriteCompletion(*this)); + std::chrono::seconds(RGWLibFS::write_completion_interval_s), + WriteCompletion(*this)); } } } diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 9b0fe98a46eaf..65ddf3515edf1 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -706,6 +706,7 @@ namespace rgw { RGWAccessKey key; // XXXX acc_key static atomic fs_inst; + static uint32_t write_completion_interval_s; std::string fsid; using lock_guard = std::lock_guard; -- 2.39.5