mogilefs newbie help

Robert Rogers robrogers at mac.com
Thu Mar 31 15:12:59 PST 2005


 FYI,

It seems like this code is never called: 

        if ($! == ENOENT) {
            # directory doesn't exist, so let's manually create it
            eval { File::Path::mkpath($path, 0, 0755); };
            return $self->system_error("Unable to create directory", "path = $path, file = $file") if $@;
            print STDERR "debug ENOENT: path=$path file=$file, fd=$fd; err=$!\n";
            # should be created, call self recursively to try
            return $self->attempt_open($path, $file);
        } elsif ($!) {
            return $self->system_error("Internal error", "error = $!, path = $path, file = $file");
        }


ie the directories are never made. weird.

so, i did this hack (i should use all caps) and it now works:
$! = ENOENT if $fd == -1;

here:
 my $fd = shift;
        $! = ENOENT if $fd == -1;
        print STDERR "debug: fd=$fd; err=$! : also ENOENT maybe: " . ENOENT . "\n";
        # verify file was opened


Thoughts?

-Rob

On Thursday, March 31, 2005, at 01:27PM, Mark Smith <marksmith at danga.com> wrote:

>Well, that's strange.  Could you do me a favor and modify
>lib/Perlbal/ClientHTTP.pm around line 250:
>
>    Linux::AIO::aio_open("$path/$file", O_CREAT | O_TRUNC | O_WRONLY, 0644, sub {
>        # get the fd
>        my $fd = shift;
>
>        print STDERR "debug: fd=$fd; err=$!\n";
>
>        # verify file was opened
>
>I just added the print line.  If you could add that to your Perlbal and
>then try again, that would enable me to try to see what is getting passed
>in from the call to aio_open.
>
>Can you also provide the version number for Perl, Linux::AIO, and whatever
>distribution of Linux you're using?
>
>Thanks!
>
>
>On Thu, Mar 31, 2005, Robert Rogers wrote:
>> Mark,
>> 
>> First you rule for answering so quick.
>> 
>> Second, no, I hadn't created the /var/mogdata/devN dirs just /var/mogdata (and it's owned by mogile who runs mogilefsd)  
>> 
>> However,  I just created /dev1 - /dev3  (which is how many devices i have in localhost:db) mogilefs  still shows the same errror:
>> 
>> system error: Unable to create file (error = Invalid argument, path = /var/mogdata//dev3/0/000/000, file = 0000000058.fid, fd = -1 (Error obtaining link inf\
>> o: No such file or directory))
>> 
>> On the other hand,  if I create the entire path: /var/mogdata//dev3/0/000/000, then all works perfectly.  But, I'm thinking I should have to do this.  
>> 
>> Thanks for your help.
>> 
>> -Rob
>> 
>> On Thursday, March 31, 2005, at 12:43PM, Mark Smith <marksmith at danga.com> wrote:
>> 
>> >> Mar 31 04:16:29 sls2 perlbal[30001]: system error: Unable to create 
>> >> file (error = Invalid argument, \
>> >> path = /var/mogdata//dev3/0/000/000, file = 0000000044.fid, fd = -1 
>> >> (Error obtaining link info: No s\
>> >> uch file or directory))
>> >
>> >Just to confirm --
>> >
>> >The directory /var/mogdata/dev3 exists already, and the user you're running
>> >the mogstored as does have permission there, yes?
>> >
>> >The top-level device directories (devN under /var/mogdata) must already
>> >exist before you can use mogstored.  Also, it must have permission to
>> >create files there.
>> >
>> >That's my first thought, let me know if that's all in order and if it's
>> >still broken, and we'll continue debugging!  :-)
>> >
>> >
>> >--
>> >Mark Smith
>> >junior at danga.com
>> >
>> >
>
>
>--
>Mark Smith
>junior at danga.com
>
>




More information about the mogilefs mailing list