IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/Nebulous-Server/lib/Nebulous/Server.pm

    r26294 r27517  
    4141# This determines how many entries from the list of volumes sorted by free space are randomized.
    4242my $topfew_count = 15;
    43 
     43my $max_used_space = 0.98;
    4444# transaction restart/retry regex
    4545my $trans_regex = qr/Deadlock Found|Lock wait timeout exceeded|try restarting transaction|Can't connect to MySQL server/i;
     
    16061606    $log->debug("entered - @_");
    16071607
    1608     my ($key, $vol_name) = validate_pos(@_,
     1608    my ($key, $vol_name, $find_invalid) = validate_pos(@_,
    16091609        {
    16101610            type        => SCALAR,
     
    16241624            optional    => 1,
    16251625        },
     1626        {
     1627            # find_invalid
     1628            type        => SCALAR|UNDEF,
     1629            optional    => 1,
     1630        },
    16261631    );
    16271632
     
    16671672        } else {
    16681673            $query = $db->prepare_cached( $sql->get_object_instances );
     1674            my $rows;
    16691675            # ext_id, available
    1670             my $rows = $query->execute($key->path, 1);
     1676            if (defined($find_invalid)) {
     1677                $rows = $query->execute($key->path, 0);
     1678            }
     1679            else {
     1680                $rows = $query->execute($key->path, 1);
     1681            }
    16711682            unless ($rows > 0) {
    16721683                $query->finish;
     
    21082119            $query = $db->prepare_cached( $sql->get_storage_volume_by_name );
    21092120            # %free, name, avaiable, allocate
    2110             $rows = $query->execute(0.95, $name, 1, 1);
     2121            $rows = $query->execute($max_used_space, $name, 1, 1);
    21112122            # XXX destinguish between non-existant and unavailable
    21122123            unless ($rows > 0) {
     
    21292140            $query = $db->prepare_cached( $sql->get_storage_volume );
    21302141            # %free, avaiable, allocate
    2131             $rows = $query->execute(0.95, 1, 1, $topfew_count);
     2142            $rows = $query->execute($max_used_space, 1, 1, $topfew_count);
    21322143#           $log->warn("Storage_volume: $rows $topfew_count");
    21332144            # there has to be atleast one storage volume
     
    22012212        $query = $db->prepare_cached( $sql->get_replication_volume_for_ext_id );
    22022213        # ext_id, %free, avaiable, allocate
    2203         $rows = $query->execute($key->path, 0.95, 1, 1, $forbidden_cabinet, $topfew_count);
     2214        $rows = $query->execute($key->path, $max_used_space, 1, 1, $forbidden_cabinet, $topfew_count);
    22042215        # XXX destinguish between non-existant and unaviable
    22052216        unless ($rows > 0) {
Note: See TracChangeset for help on using the changeset viewer.