Symptom
show bgp vrf bestpath-compare command output is showing wrong reason for the best-path selection.
For example in the below output the reason for bestpath is wrong even though the paths are from the same neighbor:
RP/0/0/CPU0:XR#show bgp vrf vrf1 0.0.0.0/0 bestpath-compare
BGP routing table entry for 0.0.0.0/0, Route Distinguisher: 51.51.51.51:1
Versions:
Process bRIB/RIB SendTblVer
Speaker 104624 104624
Last Modified: May 22 14:29:33.396 for 00:19:25
Paths: (2 available, best #2)
Advertised to CE peers (in unique update groups):
31.1.1.2
Path #1: Received by speaker 0
Not advertised to any peer
100
3.3.3.3 (metric 2) from 3.3.3.3 (3.3.3.3)
Received Label 17534
Origin IGP, localpref 100, valid, external, imported
Received Path ID 0, Local Path ID 0, version 0
Community: 1:1
Extended community: RT:200:1
Higher neighbor address than best path (path #2) <<<<<<<<<<<<<<<<<<<<<<<<
Source VRF: default, Source Route Distinguisher: 11.11.11.11:1
Path #2: Received by speaker 0
Advertised to CE peers (in unique update groups):
31.1.1.2
100
3.3.3.3 (metric 2) from 3.3.3.3 (3.3.3.3)
Received Label 17504
Origin IGP, localpref 100, valid, external, best, group-best, import-candidate, imported
Received Path ID 0, Local Path ID 1, version 104624
Community: 2:2
Extended community: RT:200:1
best of AS 100, Overall best
Source VRF: default, Source Route Distinguisher: 21.21.21.21:1
RP/0/0/CPU0:XR#
Conditions
If all attributes in path selection are equal, the last received path would be selected as best.