mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Zeek Table<->Brokerstore: cleanup, documentation, small fixes
This commit adds script/c++ documentation and fixes a few loose ends. It also adds tests for corner cases and massively improves error messages. This also actually introduces type-compatibility checking and introduces a new attribute that lets a user override this if they really know what they are doing. I am not quite sure if we should really let that stay in - but it can be very convenient to have this functionality. One test is continuing to fail - the expiry test is very flaky. This is, I think, caused by delays of the broker store forwarding. I am unsure if we can actually do anything about that.
This commit is contained in:
parent
67917b83aa
commit
2b2a40f49c
26 changed files with 271 additions and 53 deletions
|
@ -1,11 +1,23 @@
|
|||
##! This script deals with the cluster parts of broker backed zeek tables.
|
||||
##! It makes sure that the master store is set correctly and that clones
|
||||
##! are automatically created on the non-manager nodes.
|
||||
|
||||
# Note - this script should become unnecessary in the future, when we just can
|
||||
# speculatively attach clones. This should be possible once the new ALM broker
|
||||
# transport becomes available.
|
||||
|
||||
@load ./main
|
||||
|
||||
module Broker;
|
||||
|
||||
export {
|
||||
## Event that is used by the manager to announce the master stores for zeek backed
|
||||
## tables that is uses.
|
||||
global announce_masters: event(masters: set[string]);
|
||||
}
|
||||
|
||||
# If we are not the manager - disable automatically generating masters. We will attach
|
||||
# clones instead.
|
||||
@if ( Cluster::is_enabled() && Cluster::local_node_type() != Cluster::MANAGER )
|
||||
redef Broker::auto_store_master = F;
|
||||
@endif
|
||||
|
@ -24,6 +36,7 @@ event zeek_init()
|
|||
}
|
||||
}
|
||||
|
||||
# Send the auto masters we created to the newly connected node
|
||||
event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) &priority=1
|
||||
{
|
||||
if ( ! Cluster::is_enabled() )
|
||||
|
@ -39,6 +52,7 @@ event Broker::announce_masters(masters: set[string])
|
|||
{
|
||||
for ( i in masters )
|
||||
{
|
||||
# this magic name for the store is created in broker/Manager.cc for the manager.
|
||||
local name = "___sync_store_" + i;
|
||||
Broker::create_clone(name);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue