IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20134


Ignore:
Timestamp:
Oct 13, 2008, 4:56:30 PM (18 years ago)
Author:
jhoblitt
Message:

change nebdiskd to not do things that might imply a table level lock on the mount table

Location:
trunk/Nebulous-Server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/Changes

    r20091 r20134  
    3030      DBH itself; cleanup Nebulous::Server->db()
    3131    - add Nebulous::Server->swap_objects() method
     32    - change nebdiskd to not do things that might imply a table level lock on
     33      the mount table
    3234
    33350.15 Thu Sep 11 13:00:59 HST 2008
  • trunk/Nebulous-Server/bin/nebdiskd

    r19886 r20134  
    33# Copyright (C) 2007  Joshua Hoblitt
    44#
    5 # $Id: nebdiskd,v 1.11 2008-10-03 21:56:36 jhoblitt Exp $
     5# $Id: nebdiskd,v 1.12 2008-10-14 02:56:30 jhoblitt Exp $
    66
    77use strict;
     
    124124
    125125        eval {
    126             # empty the mount table
    127             $dbh->do("DELETE FROM mount");
    128             print "flushed mount table\n" if $debug;
    129 
    130             # repopulate the mount table with all valid mounts that we are
    131             # supposed to be watching
    132             my $query = $dbh->prepare_cached("INSERT INTO mount VALUES(?, ?, ?)");
     126            my $r_query = $dbh->prepare_cached("REPLACE INTO mount VALUES(?, ?, ?)");
     127            my $d_query = $dbh->prepare_cached("DELETE FROM mount WHERE mountpoint = ?");
    133128
    134129            # determine valid mountpoints
     
    139134                eval {
    140135                    unless (is_mountpoint($mnt)) {
    141                         print "$mnt is not a valid mountpoint\n" if $debug;
    142                         next;
     136                        die "$mnt is not a valid mountpoint\n";
    143137                    }
    144138                };
    145139                if ($@) {
    146                     print "$mnt is not a valid mountpoint\n" if $debug;
     140                    print $@ if $debug;
     141                    $d_query->execute($mnt);
    147142                    next;
    148143                }
     
    157152                }
    158153
    159                 $query->execute($mnt, @$dev_info{qw( blocks used )});
     154                $r_query->execute($mnt, @$dev_info{qw( blocks used )});
    160155                print "adding $mnt to db\n" if $debug;
    161156
Note: See TracChangeset for help on using the changeset viewer.