Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldp]Fix the issue of only one field lldp_rem_time_mark in APPL_DB #71

Merged
merged 4 commits into from
Dec 5, 2024

Conversation

ZhaohuiS
Copy link
Contributor

@ZhaohuiS ZhaohuiS commented Dec 4, 2024

  • Description:

It still has the following syslog:
2024 Dec 2 18:22:18.291732 bjw2-can-7260-3 WARNING snmp#snmp-subagent [sonic_ax_impl] WARNING: Exception when updating lldpRemTable: 'lldp_rem_index'

It always happened for eth0, the LLDP_ENTRY_TABLE in APPL_DB for eth0 is like this:
{'lldp_rem_time_mark': '3886'}

reproduce steps:

docker exec syncd supervisorctl stop syncd
docker exec swss supervisorctl stop orchagent

docker exec syncd supervisorctl start syncd
docker exec swss supervisorctl start orchagent

Root cause:

restart syncd and orchagent, other interfaces are down, but eth0 is still up. So, it is always in changed list and still it thinks the only changed field is lldp_rem_time_mark. But APPL_DB was flushed, the LLDP_ENTRY_TABLE:eth0 is empty. During every lldp-syncd daemon run function, it only updates the lldp_rem_time_mark field for eth0. And it doesn't have other chance to write other fields into the table, except shutdown/ no shutdown eth0 or restart lldp.

  • How to fix:

repopulate APPL_DB lldp table for changed interface if detects any new or deleted interfaces.
Even syncd or orchagent restarts, other interfaces will down and then up, eth0 still has change to rewrite all fields

  • Test:
admin@str2-7260cx3-acs-12:/var/log$ sonic-db-cli APPL_DB FLUSHDB
True
admin@str2-7260cx3-acs-12:/var/log$ sonic-db-cli APPL_DB hgetall LLDP_ENTRY_TABLE:eth0
{'lldp_rem_time_mark': '504'}
admin@str2-7260cx3-acs-12:/var/log$ sonic-db-cli APPL_DB hgetall LLDP_ENTRY_TABLE:eth0
{'lldp_rem_time_mark': '504'}
admin@str2-7260cx3-acs-12:/var/log$ sonic-db-cli APPL_DB hgetall LLDP_ENTRY_TABLE:Ethernet68
{'lldp_rem_time_mark': '519'}
admin@str2-7260cx3-acs-12:/var/log$ sudo config interface shutdown Ethernet68
admin@str2-7260cx3-acs-12:/var/log$ sonic-db-cli APPL_DB hgetall LLDP_ENTRY_TABLE:Ethernet68
{}
admin@str2-7260cx3-acs-12:/var/log$ sonic-db-cli APPL_DB hgetall LLDP_ENTRY_TABLE:eth0
{'lldp_rem_sys_cap_enabled': '28 00', 'lldp_rem_man_addr': '', 'lldp_rem_sys_desc': 'Cisco Nexus Operating System (NX-OS) Software 6.0(2)U6(7)
TAC support: http://www.cisco.com/tac
Copyright (c) 2002-2016, Cisco Systems, Inc. All rights reserved.', 'lldp_rem_index': '1', 'lldp_rem_port_desc': 'Ethernet1/5', 'lldp_rem_chassis_id_subtype': '4', 'lldp_rem_port_id': 'Ethernet1/5', 'lldp_rem_port_id_subtype': '5', 'lldp_rem_time_mark': '695', 'lldp_rem_sys_name': 'STR-MGSW-254-C14.ntwk.msn.net', 'lldp_rem_sys_cap_supported': '28 00', 'lldp_rem_chassis_id': 'ac:4a:67:d4:fe:ac'}
  • Microsoft work item

30233240

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
@ZhaohuiS ZhaohuiS force-pushed the fix/lldp_repopulate branch from b9245f9 to 7205f79 Compare December 5, 2024 03:55
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
@ZhaohuiS ZhaohuiS requested a review from StormLiangMS December 5, 2024 09:27
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
Copy link

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StormLiangMS StormLiangMS merged commit b0ea01f into sonic-net:master Dec 5, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants