Skip to content

Bug: frrcfgd fails to apply config if PREFIX_SET and PREFIX tables are updated together #22974

@jmlu-arista

Description

@jmlu-arista

Is it platform specific

generic

Importance or Severity

Medium

Description of the bug

When applying a ConfigDB snippet that updates the PREFIX_SET and PREFIX tables for one prefix set, frrcfgd will fail to apply the change. Regardless of the ordering of JSON keys, it will see the PREFIX table updated before PREFIX_SET, and throw an error ERR bgp#frrcfgd: could not find prefix-set test_prefix_set from cache

A workaround is to apply the PREFIX_SET and PREFIX changes in two separate JSON inputs, but having to do this is a lot more cumbersome.

Steps to Reproduce

Apply this ConfigDB snippet using config load:

{
  "PREFIX_SET": {
    "test_prefix_set": {
      "mode": "IPv4"
    }
  },
  "PREFIX": {
    "test_prefix_set|10.1.0.0/24|exact": {
      "action": "permit"
    }
  }
}

Actual Behavior and Expected Behavior

Expected behaviour: A new IP prefix set is created; ip prefix-list test_prefix_set seq 5 permit 10.1.0.0/24 appears in FRR config

Actual behaviour: The IP prefix set is not added, and an error is logged instead

Relevant log output

2025 Jun 13 18:42:33.662960 dut DEBUG bgp#frrcfgd: ----------------------------------
2025 Jun 13 18:42:33.662960 dut DEBUG bgp#frrcfgd:  BGP table handling
2025 Jun 13 18:42:33.663202 dut DEBUG bgp#frrcfgd: ----------------------------------
2025 Jun 13 18:42:33.663202 dut DEBUG bgp#frrcfgd: table : PREFIX
2025 Jun 13 18:42:33.663202 dut DEBUG bgp#frrcfgd: key   : test_prefix_set|10.1.0.0/24|exact
2025 Jun 13 18:42:33.663202 dut DEBUG bgp#frrcfgd: op    : SET
2025 Jun 13 18:42:33.663202 dut DEBUG bgp#frrcfgd: data  :
2025 Jun 13 18:42:33.663241 dut DEBUG bgp#frrcfgd:         action     - permit
2025 Jun 13 18:42:33.663241 dut DEBUG bgp#frrcfgd:
2025 Jun 13 18:42:33.663280 dut INFO bgp#frrcfgd: value for table PREFIX prefix test_prefix_set key 10.1.0.0/24|exact changed to {'action': (permit, ADD)}
2025 Jun 13 18:42:33.663280 dut ERR bgp#frrcfgd: could not find prefix-set test_prefix_set from cache
2025 Jun 13 18:42:33.663280 dut DEBUG bgp#frrcfgd: ignore cache update for action because of STAT_FAIL
2025 Jun 13 18:42:33.663309 dut INFO bgp#frrcfgd: delete table row PREFIX&&test_prefix_set|10.1.0.0/24|exact from cache
2025 Jun 13 18:42:33.663438 dut DEBUG bgp#frrcfgd: ----------------------------------
2025 Jun 13 18:42:33.663557 dut DEBUG bgp#frrcfgd:  BGP table handling
2025 Jun 13 18:42:33.663557 dut DEBUG bgp#frrcfgd: ----------------------------------
2025 Jun 13 18:42:33.663571 dut DEBUG bgp#frrcfgd: table : PREFIX_SET
2025 Jun 13 18:42:33.663585 dut DEBUG bgp#frrcfgd: key   : test_prefix_set
2025 Jun 13 18:42:33.663601 dut DEBUG bgp#frrcfgd: op    : SET
2025 Jun 13 18:42:33.663617 dut DEBUG bgp#frrcfgd: data  :
2025 Jun 13 18:42:33.663633 dut DEBUG bgp#frrcfgd:         mode       - IPv4
2025 Jun 13 18:42:33.663649 dut DEBUG bgp#frrcfgd:
2025 Jun 13 18:42:33.663666 dut INFO bgp#frrcfgd: value for table PREFIX_SET prefix test_prefix_set key None changed to {'mode': (IPv4, ADD)}
2025 Jun 13 18:42:33.663724 dut INFO bgp#frrcfgd: Add mode data IPv4 to cache

Output of show version, show techsupport

Attach files (if any)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions