Skip to content

Commit

Permalink
reaper: add "queue_rate_for_reaper" server setting
Browse files Browse the repository at this point in the history
This controls the number of FIDs the reaper can inject into the
replication queue for each dead device, per wakeup.

This defaults to 1000, the same value its had since (at least) 2006.
  • Loading branch information
Eric Wong authored and dormando committed Aug 13, 2012
1 parent 57a5099 commit 8cc75d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/MogileFS/Worker/Reaper.pm
Expand Up @@ -65,9 +65,10 @@ sub work {
my $sto = Mgd::get_store();
my $lock = "mgfs:reaper";
my $lock_timeout = $self->watchdog_timeout / 4;
my $limit = MogileFS::Config->server_setting_cached('queue_rate_for_reaper') || 1000;

if ($sto->get_lock($lock, $lock_timeout)) {
my @fids = $dev->fid_list(limit => 1000);
my @fids = $dev->fid_list(limit => $limit);
if (@fids) {
$self->still_alive;
foreach my $fid (@fids) {
Expand Down
1 change: 1 addition & 0 deletions t/70-reaper.t
Expand Up @@ -51,6 +51,7 @@ ok($tmptrack->mogadm("device", "add", "hostA", 2), "created dev2 on hostA");

ok($tmptrack->mogadm("domain", "add", "testdom"), "created test domain");
ok($tmptrack->mogadm("class", "add", "testdom", "2copies", "--mindevcount=2"), "created 2copies class in testdom");
ok($tmptrack->mogadm("settings", "set", "queue_rate_for_reaper", 123), "set queue_rate_for_reaper");

# create one sample file with 2 copies
my $fh = $mogc->new_file("file1", "2copies");
Expand Down

0 comments on commit 8cc75d8

Please sign in to comment.