… | |
… | |
535 | } |
535 | } |
536 | ; |
536 | ; |
537 | } |
537 | } |
538 | |
538 | |
539 | sub seed_all { |
539 | sub seed_all { |
540 | my @seeds = grep { |
540 | my @seeds; |
541 | !exists $SEED_CONNECT{$_} |
541 | |
|
|
542 | for (grep !exists $SEED_CONNECT{$_}, keys %SEED_NODE) { |
542 | && !(defined $SEED_NODE{$_} && node_is_up $SEED_NODE{$_}) |
543 | if (defined $SEED_NODE{$_} && node_is_up $SEED_NODE{$_})) { |
543 | } keys %SEED_NODE; |
544 | # node is up, make sure it's running the global service |
|
|
545 | snd $_, "g_slave" |
|
|
546 | unless $NODE{$_}{transport}{remote_greeting}{global}; |
|
|
547 | } else { |
|
|
548 | # else node is down, we need to seed |
|
|
549 | push @seeds, $_; |
|
|
550 | } |
|
|
551 | } |
544 | |
552 | |
545 | if (@seeds) { |
553 | if (@seeds) { |
546 | # start connection attempt for every seed we are not connected to yet |
554 | # start connection attempt for every seed we are not connected to yet |
547 | seed_connect $_ |
555 | seed_connect $_ |
548 | for @seeds; |
556 | for @seeds; |