Skip to content
New issue

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

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

Already on GitHub? # to your account

[POC] Improve select and selectable to return same priority event by event happen time. #981

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Feb 27, 2025

Improve select and selectable to return same priority event by event happen time.

Why I did it

Fix issue sonic-net/sonic-buildimage#20941
selectable sort algorithm has 2 issue:

  1. sort recently selected object behind.
  2. return equal when 2 objects have same priority and used time.

How I did it

Change selectable sort algorithm:

  1. sort object by event happen time.
  2. return not equal when 2 objects have same priority and used time.
Work item tracking
  • Microsoft ADO: 30468564

How to verify it

Pass all test cases.
Pass all sonic-mgmt test with this PR: sonic-net/sonic-buildimage#21875

Manually build a POC and verify with following test steps:

sudo config vlan add 4094
sudo config vlan member add 4094 Ethernet64

sudo kill -s SIGSTOP $(pgrep -f /usr/bin/orchagent)

sudo config vlan member del 4094 Ethernet64
sudo config vlan del 4094

sudo truncate -s 0 /var/log/syslog
sudo kill -s SIGCONT $(pgrep -f /usr/bin/orchagent)
sudo cat /var/log/syslog

Result:

// VLAN_MEMBER delete event happen first and pop first:
2025 Feb 27 02:06:51.606321 vlab-01 NOTICE swss#orchagent: :- removeVlanMember: Remove member Ethernet64 from VLAN Vlan4094 lid:ffe vmid:2700000000069e
2025 Feb 27 02:06:51.606687 vlab-01 NOTICE swss#orchagent: :- flushFdbEntries: flush key: SAI_OBJECT_TYPE_FDB_FLUSH:oid:0x21000000000000, fields: 3
2025 Feb 27 02:06:51.606769 vlab-01 NOTICE swss#orchagent: :- recordFlushFdbEntries: flush key: SAI_OBJECT_TYPE_FDB_FLUSH:oid:0x21000000000000, fields: 3

2025 Feb 27 02:06:51.689459 vlab-01 NOTICE swss#orchagent: :- removeVlan: Remove VLAN Vlan4094 vid:4094

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Improve select and selectable to return same priority event by event happen time.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 changed the title [POC] improve select and selectable to return same priority event by event happen time. [POC] Improve select and selectable to return same priority event by event happen time. Feb 27, 2025
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants