Skip to content

Commit 862ec93

Browse files
committed
add comment for skip_appl_del
1 parent 6e68a89 commit 862ec93

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py

+12
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ def set_handler(self, key, data):
8181

8282

8383
def skip_appl_del(self, vrf, ip_prefix):
84+
"""
85+
If a static route is bfd enabled, the processed static route is written into application DB by staticroutebfd.
86+
When we disable bfd for that route at runtime, that static route entry will be removed from APPL_DB STATIC_ROUTE_TABLE.
87+
In the case, the StaticRouteMgr(appl_db) cannot uninstall the static route from FRR if the static route is still in CONFIG_DB,
88+
so need this checking (skip appl_db deletion) to avoid race condition between StaticRouteMgr(appl_db) and StaticRouteMgr(config_db)
89+
For more detailed information:
90+
https://github.com/sonic-net/SONiC/blob/master/doc/static-route/SONiC_static_route_bfd_hld.md#bfd-field-changes-from-true-to-false
91+
92+
:param vrf: vrf from the split_key(key) return
93+
:param ip_prefix: ip_prefix from the split_key(key) return
94+
:return: True if the deletion comes from APPL_DB and the vrf|ip_prefix exists in CONFIG_DB, otherwise return False
95+
"""
8496
if self.db_name == "CONFIG_DB":
8597
return False
8698

0 commit comments

Comments
 (0)