- Timestamp:
- Mar 29, 2010, 3:55:49 PM (16 years ago)
- Location:
- branches/eam_branches/20100225
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
Nebulous-Server/lib/Nebulous/Server.pm (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20100225
- Property svn:mergeinfo changed
-
branches/eam_branches/20100225/Nebulous-Server/lib/Nebulous/Server.pm
r26294 r27517 41 41 # This determines how many entries from the list of volumes sorted by free space are randomized. 42 42 my $topfew_count = 15; 43 43 my $max_used_space = 0.98; 44 44 # transaction restart/retry regex 45 45 my $trans_regex = qr/Deadlock Found|Lock wait timeout exceeded|try restarting transaction|Can't connect to MySQL server/i; … … 1606 1606 $log->debug("entered - @_"); 1607 1607 1608 my ($key, $vol_name ) = validate_pos(@_,1608 my ($key, $vol_name, $find_invalid) = validate_pos(@_, 1609 1609 { 1610 1610 type => SCALAR, … … 1624 1624 optional => 1, 1625 1625 }, 1626 { 1627 # find_invalid 1628 type => SCALAR|UNDEF, 1629 optional => 1, 1630 }, 1626 1631 ); 1627 1632 … … 1667 1672 } else { 1668 1673 $query = $db->prepare_cached( $sql->get_object_instances ); 1674 my $rows; 1669 1675 # 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 } 1671 1682 unless ($rows > 0) { 1672 1683 $query->finish; … … 2108 2119 $query = $db->prepare_cached( $sql->get_storage_volume_by_name ); 2109 2120 # %free, name, avaiable, allocate 2110 $rows = $query->execute( 0.95, $name, 1, 1);2121 $rows = $query->execute($max_used_space, $name, 1, 1); 2111 2122 # XXX destinguish between non-existant and unavailable 2112 2123 unless ($rows > 0) { … … 2129 2140 $query = $db->prepare_cached( $sql->get_storage_volume ); 2130 2141 # %free, avaiable, allocate 2131 $rows = $query->execute( 0.95, 1, 1, $topfew_count);2142 $rows = $query->execute($max_used_space, 1, 1, $topfew_count); 2132 2143 # $log->warn("Storage_volume: $rows $topfew_count"); 2133 2144 # there has to be atleast one storage volume … … 2201 2212 $query = $db->prepare_cached( $sql->get_replication_volume_for_ext_id ); 2202 2213 # 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); 2204 2215 # XXX destinguish between non-existant and unaviable 2205 2216 unless ($rows > 0) {
Note:
See TracChangeset
for help on using the changeset viewer.
