From 369d3e117cd98d9f0fe2f6f013567eda713d4b0f Mon Sep 17 00:00:00 2001 From: Annika Hannig Date: Thu, 8 Feb 2024 15:13:38 +0100 Subject: [PATCH] set default values for community filter cutoff and query limit --- etc/alice-lg/alice.example.conf | 2 +- pkg/config/config.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/etc/alice-lg/alice.example.conf b/etc/alice-lg/alice.example.conf index 9de915f8..94197aed 100644 --- a/etc/alice-lg/alice.example.conf +++ b/etc/alice-lg/alice.example.conf @@ -43,7 +43,7 @@ neighbors_store_refresh_interval = 5 # Maximum number of routes returned from the store in a prefix # search, to avoid timeouts with too big result sets. # This is important when querying BGP communities, as some might -# match a large number of routes. +# match a large number of routes. (Default: 200000) routes_store_query_limit = 200000 # Add a delay to the stream parser in order to reduce diff --git a/pkg/config/config.go b/pkg/config/config.go index 905f9ece..cc255036 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -74,6 +74,10 @@ const ( // routes after which the community filter will not be // available. DefaultPrefixLookupCommunityFilterCutoff = 100000 + + // DefaultRoutesStoreQueryLimit is the default limit for + // prefixes returned from the store. + DefaultRoutesStoreQueryLimit = 200000 ) // A ServerConfig holds the runtime configuration @@ -940,6 +944,7 @@ func LoadConfig(file string) (*Config, error) { StoreBackend: "memory", RoutesStoreRefreshParallelism: 1, NeighborsStoreRefreshParallelism: 1, + RoutesStoreQueryLimit: DefaultRoutesStoreQueryLimit, } if err := parsedConfig.Section("server").MapTo(&server); err != nil { return nil, err