Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldp]Fix the issue of only one field lldp_rem_time_mark in APPL_DB (#71
) 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
- Loading branch information