Changeset 20060
- Timestamp:
- Oct 10, 2008, 4:13:23 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/bin/neb-admin (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/bin/neb-admin
r20031 r20060 3 3 # Copyright (C) 2005-2008 Joshua Hoblitt 4 4 # 5 # $Id: neb-admin,v 1.1 1 2008-10-09 23:41:47jhoblitt Exp $5 # $Id: neb-admin,v 1.12 2008-10-11 02:13:23 jhoblitt Exp $ 6 6 7 7 use strict; … … 13 13 use DBI; 14 14 use Nebulous::Client; 15 use Nebulous::Server::SQL;15 #use Nebulous::Server::SQL; 16 16 use Net::Server::Daemonize qw( check_pid_file create_pid_file unlink_pid_file ); 17 17 use URI; … … 67 67 ); 68 68 69 my $sql = Nebulous::Server::SQL->new();69 #my $sql = Nebulous::Server::SQL->new(); 70 70 71 71 # so_id, ext_id, instances, available_instances, need_recovery, recoverable … … 80 80 } 81 81 82 my $query = $dbh->prepare( $sql->find_objects_with_unavailable_instances 83 . " LIMIT $limit" ); 82 { 83 my $query = $dbh->prepare("CREATE TEMPORARY TABLE myvolume LIKE volume"); 84 $query->execute; 85 } 86 87 { 88 my $query = $dbh->prepare("INSERT INTO myvolume SELECT * FROM volume"); 89 $query->execute; 90 } 91 92 my $query = $dbh->prepare( 93 " SELECT 94 storage_object.so_id, 95 ext_id, 96 count(ins_id) as instances, 97 myvolume.name as volume_name, 98 myvolume.host as volume_host, 99 count(mymountedvol.vol_id) as available_instances, 100 count(mymountedvol.vol_id) > 0 as recoverable, 101 storage_object_xattr.value as copies 102 FROM storage_object 103 JOIN instance 104 USING(so_id) 105 JOIN myvolume 106 USING(vol_id) 107 LEFT JOIN storage_object_xattr 108 ON storage_object.so_id = storage_object_xattr.so_id 109 JOIN mymountedvol 110 USING(vol_id) 111 WHERE mymountedvol.available = 1 112 -- WHERE storage_object_xattr.name = 'user.copies' 113 GROUP BY so_id 114 HAVING available_instances < instances OR instances < copies 115 LIMIT $limit" ); 84 116 $query->execute; 85 117
Note:
See TracChangeset
for help on using the changeset viewer.
