Changeset 36686
- Timestamp:
- Apr 22, 2014, 12:51:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20130712/ippScripts/scripts/rawcheck.pl
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/ippScripts/scripts/rawcheck.pl merged eligible /branches/czw_branch/20101203/ippScripts/scripts/rawcheck.pl 29907-30631 /branches/czw_branch/20120906/ippScripts/scripts/rawcheck.pl 34410-34786 /branches/eam_branches/ipp-20101103/ippScripts/scripts/rawcheck.pl 29657-29920 /branches/eam_branches/ipp-20101205/ippScripts/scripts/rawcheck.pl 29959-30585 /branches/eam_branches/ipp-20110213/ippScripts/scripts/rawcheck.pl 30628-31149 /branches/eam_branches/ipp-20110404/ippScripts/scripts/rawcheck.pl 31166-31444 /branches/eam_branches/ipp-20110505/ippScripts/scripts/rawcheck.pl 31458-31658 /branches/eam_branches/ipp-20110710/ippScripts/scripts/rawcheck.pl 31852-32345 /branches/eam_branches/ipp-20110906/ippScripts/scripts/rawcheck.pl 32363-32631 /branches/eam_branches/ipp-20111110/ippScripts/scripts/rawcheck.pl 32645-32694 /branches/eam_branches/ipp-20120405/ippScripts/scripts/rawcheck.pl 33724-33957 /branches/eam_branches/ipp-20120601/ippScripts/scripts/rawcheck.pl 33977-34079 /branches/eam_branches/ipp-20120627/ippScripts/scripts/rawcheck.pl 34099-34256 /branches/eam_branches/ipp-20120805/ippScripts/scripts/rawcheck.pl 34292-34401 /branches/eam_branches/ipp-20120905/ippScripts/scripts/rawcheck.pl 34407-34747 /branches/eam_branches/ipp-20121130/ippScripts/scripts/rawcheck.pl 34755-34841 /branches/eam_branches/ipp-20121219/ippScripts/scripts/rawcheck.pl 34857-35096 /branches/eam_branches/ipp-20130207/ippScripts/scripts/rawcheck.pl 35125-35236 /branches/eam_branches/ipp-20130307/ippScripts/scripts/rawcheck.pl 35267-35414 /branches/eam_branches/ipp-20130419/ippScripts/scripts/rawcheck.pl 35420-35554 /branches/eam_branches/ipp-20130509/ippScripts/scripts/rawcheck.pl 35565-35753 /branches/haf_add201112/ippScripts/scripts/rawcheck.pl 32980-33029
r36379 r36686 134 134 $existing_copies++; 135 135 $md5sums[$i] = local_md5sum($files[$i]); 136 # my $fh;137 # open($fh,$files[$i]);138 # $md5sums[$i] = Digest::MD5->new->addfile($fh)->hexdigest;139 # close($fh);140 136 $md5sum_uniq{$md5sums[$i]} = 1; 141 137 … … 183 179 print 184 180 "object id: ", @$stat[0], "\n", 185 "key: ", @$stat[1], "\n", 186 "read lock: ", @$stat[2], "\n"; 187 # "write lock: ", @$stat[3], "\n"; 181 "key: ", @$stat[1], "\n"; 188 182 print 189 "epoch: ", @$stat[4], "\n", 190 "mtime: ", @$stat[5], "\n"; 183 "epoch: ", @$stat[4], "\n"; 191 184 print 192 185 "md5sum count: ", scalar(keys %md5sum_uniq), "\n"; … … 220 213 } 221 214 close(DD); 222 $quality[0] = 1; 223 print "cp $good_file $files[0]\n"; 224 system("cp $good_file $files[0]"); 225 # Begin my best validation thought 215 if ($good_file eq '') { 216 die "No valid instance of key: $key"; 217 } 218 else { 219 $quality[0] = 1; 220 print "cp $good_file $files[0]\n"; 221 system("cp $good_file $files[0]"); 222 } 223 # Begin my best validation thought 226 224 { 227 225 my $tmpmd5 = local_md5sum($files[0]); 228 # my $fh;229 # open($fh,$files[0]);230 # my $tmpmd5 = Digest::MD5->new->addfile($fh)->hexdigest;231 # close($fh);232 226 if ($tmpmd5 ne $md5sum) { 233 227 die "Post-replication md5sum does not match! $tmpmd5 != $md5sum"; 234 228 } 235 229 } 236 # End my best validation thought.230 # End my best validation thought. 237 231 238 232 $Ngood = 1; # We now hand off this single valid instance object to be handled by the Ngood=1 case. 233 } 234 235 if ($quality[0] == 0) { # The first instance is bad. 236 # But since we're here, and not up there, there must be at least one good copy. Find it. 237 for (my $i = 0; $i <= $#md5sums; $i++) { 238 if ($md5sums[$i] eq $md5sum) { # Found it. 239 print "cp $files[$i] $files[0]\n"; 240 system("cp $files[$i] $files[0]"); 241 # Begin my best validation thought 242 { 243 my $tmpmd5 = local_md5sum($files[0]); 244 if ($tmpmd5 ne $md5sum) { 245 die "Post-replication md5sum does not match! $tmpmd5 != $md5sum"; 246 } 247 } 248 # End my best validation thought. 249 last; # We're done here now. 250 } 251 } 239 252 } 240 253 … … 256 269 if ($@) { die $@; } 257 270 258 # Begin my best validation thought271 # Begin my best validation thought 259 272 system("sync") == 0 or die "Couldn't sync?"; 260 273 my $uris = $neb->find_instances($key,$rep_vol); 261 274 @$uris = map {URI->new($_)->file if $_} @$uris; 262 275 my $tmpmd5 = local_md5sum(${ $uris }[0]); 263 # my $fh;264 # open($fh,${ $uris }[0]);265 # my $tmpmd5 = Digest::MD5->new->addfile($fh)->hexdigest;266 # close($fh);267 276 if ($tmpmd5 ne $md5sum) { 268 277 die "Post-replication md5sum does not match! $tmpmd5 != $md5sum"; 269 278 } 270 # End my best validation thought.279 # End my best validation thought. 271 280 } 272 281 } … … 280 289 if ($@) { die $@; } 281 290 282 # Begin my best validation thought291 # Begin my best validation thought 283 292 system("sync") == 0 or die "Couldn't sync?"; 284 293 my $uris = $neb->find_instances($key,$rep_vol); 285 294 @$uris = map {URI->new($_)->file if $_} @$uris; 286 287 # print $uris . " " . ${ $uris }[0] . " \n";288 295 my $tmpmd5 = local_md5sum(${ $uris }[0]); 289 # my $fh;290 # open($fh,${ $uris }[0]);291 # my $tmpmd5 = Digest::MD5->new->addfile($fh)->hexdigest;292 # close($fh);293 296 if ($tmpmd5 ne $md5sum) { 294 297 die "Post-replication md5sum does not match! $tmpmd5 != $md5sum"; 295 298 } 296 # End my best validation thought.299 # End my best validation thought. 297 300 298 301 } … … 309 312 # print "$existance[$i] $quality[$i] $md5sums[$i] $md5sum $diskhosts[$i] $diskvols[$i]\n"; 310 313 if ($quality[$i] != 1) { 314 if ($existance[$i] == 0) { # This disk file doesn't exist. 315 system("touch $files[$i]"); 316 } 311 317 my $cull_vol = $diskhosts[$i] . "." . $diskvols[$i]; 312 318 print "neb-cull --volume $cull_vol $key\n"; … … 314 320 # The tilde here is to force hard volumes. Don't touch it. 315 321 $neb->cull($key,"~${cull_vol}",2) or die "failed to cull a superfluous instance"; 316 if ($@) { die $@; }322 if ($@) { die "$@"; } 317 323 } 318 324 } -
Property svn:mergeinfo
set to (toggle deleted branches)
Note:
See TracChangeset
for help on using the changeset viewer.
