route export number discrepancy

michal.nowak at lnk.ro michal.nowak at lnk.ro
Sun Feb 3 08:14:21 CET 2019


On Sat, Feb 02, 2019 at 02:50:39PM +0300, Ondrej Zajicek wrote:

> This is likely just integer overflow during counter decrease, it is
> mostly harmless. We will see how to fix it.

Hi Ondrej, thanks for quick response, and yes I agree that its mostly harmless,
yet it upsets our monitoring, so I need to get to the bottom of it at some point.


> But more people wanted it back and it seems that we can redefine it to
> both fit to per-channel stats and be less confusing (by counting best
> routes in adjacent routing table only), so it is back in the devel
> code in git, with slightly different meaning.

OK, I see that commit, but that would not display preferred counters if
the 'keep filtered' is enabled on a given protocol.

  if (c->in_keep_filtered)
    cli_msg(-1006, "    Routes:         %u imported, %u filtered, %u exported",
	    s->imp_routes, s->filt_routes, s->exp_routes);
  else
    cli_msg(-1006, "    Routes:         %u imported, %u exported, %u preferred",
	    s->imp_routes, s->exp_routes, s->pref_routes);


My preference would be to print out all the 4 counters (including 0 for filtered 
if disabled), and the rationale behind this idea is that this would allow for at least
some degree of backwards compatibility with scripts that used to parse the Routes line
in bird 1.6 deployments, which again for reference used to look like this:

 Routes:         0 imported, 0 filtered, 0 exported, 0 preferred


So perhaps something among the lines of the below would be acceptable:

diff --git a/nest/proto.c b/nest/proto.c
index ab92d90..a68302d 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -1692,12 +1692,8 @@ channel_show_stats(struct channel *c)
 {
   struct proto_stats *s = &c->stats;
 
-  if (c->in_keep_filtered)
-    cli_msg(-1006, "    Routes:         %u imported, %u filtered, %u exported",
-           s->imp_routes, s->filt_routes, s->exp_routes);
-  else
-    cli_msg(-1006, "    Routes:         %u imported, %u exported, %u preferred",
-           s->imp_routes, s->exp_routes, s->pref_routes);
+  cli_msg(-1006, "    Routes:         %u imported, %u filtered, %u exported, %u preferred",
+         s->imp_routes, s->filt_routes, s->exp_routes, s->pref_routes);
 
   cli_msg(-1006, "    Route change stats:     received   rejected   filtered    ignored   accepted");


Let me know what you think.


   cli_msg(-1006, "      Import updates:     %10u %10u %10u %10u %10u",



More information about the Bird-users mailing list