Permalink
Browse files

Remove FIDSizes (unused) and Gearman deps

FIDSizes was the only user of Gearman.. it was deprecated when fsck
became distributed.

git-svn-id: http://code.sixapart.com/svn/mogilefs/trunk@1358 f67b2e87-0811-0410-a7e0-dd94e48410d6
  • Loading branch information...
1 parent 4411114 commit beac3468b1eeca428479d52a8aeccae3a40e845a dormando committed Nov 21, 2009
View
@@ -1,4 +1,7 @@
+ * Since FIDSizes is no longer used, remove it and remove gearman
+ dependency. (dormando)
+
* FSCK no longer rabidly fills the queue table. (dormando)
* Make storage code resilient to rare deadlocks (dormando)
View
@@ -4,20 +4,6 @@ doc/memcache-support.txt
doc/pluggable-replication-policies.txt
doc/testing.txt
lib/mogdeps/Danga/Socket.pm
-lib/mogdeps/Gearman/Client.pm
-lib/mogdeps/Gearman/Client/Async.pm
-lib/mogdeps/Gearman/Client/Async/Connection.pm
-lib/mogdeps/Gearman/JobStatus.pm
-lib/mogdeps/Gearman/Objects.pm
-lib/mogdeps/Gearman/ResponseParser.pm
-lib/mogdeps/Gearman/ResponseParser/Taskset.pm
-lib/mogdeps/Gearman/Server.pm
-lib/mogdeps/Gearman/Server/Client.pm
-lib/mogdeps/Gearman/Server/Job.pm
-lib/mogdeps/Gearman/Task.pm
-lib/mogdeps/Gearman/Taskset.pm
-lib/mogdeps/Gearman/Util.pm
-lib/mogdeps/Gearman/Worker.pm
lib/mogdeps/Net/Netmask.pm
lib/mogdeps/Perlbal.pm
lib/mogdeps/Perlbal/AIO.pm
@@ -102,7 +88,6 @@ lib/MogileFS/Worker/Replicate.pm
lib/MogileFS/Worker/JobMaster.pm
lib/Mogstored/ChildProcess.pm
lib/Mogstored/ChildProcess/DiskUsage.pm
-lib/Mogstored/ChildProcess/FIDSizes.pm
lib/Mogstored/ChildProcess/IOStat.pm
lib/Mogstored/FIDStatter.pm
lib/Mogstored/HTTPServer.pm
View
@@ -7,9 +7,6 @@ installdirs: site
requires:
Danga::Socket: 1.56
fields: 0
- Gearman::Client: 1.07
- Gearman::Client::Async: 0.93
- Gearman::Server: 1.08
Getopt::Long: 0
Net::Netmask: 0
Perlbal: 1.53
View
@@ -29,9 +29,6 @@ WriteMakefile(
'Getopt::Long' => 0,
'Symbol' => 0,
'Net::Netmask' => 0,
- 'Gearman::Server' => 1.08, # but really want at least 1.09
- 'Gearman::Client::Async' => 0.93,
- 'Gearman::Client' => 1.07, # for Gearman::Worker, in fidsizes worker
fields => 0,
},
META_MERGE => {
View
@@ -15,7 +15,7 @@ requires: MogileFS-Server-mogilefsd, MogileFS-Server-mogstored
# Build requires for mogilefsd
buildrequires: perl(DBI), perl(DBD::mysql), perl(MogileFS::Client), MogileFS-Utils, mysql
# Build requires for mogstored
-buildrequires: perl(Gearman::Client::Async) >= 0.93, perl(Gearman::Server) >= 1.08, perl(Perlbal) >= 1.53
+buildrequires: perl(Perlbal) >= 1.53
%description
MogileFS Server daemons and utilities.
@@ -79,7 +79,7 @@ Mogilefsd and related libraries.
summary: MogileFS-Server-mogstored - Mogstored and related libraries.
group: Applications/CPAN
autoreq: no
-requires: perl-Gearman-Client-Async >= 0.93, perl-Gearman-Server >= 1.08, perl-Perlbal >= 1.53
+requires: perl-Perlbal >= 1.53
obsoletes: MogileFS-Server-utils <= 2.16
%description -n MogileFS-Server-mogstored
View
@@ -7,7 +7,7 @@ Standards-Version: 3.6.1.0
Package: mogstored
Architecture: all
-Depends: ${perl:Depends}, debhelper (>= 4.1.40), libperlbal-perl, libio-aio-perl, debconf (>= 1.2.0), gearman-server, libgearman-client-async-perl, libgearman-client-perl
+Depends: ${perl:Depends}, debhelper (>= 4.1.40), libperlbal-perl, libio-aio-perl, debconf (>= 1.2.0)
Suggests: mogilefs-utils
Description: storage node daemon for MogileFS
Mogstored is a storage node daemon for MogileFS, the open-source
View
@@ -8,9 +8,6 @@
$ENV{PERL5LIB} = join(":",
"$svn/mogilefs/server/lib",
"$svn/perlbal/lib",
- "$svn/gearman/api/perl/Gearman/lib",
- "$svn/gearman/api/perl/Gearman-Client-Async/lib",
- "$svn/gearman/server/lib",
($ENV{PERL5LIB} ? ($ENV{PERL5LIB}) : ()),
);
print "export PERL5LIB=$ENV{PERL5LIB}\n";
@@ -1,121 +0,0 @@
-package Mogstored::ChildProcess::FIDSizes;
-use strict;
-use base 'Mogstored::ChildProcess';
-use warnings;
-use Errno qw(ENOENT);
-
-# Gearman version 1.06: bug fix with closing pipe to parent. we don't actually use Gearman::Client
-# object, but it comes with the updated Gearman::Worker which we do care about
-use Gearman::Client 1.06;
-use Gearman::Worker;
-
-use Storable ();
-
-# Note: in this case, this module is loaded *before* the fork (which
-# happens in Gearman::Server's start_worker) in the parent mogstored's
-# process, so be careful nothing heavy/gross is added to the FIDSizes
-# worker.
-
-my $docroot;
-my $worker;
-
-sub pre_exec_init {
- $ENV{MOG_DOCROOT} = Perlbal->service('mogstored')->{docroot};
-
-}
-
-sub run {
- $0 = "mogstored [fidsizes]";
- $worker = Gearman::Worker->new;
- $worker->register_function(fid_sizes => \&gw_fidsizes);
- $docroot = $ENV{MOG_DOCROOT}
- or die "MOG_DOCROOT environment variable not set";
- while (1) {
- $worker->work();
- }
-}
-
-sub gw_fidsizes {
- my $job = shift;
- my $args = Storable::thaw($job->arg);
- my ($start, $end, $devices) = @$args;
-
- my @output;
- foreach my $device (@$devices) {
- my $entries = do_one_device($start, $end, "$docroot/dev$device");
- push @output, [$device, $entries];
- }
- return \Storable::nfreeze(\@output);
-}
-
-sub do_one_device {
- my ($start, $end, $base) = @_;
-
- die "'$base' isn't a directory"
- unless -d $base;
-
- die "start and end are not both defined"
- unless length $start && length $end;
-
- die "end cannot come before start"
- unless $end >= $start;
-
- die "start out of range"
- if $start > 9_999_999_999;
-
- die "end out of range"
- if $end > 9_999_999_999;
-
- die "start less than 0"
- if $start < 0;
-
- die "end less than 0"
- if $end < 0;
-
- my $hdir_start = int($start / 1000);
- my $hdir_end = int($end / 1000);
-
- my $file_start = $start % 1000;
- my $file_end = $end % 1000;
-
- my @files;
-
- for (my $hdir = $hdir_start; $hdir <= $hdir_end; $hdir++) {
- my $nfid = sprintf '%07d', $hdir;
- my ($b, $mmm, $ttt) = ( $nfid =~ m{(\d)(\d{3})(\d{3})} );
-
- my $hdir_path = "$base/$b/$mmm/$ttt";
-
- my $rv = opendir(my $dh, "$base/$b/$mmm/$ttt");
- unless ($rv) {
- if ($! != ENOENT) {
- die "Unable to read directory $hdir_path: $!\n";
- }
- next;
- }
-
- foreach my $file (sort readdir($dh)) {
- next if ($file eq '.' || $file eq '..');
- unless ($file =~ m/\Q$nfid\E(\d{3})\.fid/) {
- warn "Spurious file during readdir: $hdir_path/$file\n";
- next;
- }
-
- my $hhh = $1;
- my ($fid) = ($nfid . $hhh) =~ /^0*(\d+)$/;
-
- next if (($hdir == $hdir_start && $hhh < $file_start) ||
- ($hdir == $hdir_end && $hhh > $file_end));
-
- my $filepath = "$hdir_path/$file";
- my $size = (stat($filepath))[7];
-
- push @files, [$fid, $size];
- die "Results too large" if @files > 10_000;
- }
- }
-
- return \@files;
-}
-
-1;
@@ -57,33 +57,6 @@ sub event_read {
}
$self->watch_read(0);
Mogstored->iostat_subscribe($self);
- } elsif (my ($start, $end, $raw_devs) =
- $cmd =~ /^fid_sizes \s+ (\d+)-(\d+) \s+ ([\d\s]+)$/ix) {
- my @devs = split /\s+/, $raw_devs;
- my $args = Storable::nfreeze([$start, $end, \@devs]);
- my $task = Gearman::Task->new(
- "fid_sizes" => \$args,
- {
- on_complete => sub {
- my $res = shift;
- my $devices = Storable::thaw($$res);
- foreach my $device_ent (@$devices) {
- my ($device, $entries) = @$device_ent;
- foreach my $entry (@$entries) {
- my ($fid, $size) = @$entry;
- $self->write("$device\t$fid\t$size\n");
- }
- }
- $self->write(".\n");
- $self->watch_read(1);
- },
- on_fail => sub {
- $self->write("ERR error processing fid_sizes request\n");
- $self->watch_read(1);
- },
- });
- Mogstored->gearman_client->add_task($task);
- $self->watch_read(0);
} else {
# we don't understand this so pass it on to manage command interface
my @out;
Oops, something went wrong.

0 comments on commit beac346

Please sign in to comment.