Changeset 28446
- Timestamp:
- Jun 23, 2010, 5:51:46 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
-
Nebulous-Server/bin/nebdiskd (modified) (2 diffs)
-
Nebulous-Server/lib/Nebulous/Server.pm (modified) (1 diff)
-
Nebulous-Server/lib/Nebulous/Server/SQL.pm (modified) (1 diff)
-
Nebulous/Build.PL (modified) (1 diff)
-
Nebulous/MANIFEST (modified) (1 diff)
-
Nebulous/bin/neb-migrate (added)
-
Nebulous/bin/neb-shift (added)
-
Nebulous/lib/Nebulous/Client.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/bin/nebdiskd
r27103 r28446 224 224 } 225 225 }; 226 227 # fetch stats on the mounted device. this has to be done AFTER 228 # we determine if it's a valid mountpoint incase 229 # is_mountpoint() invokes the automounter 230 my $dev_info = df($mountpoint, 1024); 231 unless (defined $dev_info) { 232 $valid_mountpoint = 0; 233 } 234 226 235 if (!$valid_mountpoint) { 227 236 # try is_mountpoint() again if $retry > 1 … … 254 263 # we determine if it's a valid mountpoint incase 255 264 # is_mountpoint() invokes the automounter 256 my$dev_info = df($mountpoint, 1024);265 $dev_info = df($mountpoint, 1024); 257 266 unless (defined $dev_info) { 258 267 $log->error("can't find device info for $mountpoint"); -
trunk/Nebulous-Server/lib/Nebulous/Server.pm
r27115 r28446 1598 1598 } 1599 1599 1600 sub find_ext_id_by_volume 1601 { 1602 my $self = shift; 1603 my $log = $self->log; 1604 $log->debug("entered - @_"); 1605 my ($vol_name,$limit) = validate_pos(@_, 1606 { 1607 type => SCALAR, 1608 # # callbacks => { 1609 # # 'is valid volume name' => sub { 1610 # # return 1 if not defined $_[0]; 1611 # # $self->_is_valid_volume_name($_[0]) 1612 # # }, 1613 # }, 1614 }, 1615 { 1616 type => SCALAR|UNDEF, 1617 optional => 1, 1618 }, 1619 ); 1620 unless (defined($limit)) { 1621 $limit = 50000; 1622 } 1623 1624 my $sql = $self->sql; 1625 my @ext_ids; 1626 my $db = $self->_db_for_index(0); 1627 eval { 1628 my $query; 1629 $query = $db->prepare_cached( $sql->get_ext_id_by_vol_name ); 1630 my $rows = $query->execute($vol_name, 1,$limit); 1631 unless ($rows > 0) { 1632 $query->finish; 1633 $log->logdie("no instances on storage volume or volume is not avaiable for volume: $vol_name"); 1634 } 1635 while (my $row = $query->fetchrow_hashref) { 1636 my $ext_id = $row->{ 'ext_id' }; 1637 push @ext_ids, $ext_id if $ext_id; 1638 } 1639 }; 1640 if ($@) { 1641 $db->rollback; 1642 $log->logdie("database error: $@"); 1643 } 1644 1645 # XXX remove this? 1646 $log->logdie("no ext_ids found") unless (scalar @ext_ids); 1647 1648 $log->debug("found: \@ext_ids"); 1649 1650 $log->debug("leaving"); 1651 1652 return \@ext_ids; 1653 } 1600 1654 1601 1655 sub find_instances -
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r26294 r28446 266 266 AND mountedvol.name = ? 267 267 AND mountedvol.available = ? 268 }, 269 get_ext_id_by_vol_name => qq{ 270 SELECT 271 ext_id 272 FROM instance 273 JOIN storage_object 274 USING (so_id) 275 JOIN mountedvol 276 USING(vol_id) 277 JOIN volume 278 USING(vol_id) 279 WHERE volume.name = ? 280 AND mountedvol.available = ? 281 LIMIT ? 268 282 }, 269 283 # volume handler -
trunk/Nebulous/Build.PL
r26019 r28446 113 113 bin/neb-locate 114 114 bin/neb-ls 115 bin/neb-migrate 115 116 bin/neb-mv 116 117 bin/neb-replicate 117 118 bin/neb-rm 119 bin/neb-shift 118 120 bin/neb-stat 119 121 bin/neb-swap -
trunk/Nebulous/MANIFEST
r26022 r28446 14 14 bin/neb-insert 15 15 bin/neb-ls 16 bin/neb-migrate 16 17 bin/neb-mv 17 18 bin/neb-replicate 18 19 bin/neb-rm 20 bin/neb-shift 19 21 bin/neb-stat 20 22 bin/neb-swap -
trunk/Nebulous/lib/Nebulous/Client.pm
r26333 r28446 790 790 } 791 791 792 sub find_ext_id_by_volume 793 { 794 my $self = shift; 795 my ($vol_name, $limit) = validate_pos( @_, 796 { 797 type => SCALAR, 798 }, 799 { 800 type => SCALAR|UNDEF, 801 optional => 1, 802 }, 803 ); 804 805 $log->debug( "entered - @_" ); 806 807 my $response = $self->{ 'server' }->find_ext_id_by_volume( $vol_name, $limit); 808 if ( $response->fault ) { 809 $self->set_err($response->faultstring); 810 if ($response->faultstring =~ /no instances on storage volume/) { 811 $log->debug( "leaving" ); 812 return; 813 } 814 815 $log->logdie("unhandled fault - ", $self->err); 816 } 817 818 my $ext_ids = $response->result; 819 820 $log->debug( "server found @$ext_ids" ); 821 $log->debug( "leaving" ); 822 823 return($ext_ids); 824 } 825 792 826 sub find_instances_for_cull 793 827 {
Note:
See TracChangeset
for help on using the changeset viewer.
