- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
Nebulous-Server/bin/neb-admin (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/Nebulous-Server/bin/neb-admin
r20202 r23352 23 23 $dbpass, 24 24 $dbuser, 25 $so_id_start, 26 $so_id_range, 25 27 $limit, 26 28 $pending, … … 41 43 'pendingreplicate|r' => \$pending, 42 44 'pendingremoval' => \$removal, 45 'so_id_start=i' => \$so_id_start, 46 'so_id_range=i' => \$so_id_range, 43 47 'limit|l=i' => \$limit, 44 48 'verbose|v' => \$verbose, … … 58 62 59 63 # check to make sure that only one instance of neb-admin is running 64 # XXX this implies we should move pending replicate elsewhere 60 65 my $pidfile = '/var/tmp/neb-admin'; 61 66 # abort if an instance is already running … … 91 96 $dbh->do("INSERT INTO myvolume SELECT * FROM volume"); 92 97 98 if (not defined $so_id_start) { $so_id_start = 0; } 99 if (not defined $so_id_range) { $so_id_range = 100000; } 100 my $so_id_end = $so_id_start + $so_id_range; 101 102 # XXX check if so_id_start is beyond MAX(so_id): if so, exit with exit status 10 103 { 104 my $query = $dbh->prepare("SELECT MAX(so_id) from storage_object"); 105 $query->execute; 106 my $answer = $query->fetchrow_arrayref; 107 my $max_so_id = $$answer[0]; 108 $query->finish; 109 110 if ($so_id_start > $max_so_id) { 111 print STDERR "at end of so_id range, reset please\n"; 112 exit 10; 113 } 114 } 115 93 116 my $query = $dbh->prepare( 94 117 " SELECT … … 111 134 USING(vol_id) 112 135 WHERE mymountedvol.available = 1 113 -- WHERE storage_object_xattr.name = 'user.copies' 136 AND storage_object_xattr.name = 'user.copies' 137 AND storage_object.so_id >= $so_id_start 138 AND storage_object.so_id < $so_id_end 114 139 GROUP BY so_id 115 140 HAVING available_instances < instances OR instances < copies
Note:
See TracChangeset
for help on using the changeset viewer.
