mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Add sending of values to nodes that dropped out.
The only node that cannot be recovered is the manager - and the manager should just re-read its own configuration and be ok :)
This commit is contained in:
parent
5f07673e25
commit
c28f1ae0ce
8 changed files with 48 additions and 21 deletions
|
@ -62,7 +62,6 @@ event bro_init()
|
|||
Broker::subscribe(change_topic);
|
||||
}
|
||||
|
||||
|
||||
event Config::cluster_set_option(ID: string, val: any, location: string)
|
||||
{
|
||||
@if ( Cluster::local_node_type() == Cluster::MANAGER )
|
||||
|
@ -103,17 +102,12 @@ function set_value(ID: string, val: any, location: string &default = "" &optiona
|
|||
|
||||
@if ( Cluster::is_enabled() && Cluster::local_node_type() == Cluster::MANAGER )
|
||||
# Handling of new worker nodes.
|
||||
event Cluster::node_up(name: string, id: string)
|
||||
event Cluster::node_up(name: string, id: string) &priority=-10
|
||||
{
|
||||
# When a node connects, send it all current Option values.
|
||||
if ( name in Cluster::nodes )
|
||||
{
|
||||
print option_cache;
|
||||
for ( ID in option_cache )
|
||||
{
|
||||
Broker::publish(Cluster::node_topic(name), Config::cluster_set_option, ID, option_cache[ID]$val, option_cache[ID]$location);
|
||||
}
|
||||
}
|
||||
}
|
||||
@endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue