sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
739 stars 1.43k forks source link

portsorch adds port to .1Q bridge while port is still configured as router port #13714

Open liorghub opened 1 year ago

liorghub commented 1 year ago

Description

portsorch adds port to 1Q bridge while port is configured as router port.

Steps to reproduce the issue:

Create PortChannel102 and set it as router port Make sure PortChannel102 has active neighbors. Now run the following commands using a shell script (not one by one)

  1. config interface ip remove PortChannel102 10.0.0.0/31
  2. config vlan add 1000
  3. config vlan member add 1000 PortChannel102

Describe the results you received:

Before removeRouterIntfs is completed due to neighbors reference count, addBridgePort is being called and adding the port to .1Q bridge.

Describe the results you expected:

Function addBridgePort should be called only after removeRouterIntfs is completed.

Output of show version:

SONiC-OS-master.458-fdfb35973

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

sonic_dump_c-panther-01_20230208_064248.tar.gz

Additional information you deem important (e.g. issue happens only occasionally):

arlakshm commented 1 year ago

can you update the issue with syslog and sairedis.rec logs which shows this behavior "Before removeRouterIntfs is completed due to neighbors reference count, addBridgePort is being called and adding the port to .1Q bridge."

liorghub commented 1 year ago

can you update the issue with syslog and sairedis.rec logs which shows this behavior "Before removeRouterIntfs is completed due to neighbors reference count, addBridgePort is being called and adding the port to .1Q bridge."

syslog: Jan 10 06:38:51.017672 arc-switch1025 NOTICE swss#orchagent: :- addRouterIntfs: Create router interface PortChannel105 MTU 9100 Jan 10 06:42:32.176697 arc-switch1025 NOTICE swss#orchagent: :- removeRouterIntfs: Router interface is still referenced Jan 10 06:42:35.887060 arc-switch1025 NOTICE swss#orchagent: message repeated 2 times: [ :- removeRouterIntfs: Router interface is still referenced] Jan 10 06:42:48.214148 arc-switch1025 NOTICE swss#orchagent: :- removeRouterIntfs: Router interface is still referenced Jan 10 06:42:48.262013 arc-switch1025 NOTICE swss#orchagent: :- removeRouterIntfs: Router interface is still referenced Jan 10 06:42:48.274781 arc-switch1025 NOTICE swss#orchagent: :- addBridgePort: Add bridge port PortChannel105 to default 1Q bridge Jan 10 06:42:48.283839 arc-switch1025 NOTICE swss#orchagent: :- removeRouterIntfs: Router interface is still referenced Jan 10 06:42:48.296476 arc-switch1025 NOTICE swss#orchagent: :- removeRouterIntfs: Router interface is still referenced Jan 10 06:42:48.303898 arc-switch1025 NOTICE swss#orchagent: message repeated 3 times: [ :- removeRouterIntfs: Router interface is still referenced] Jan 10 06:42:48.308390 arc-switch1025 NOTICE swss#orchagent: :- removeRouterIntfs: Router interface is still referenced

sairedis.rec.1: /tmp/redmine_3326236_attachments/sonic_dump_arc-switch1025_20230110_070642/log/sairedis.rec.1:2023-01-10.04:38:51.006653|c|SAI_OBJECT_TYPE_ROUTER_INTERFACE:oid:0x60000000009db|SAI_ROUTER_INTERFACE_ATTR_VIRTUAL_ROUTER_ID=oid:0x3000000000002|SAI_ROUTER_INTERFACE_ATTR_SRC_MAC_ADDRESS=50:6B:4B:8F:CE:40|SAI_ROUTER_INTERFACE_ATTR_TYPE=SAI_ROUTER_INTERFACE_TYPE_PORT|SAI_ROUTER_INTERFACE_ATTR_PORT_ID=oid:0x20000000009c3|SAI_ROUTER_INTERFACE_ATTR_MTU=9100

/tmp/redmine_3326236_attachments/sonic_dump_arc-switch1025_20230110_070642/log/sairedis.rec.1:2023-01-10.04:42:48.264211|c|SAI_OBJECT_TYPE_BRIDGE_PORT:oid:0x3a000000000c02|SAI_BRIDGE_PORT_ATTR_TYPE=SAI_BRIDGE_PORT_TYPE_PORT|SAI_BRIDGE_PORT_ATTR_PORT_ID=oid:0x20000000009c3|SAI_BRIDGE_PORT_ATTR_ADMIN_STATE=true|SAI_BRIDGE_PORT_ATTR_FDB_LEARNING_MODE=SAI_BRIDGE_PORT_FDB_LEARNING_MODE_HW