snar / bgpq3

bgpq3
BSD 2-Clause "Simplified" License
363 stars 53 forks source link

Only inital result set is returned when specifying multiple IRR sources #25

Closed htj closed 8 years ago

htj commented 8 years ago

htj@pyrite:~$ bgpq3 -jf1 -S JPIRR AS-SINET {"NN": [ 2501,2503,2504,2505,2506,2508,2513,2523, 2907,3488,4707,4729,4730,7509,7531,7660, 9355,9367,9372,9591,9991,10014,17521,17523, 17532,17674,17687,17701,17932,17943,17944,17946, 17956,17960,18076,18087,18091,18123,18124,18125, 18127,18128,18148,18267,18276,18279,18286,23456, 23615,23623,23781,23793,23799,23800,23803,23807, 23826,24248,24254,24260,24261,24264,24268,24287, 24297,24470,37889,37895,37909,37910,37914,37917, 37918,37920,37984,38635,38641,45673,45685,45688, 55372,55373,55379,55380,55390,55904,55909,55910, 55911,55912,56218,58647,58652,58784,58785,59091, 59096,59100,59103,59104,59111,59115 ]} htj@pyrite:~$ bgpq3 -jf1 -S RIPE AS-SINET {"NN": [ 6736,12880,15611,21341,25306,34918,42586,43135, 43343,43395,44889,49100,56796,59961,62367 ]} htj@pyrite:~$ bgpq3 -jf1 -S RIPE,JPIRR AS-SINET {"NN": [ 6736,12880,15611,21341,25306,34918,42586,43135, 43343,43395,44889,49100,56796,59961,62367 ]}

Is this intentional? If I specify multiple sources, I'd expect the result from both to be included.

bgpq3 version is 0.1.31 (and same behaviour with .30)

snar commented 8 years ago

On Fri, Apr 08, 2016 at 02:48:25AM -0700, Henrik Thostrup Jensen wrote:

Is this intentional? If I specify multiple sources, I'd expect the result from both to be included.

Please, note that bgpq3 does not perform multiple per-source searches itself, -S just instructs IRRD what sources to use before invoking search commands:

snar@fri:~/compile/bgpq3>./bgpq3 -jf1 -ddddS jpirr,ripe AS-SINET DEBUG: bgpq_expander.c:742 bgpq_expand Acquired sendbuf of 1065728 bytes DEBUG: bgpq_expander.c:771 bgpq_expand Requesting sources !sjpirr,ripe ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DEBUG: bgpq_expander.c:775 bgpq_expand Got answer C DEBUG: bgpq_expander.c:597 bgpq_expand_irrd expander: sending '!iAS-SINET,1

And, as per irrd user manual (http://www.irrd.net/irrd-user.pdf, p. 35):

[quote starts] The !i command searches the databases in the order specified by the user and returns when it finds an object. When the ,1 option is specified to indicate embedded set expansion, the command will expand embedded sets using the database where the set was found. The other database sources, as specified by the user, will only be used when a match is not found in the source in which the set was found. Therefore in the above sample command !iAS-ICINET,1, assuming the specified search order is RADB, RIPE, Cable & Wireless, and the embedded set AS-LTINET is found in the RIPE registry, AS-LTINET will be expanded first in the RIPE registry, rather than in the RADB. [/quote ends]

So, yes, this is intended behaviour (of IRRd).

htj commented 8 years ago

Fair enough.

I would update the bgpq3 help output though. Right now it says:

-S sources: use only specified sources (default: RADB,RIPE,APNIC)

The use of plural is pretty confusing and does not match the above.