Changeset 355

Show
Ignore:
Timestamp:
08/17/06 18:14:21 (2 years ago)
Author:
marksmith
Message:

* some minor cleanup
* make replicator warn that it's waiting for monitor only the second and later iterations,

so the monitor has a chance to go

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/server-newrepl/lib/MogileFS/Worker/Monitor.pm

    r353 r355  
    106106EOREQUEST 
    107107 
    108             # TODO: hosts aren't writable.  they're "available" 
    109108            # TODO: re-check the file was written as put. 
    110109            # TODO: put something unique in the file 
    111110            # TODO: guard against race-conditions with double-check on failure 
    112111 
     112            # at this point we can reach the host 
     113            $self->broadcast_host_reachable($dev->{hostid}); 
     114 
    113115            # now, depending on what happens 
    114116            my $resp = $ua->request($req); 
    115117            if ($resp->is_success) { 
    116                 $self->broadcast_host_reachable($dev->{hostid}); 
    117118                $self->broadcast_device_writeable($dev->{devid}); 
    118119                error("dev$dev->{devid}: used = $used, total = $total, writeable = 1") 
     
    120121            } else { 
    121122                # merely readable 
    122                 $self->broadcast_host_reachable($dev->{hostid}); 
    123123                $self->broadcast_device_readable($dev->{devid}); 
    124124                error("dev$dev->{devid}: used = $used, total = $total, writeable = 0") 
  • branches/server-newrepl/lib/MogileFS/Worker/Replicate.pm

    r353 r355  
    1717# actually be tried again and require some sort of manual intervention. 
    1818use constant ENDOFTIME => 2147483647; 
     19 
     20sub end_of_time { ENDOFTIME; } 
    1921 
    2022sub new { 
     
    4850    my $self = shift; 
    4951 
     52    my $run_count = 0; 
    5053    every(2.0, sub { 
    5154        $self->parent_ping; 
     
    5457        # marking things as being available 
    5558        unless ($self->monitor_has_run) { 
    56             error("waiting for monitor job to complete a cycle before beginning replication"); 
     59            # only warn on runs after the first.  gives the monitor job some time to work 
     60            # before we throw a message. 
     61            if ($run_count++ > 0) { 
     62                error("waiting for monitor job to complete a cycle before beginning replication"); 
     63            } 
    5764            return; 
    5865        }