Skip to content

Commit

Permalink
rgw file: allow RGWLibFS::write_completion_interval_s to be set in conf
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Benjamin <[email protected]>
  • Loading branch information
mattbenjamin committed Aug 17, 2016
1 parent d1e512d commit 70dad0f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/common/config_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,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
Expand Down
4 changes: 4 additions & 0 deletions src/rgw/librgw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,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();

Expand Down
5 changes: 4 additions & 1 deletion src/rgw/rgw_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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));
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/rgw/rgw_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,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>;
Expand Down

0 comments on commit 70dad0f

Please sign in to comment.