albob has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
Hopefully someone will have seen and solved this issue before! I have a Perl script environment that kicks off 3rd party tools and watches the log files of those tools to determine pass/fail. It all works fine unless the log files are being dumped to a RAID disk. In that case, the perl file tests (-e, -R) always fail. The files being tested do exist, but for some reason Perl can't see them.

I understand that RAID creates a virtual disk which the application sees? Perhaps this is confusing things. I'm stumped to be honest.

Thanks

Replies are listed 'Best First'.
Re: Perl files tests fail on RAID disk
by blue_cowdawg (Monsignor) on Jun 05, 2013 at 14:27 UTC
        It all works fine unless the log files are being dumped to a RAID disk.

    I am seriously doubting this is a Perl issue per se but I'll play along for a moment.

    • What errors are you seeing?
      • It all works fine unless the log files are being dumped to a RAID disk.
      what exactly does that mean?
    • What operations are you performing to the RAID environmnt?
    • What kind of RAID?
      • Hardware?
      • Software?
      • SAN?
      • ?????
      • Bug Spray?
    • What is the operating environment?
    Honestly Perl has no concept of a difference between files on JBOD or any other storage medium and RAID. However, at the systemic level there could be differences.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

      It might also be an issue attributable to network or filesystem. Some filesystems like AFS or NFS are problematic, and maybe this "RAID device" has interesting behaviour in such cases.

        AFS has some particularly interesting behaviors. You can "appear" to have permissions but not really have permissions to write in some cases.


        Peter L. Berghold -- Unix Professional
        Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
        Hi,
        For the detailed RAID questions, I am having to chase up with the person who set it up for me as I know little or nothing about it. However your questions have shown me the questions I need to ask.
        Thanks
Re: Perl files tests fail on RAID disk
by Random_Walk (Prior) on Jun 05, 2013 at 14:46 UTC

    Why do you do the -e -R tests? What do you see if you run:

    my $logdir = "/log/file/location"; my $logfile = "your.log"; my $fpath = "$logdir/$logfile"; open my $fh, '<', $fpath or die "I could not read $fpath: $!\n";

    Cheers,
    R.

    Pereant, qui ante nos nostra dixerunt!
      Hi,
      Indeed that works fine in that my program can open the file for read. Perhaps I should rework my code. I used file tests as it seemed to be a neater way of doing what I needed to do. The log file not existing is not in itself an issue, it just means I have to do a whole lot of other stuff. Thus I thought this was easier to code:

      if (-e $log) { open .... do lots of stuff... } else { do lots of other stuff }

      Regards

        Could you write something like proof of concept code - minimal script which prints output, that shows that file is not exists (-e is false) and that file opened without error. (also -f -d -R and other tests might help)

        And full details about RAID configuration and software/OS that you use + path to files (include full filenames) + ls -la directory listing

Re: Perl files tests fail on RAID disk
by talexb (Chancellor) on Jun 05, 2013 at 16:25 UTC

    Are you trying to access the RAID device, or are you trying to access one of the drives that makes up the RAID device? That could be the cause of some unusual behavior.

    Ideally, you'd just be accessing a file that resides in the file system that's stored on a device -- you shouldn't be worrying about the device at all.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      I am just trying to access the raid device. How the RAID is handling the data under the hood in invisible to me.