Skip to content

Commit

Permalink
osd: throttle snap trimmming with simple delay
Browse files Browse the repository at this point in the history
This is not particularly smart, but it is *a* knob that lets you make
the snap trimmer slow down.  It's a flow and a simple delay, so it is
adjustable at runtime.  Default is 0 (no change in behavior).

Partial solution for #6278.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 4413670)
  • Loading branch information
Sage Weil committed May 7, 2014
1 parent 14650b2 commit 4e5e41d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/config_opts.h
Expand Up @@ -413,6 +413,7 @@ OPTION(osd_backfill_scan_max, OPT_INT, 512)
OPTION(osd_op_thread_timeout, OPT_INT, 15)
OPTION(osd_recovery_thread_timeout, OPT_INT, 30)
OPTION(osd_snap_trim_thread_timeout, OPT_INT, 60*60*1)
OPTION(osd_snap_trim_sleep, OPT_FLOAT, 0)
OPTION(osd_scrub_thread_timeout, OPT_INT, 60)
OPTION(osd_scrub_finalize_thread_timeout, OPT_INT, 60*10)
OPTION(osd_remove_thread_timeout, OPT_INT, 60*60)
Expand Down
10 changes: 9 additions & 1 deletion src/osd/ReplicatedPG.cc
Expand Up @@ -1701,7 +1701,15 @@ ReplicatedPG::RepGather *ReplicatedPG::trim_object(const hobject_t &coid)

void ReplicatedPG::snap_trimmer()
{
lock();
if (g_conf->osd_snap_trim_sleep > 0) {
utime_t t;
t.set_from_double(g_conf->osd_snap_trim_sleep);
t.sleep();
lock();
dout(20) << __func__ << " slept for " << t << dendl;
} else {
lock();
}
if (deleting) {
unlock();
return;
Expand Down

0 comments on commit 4e5e41d

Please sign in to comment.