Changeset 24996 for trunk/Nebulous/lib
- Timestamp:
- Aug 4, 2009, 11:42:45 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/lib/Nebulous/Client.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/lib/Nebulous/Client.pm
r24930 r24996 297 297 my $instances = $stats[6]; 298 298 if (defined $instances and $instances < 2) { 299 $ log->debug("can not cull - not enough instances");299 $self->set_err("can not cull - not enough instances"); 300 300 $log->debug("leaving"); 301 301 … … 305 305 $locations = $self->find_instances($key, $vol_name); 306 306 unless (defined $locations) { 307 $ log->debug( "no instances" );307 $self->set_err( "no instances" ); 308 308 $log->debug( "leaving" ); 309 309 … … 313 313 $locations = $self->find_instances($key); 314 314 unless ($locations) { 315 $ log->debug("no instances");315 $self->set_err( "no instances" ); 316 316 $log->debug("leaving"); 317 317 … … 320 320 321 321 if (scalar @{ $locations } < 2) { 322 $ log->debug("can not cull - not enough instances");322 $self->set_err("can not cull - not enough instances"); 323 323 $log->debug("leaving"); 324 324 … … 365 365 if (not defined $self->prune($key)) { 366 366 # use the prune() method to also determine if $key is valid 367 $removed = undef; 368 return; 367 die "invalid key: $key"; 369 368 } 370 369 … … 377 376 if (defined $locations) { 378 377 my $instances = $self->find_instances($key); 378 if (scalar @$instances < 2) { 379 die "not enough instances"; 380 } 379 381 foreach my $victim (@$instances) { 380 382 next if $victim eq $locations->[0]; … … 387 389 # start at one so cull() is called one less time then the # of 388 390 # instances 391 if ($stats->[6] < 2) { 392 die "not enough instances"; 393 } 389 394 for (my $i = 1; $i < $stats->[6]; $i++) { 390 395 $self->cull($key); … … 395 400 }; 396 401 if ($@) { 402 if ($@ =~ qr/invalid key/) { 403 $self->set_err($@); 404 return; 405 } 397 406 $log->logdie($@); 398 407 }
Note:
See TracChangeset
for help on using the changeset viewer.
