]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw file: allow RGWLibFS::write_completion_interval_s to be set in conf
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 17 Aug 2016 15:24:01 +0000 (11:24 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 5 Oct 2016 18:24:57 +0000 (14:24 -0400)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 70dad0fba561edaf0bb4e746e29b92a4e9b014b2)

src/common/config_opts.h
src/rgw/librgw.cc
src/rgw/rgw_file.cc
src/rgw/rgw_file.h

index 7be42312fd781fe5f2026da450befb642444b415..c2d3d5c1766d8e212872d05da8db3fc01d485ff8 100644 (file)
@@ -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
index c129a21430b7e84263557881cb44d05077ae9de4..e1b4ee5e9b488f57d2b2512e8fc7de92509f8c17 100644 (file)
@@ -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();
 
index e58dd0653945f9c3036e52f1436545939d48ad5c..2741d838cd6559751c151d7c8fc695c1cacedf00 100644 (file)
@@ -38,6 +38,8 @@ namespace rgw {
 
   atomic<uint32_t> RGWLibFS::fs_inst;
 
+  uint32_t RGWLibFS::write_completion_interval_s = 10;
+
   ceph::timer<ceph::mono_clock> 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));
        }
       }
     }
index 9b0fe98a46eafc9e7efddfd36e68b4d934e060bf..65ddf3515edf1aa0db2853601367b1f1373d7c58 100644 (file)
@@ -706,6 +706,7 @@ namespace rgw {
     RGWAccessKey key; // XXXX acc_key
 
     static atomic<uint32_t> fs_inst;
+    static uint32_t write_completion_interval_s;
     std::string fsid;
 
     using lock_guard = std::lock_guard<std::mutex>;