Skip to content

Bug: [warm-reboot] APPLY_VIEW may randomly mismatch identical virtual routers and recreate existing VLAN RIFs #28650

Description

@YairRaviv

Is it platform specific

generic

Importance or Severity

Critical

Description of the bug

During warm-reboot restoration, syncd compares the existing ASIC state with the new temporary ASIC view.
Each SONiC VRF is represented in the ASIC by a SAI virtual-router object.

When two (or more) virtual routers have identical SAI attributes, syncd cannot distinguish them during APPLY_VIEW:

2026 Jul 12 13:42:57.936458 WARNING syncd#SDK:
findCurrentBestMatchForGenericObjectUsingHeuristic:
heuristic failed for SAI_OBJECT_TYPE_VIRTUAL_ROUTER,
selecting at random (count: 10, exact match: 2)

If syncd selects the wrong match, the VLAN router interfaces appear to have moved between the two virtual routers, even though the configuration did not change.

For example, before warm reboot VLAN 1002 belongs to virtual router 0x100000003:

Create ROUTER_INTERFACE:
VIRTUAL_ROUTER [OID:0x100000003]
TYPE=VLAN
VLAN [vlan:1002]

After the incorrect match, APPLY_VIEW tries to create VLAN 1002 under virtual router 0x200000003:

2026 Jul 12 13:42:57.964115 NOTICE syncd#SDK:
Create ROUTER_INTERFACE:
TYPE=VLAN
VIRTUAL_ROUTER_ID=VIRTUAL_ROUTER [OID:0x200000003] [sx_router_id:2]
VLAN_ID=VLAN [OID:0x3EA00000026] [vlan:1002]

Result

The incorrect comparison generates unnecessary VLAN RIF create/remove operations. Creating the duplicate VLAN RIF fails:

2026 Jul 12 13:42:57.964571 ERR syncd#SDK:
VLAN RIF already exists (RIF ID 24), err = Entry Already Exists.

2026 Jul 12 13:42:57.964919 ERR syncd#SDK:
failed to create SAI_OBJECT_TYPE_ROUTER_INTERFACE
SAI_STATUS_ITEM_ALREADY_EXISTS

2026 Jul 12 13:42:57.964934 ERR syncd#SDK:
failed to execute api: create,
key: SAI_OBJECT_TYPE_ROUTER_INTERFACE:oid:0x6000000000c53,
status: SAI_STATUS_ITEM_ALREADY_EXISTS

Which leads to

  1. APPLY_VIEW stops after some ASIC operations may already have been executed (Warm-reboot reconciliation cannot complete.):
2026 Jul 12 13:42:57.965705 ERR syncd#SDK:
Error while executing asic operations, ASIC is in inconsistent state:
failed to execute api: create,
key: SAI_OBJECT_TYPE_ROUTER_INTERFACE:oid:0x6000000000c53,
status: SAI_STATUS_ITEM_ALREADY_EXISTS
  1. syncd reports that the ASIC is in an inconsistent state, enters shutdown-wait mode and stops processing normal ASIC operations:
2026 Jul 12 13:42:57.975201 ERR syncd#SDK:
Runtime error: failed to execute api: create,
key: SAI_OBJECT_TYPE_ROUTER_INTERFACE:oid:0x6000000000c53,
status: SAI_STATUS_ITEM_ALREADY_EXISTS
- entering shutdown-wait mode

2026 Jul 12 13:42:57.975206 NOTICE syncd#SDK:
sending switch_shutdown_request notification to OA
  1. syncd sends a shutdown request to orchagent - orchagent exits with status 1:
2026 Jul 12 16:42:57.975732 ERR swss#orchagent:
syncd_apply_view: Failed to notify syncd APPLY_VIEW -1

2026 Jul 12 16:42:57.975832 ERR swss#orchagent:
on_switch_shutdown_request: Syncd stopped

2026 Jul 12 16:42:57.979513 WARN swss#supervisord:
exited: orchagent (exit status 1; not expected)

2026 Jul 12 16:42:57.983289 INFO swss#supervisor-proc-exit-listener-rs:
Process 'orchagent' exited unexpectedly. Terminating supervisor 'swss'

Steps to Reproduce

  1. Create two VRFs.
  2. Create two VLAN interfaces for each VRF and add the required VLAN members.
  3. Bind each VLAN interface to its corresponding VRF.
  4. Save the configuration.
  5. Run warm-reboot repeatedly until the statistical issue reproduces.

Actual Behavior and Expected Behavior

Expected behavior

syncd should deterministically match each temporary virtual router with the current virtual router that owns the same VLAN interfaces.
Unchanged VLAN RIFs should not be removed or recreated.

Actual behavior

Unchanged VLAN RIFs be removed or recreated during warm-reboot restoration

Relevant log output

Output of show version, show techsupport

Attach files (if any)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions