Skip to content

[warm restart assist] assume vector values could be reordered#921

Merged
yxieca merged 1 commit intosonic-net:masterfrom
yxieca:assist
Jun 3, 2019
Merged

[warm restart assist] assume vector values could be reordered#921
yxieca merged 1 commit intosonic-net:masterfrom
yxieca:assist

Conversation

@yxieca
Copy link
Contributor

@yxieca yxieca commented Jun 3, 2019

What I did

When comparing 2 vectors, assume their elements could be re-ordered.

Signed-off-by: Ying Xie [email protected]

Why I did it
Without he change, during warm reboot, some neighbor entries will be mistakenly judged as having new value and recreated.

How I verified it
With the change, no neighbor entry got recreated due to having 'new value' after warm reboot.

When comparing 2 vectors, assume their elements could be re-ordered.

Signed-off-by: Ying Xie <[email protected]>
@jipanyang
Copy link
Contributor

I would recommend switching to producerstatetabe view comparison mechanism as that being used in teamsyncd. It helps to reduce the maintenance effort, also producerstatetabe view comparison mechanism is more flexible.

@yxieca
Copy link
Contributor Author

yxieca commented Jun 3, 2019

@jipanyang can you point me to an example? I need to get the problem under control first. Can we move on then improve?

@yxieca
Copy link
Contributor Author

yxieca commented Jun 3, 2019

@jipanyang I found the code you are talking about. This code is not generic, it is written for team management only. There needs to have some refactoring and abstracting before it can be generally in other cases. Right? And the comparison is similar to what I added here too.

@yxieca yxieca merged commit f3d0279 into sonic-net:master Jun 3, 2019
@yxieca yxieca deleted the assist branch June 3, 2019 23:12
yxieca added a commit that referenced this pull request Jun 3, 2019
When comparing 2 vectors, assume their elements could be re-ordered.

Signed-off-by: Ying Xie <[email protected]>
@jipanyang
Copy link
Contributor

@jipanyang can you point me to an example? I need to get the problem under control first. Can we move on then improve?

View switch design and implementation:
https://github.com/Azure/SONiC/blob/master/doc/warm-reboot/view_switch.md
sonic-net/sonic-swss-common#247

Usage example:
#725

We found view switch mechanism is able to handle FV vectors with non-ordered and variable number of fields.
Not sure about 210811 branch, but for master branch I think we should move to view switch mechanism.

Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
…net#921)

When comparing 2 vectors, assume their elements could be re-ordered.

Signed-off-by: Ying Xie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants