Skip to content

Remove system neigh DEL operation if SET operation succeeds#2853

Merged
prsunny merged 1 commit intosonic-net:masterfrom
ysmanman:voq-neigh-fix
Jul 18, 2023
Merged

Remove system neigh DEL operation if SET operation succeeds#2853
prsunny merged 1 commit intosonic-net:masterfrom
ysmanman:voq-neigh-fix

Conversation

@ysmanman
Copy link
Copy Markdown
Contributor

@ysmanman ysmanman commented Jul 9, 2023

What I did
Remove system neighbor DEL operation in m_toSync if SET operation for the same neighbor succeeds. This is to avoid mistakenly removing the system neighbor.

Why I did it
Fix sonic-net/sonic-buildimage#15266

How I verified it
sonic-net/sonic-buildimage#15266 was uncovered by https://github.com/sonic-net/sonic-mgmt/blob/master/tests/voq/test_voq_disrupts.py. The issue was not seen in the test anymore with the fix.

Details if related

@ysmanman ysmanman requested a review from prsunny as a code owner July 9, 2023 05:27
@ysmanman
Copy link
Copy Markdown
Contributor Author

ysmanman commented Jul 9, 2023

Add @arlakshm @kenneth-arista for visibility.

Copy link
Copy Markdown
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

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

lgtm

@kenneth-arista
Copy link
Copy Markdown
Contributor

This fix will likely also address sonic-net/sonic-mgmt#8588

@arlakshm
Copy link
Copy Markdown
Contributor

@ysmanman, can you rebase the branch?

@ysmanman
Copy link
Copy Markdown
Contributor Author

@ysmanman, can you rebase the branch?

Hi @arlakshm rebased just now.

@ysmanman
Copy link
Copy Markdown
Contributor Author

/Azpw run Azure.sonic-swss

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-swss

@azure-pipelines
Copy link
Copy Markdown

No commit pushedDate could be found for PR 2853 in repo sonic-net/sonic-swss

the same neighbor succeeds. This is to avoid mistakenly removing the
system neighbor.

Fix sonic-net/sonic-buildimage#15266.
@prsunny prsunny merged commit cb1b3f4 into sonic-net:master Jul 18, 2023
@StormLiangMS
Copy link
Copy Markdown
Contributor

@prsunny could we have an ADO to track this?

@prsunny
Copy link
Copy Markdown
Collaborator

prsunny commented Jul 19, 2023

@prsunny could we have an ADO to track this?

@arlakshm, do you have one?

@arlakshm
Copy link
Copy Markdown
Contributor

@prsunny could we have an ADO to track this?

@arlakshm, do you have one?

@StormLiangMS @prsunny this is the ADO# 24596307

theasianpianist pushed a commit to theasianpianist/sonic-swss that referenced this pull request Jul 20, 2023
…sonic-net#2853)

*Remove system neighbor DEL operation in m_toSync if SET operation for the same neighbor succeeds. This is to avoid mistakenly removing the system neighbor.

Fix sonic-net/sonic-buildimage#15266.
*/
auto rit = make_reverse_iterator(it);
while (rit != consumer.m_toSync.rend() && rit->first == key && kfvOp(rit->second) == DEL_COMMAND)
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i thought m_toSync will only have one entry for each neighbor, i didn't know if we have multiple entry for the same neighbor, just curious.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why this problem is voq neighbor specificially? for normal neighbor, why we do not have such problem?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i thought m_toSync will only have one entry for each neighbor, i didn't know if we have multiple entry for the same neighbor, just curious.

m_toSync is type of std::multimap, so it allows multiple actions (like DEL and SET) for the same neighbor.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

why this problem is voq neighbor specificially? for normal neighbor, why we do not have such problem?

This problem is not voq specific. The same change/fix exists for local neighbor too. The PR is to apply the same fix for voq.

* Since DEL operation is supposed to be executed before SET for the same neighbor
* A remaining DEL after the SET operation means the DEL operation failed previously and should not be executed anymore
*/
auto rit = make_reverse_iterator(it);
Copy link
Copy Markdown
Contributor

@lguohan lguohan Jul 20, 2023

Choose a reason for hiding this comment

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

sigh, we should have tab space aligned. @arlakshm , @ysmanman . I feel being insulted. @prsunny

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sigh, we should have tab space aligned. @arlakshm , @ysmanman . I feel being insulted. @prsunny

I can raise a PR to fix the indentation.

yxieca pushed a commit that referenced this pull request Jul 21, 2023
…#2853)

*Remove system neighbor DEL operation in m_toSync if SET operation for the same neighbor succeeds. This is to avoid mistakenly removing the system neighbor.

Fix sonic-net/sonic-buildimage#15266.
StormLiangMS pushed a commit that referenced this pull request Aug 6, 2023
…#2853)

*Remove system neighbor DEL operation in m_toSync if SET operation for the same neighbor succeeds. This is to avoid mistakenly removing the system neighbor.

Fix sonic-net/sonic-buildimage#15266.
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
…sonic-net#2853)

*Remove system neighbor DEL operation in m_toSync if SET operation for the same neighbor succeeds. This is to avoid mistakenly removing the system neighbor.

Fix sonic-net/sonic-buildimage#15266.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[VOQ] system neigh was not installed in kernel

8 participants