Changeset 23345
- Timestamp:
- Mar 17, 2009, 11:08:44 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
Nebulous-Server/bin/neb-admin (modified) (5 diffs)
-
ippTasks/replicate.pro (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/bin/neb-admin
r20202 r23345 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 -
trunk/ippTasks/replicate.pro
r23230 r23345 62 62 # the replicate process interacts with only the single Nebulous server 63 63 64 # Each 'pendingreplicate' query is limited to a finite number of so_id values. 65 # Each time we call replicate.load, we increment SO_ID_START by the range value. 66 # If the pendingreplicate query exits with exit status 10, we start over at 0 67 68 $SO_ID_START = 0 69 $SO_ID_RANGE = 100000 70 64 71 # select Nebulous objects which desire additional copies 65 72 task replicate.load … … 68 75 # modify these after the tasks are tested 69 76 periods -poll 10 70 periods -exec 1 77 periods -exec 10 71 78 periods -timeout 1500 72 79 npending 1 … … 79 86 # command does not need to be dynamic, but having it so allows us to adjust the periods 80 87 # so that we dont have to wait 10 minutes for things to start up 81 command neb-admin --host $NEB_HOST --db $NEB_DB --user $NEB_USER --pass $NEB_PASS --pendingreplicate --limit 7500 88 # XXX smaller limited? 7500 will be a huge book of things to do... 89 command neb-admin --host $NEB_HOST --db $NEB_DB --user $NEB_USER --pass $NEB_PASS --pendingreplicate --limit 7500 --so_id_start $SO_ID_START --so_id_range $SO_ID_RANGE 82 90 periods -exec 1800 83 91 … … 86 94 # success 87 95 task.exit $EXIT_SUCCESS 96 # advance the so_id counter 97 $SO_ID_START += $SO_ID_RANGE 98 88 99 # convert 'stdout' to book format 89 100 ipptool2book stdout replicatePending -key key -uniq -setword pantaskState INIT … … 95 106 # delete existing entries in the appropriate pantaskStates 96 107 process_cleanup replicatePending 108 end 109 110 # out of so_id range, reset 111 task.exit 10 112 # advance the so_id counter 113 $SO_ID_START = 0 97 114 end 98 115
Note:
See TracChangeset
for help on using the changeset viewer.
