Skip to content

[mclag]:add mclagsyncd#811

Merged
rlhui merged 14 commits intosonic-net:masterfrom
shine4chen:mclagsyncd
Mar 22, 2020
Merged

[mclag]:add mclagsyncd#811
rlhui merged 14 commits intosonic-net:masterfrom
shine4chen:mclagsyncd

Conversation

@shine4chen
Copy link
Copy Markdown
Contributor

What I did
add mclagsyncd

Why I did it
accomplish it according to MCLAG HLD document

How I verified it
test it on nephos lab

Details if related
Please refer #sonic-net/SONiC#325

shine4chen and others added 2 commits February 13, 2019 17:59
Signed-off-by: shine.chen <shine.chen@nephosinc.com>
@shine4chen shine4chen changed the title add mclagsyncd for mclag feature [mclag]:add mclagsyncd Mar 11, 2019
shine.chen added 2 commits March 18, 2019 19:58
Signed-off-by: shine.chen <shine.chen@nephosinc.com>
Signed-off-by: shine.chen <shine.chen@nephosinc.com>
Signed-off-by: shine.chen <shine.chen@nephosinc.com>
Comment thread mclagsyncd/mclaglink.cpp Outdated
@lguohan lguohan requested a review from rlhui August 1, 2019 17:56
Comment thread mclagsyncd/mclaglink.cpp Outdated
Comment thread mclagsyncd/mclaglink.h Outdated
Copy link
Copy Markdown
Contributor

@stcheng stcheng left a comment

Choose a reason for hiding this comment

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

please address the comments

Comment thread mclagsyncd/mclaglink.h Outdated
Comment thread mclagsyncd/mclaglink.h Outdated
Comment thread mclagsyncd/mclaglink.cpp Outdated
Comment thread mclagsyncd/mclaglink.h Outdated
Comment thread mclagsyncd/mclaglink.cpp Outdated
Comment thread mclagsyncd/mclaglink.cpp Outdated
Signed-off-by: shine.chen <shine.chen@nephosinc.com>
lisahnguyen
lisahnguyen previously approved these changes Sep 18, 2019
Copy link
Copy Markdown

@lisahnguyen lisahnguyen left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my review comment.

gitsabari
gitsabari previously approved these changes Sep 18, 2019
Copy link
Copy Markdown
Contributor

@gitsabari gitsabari left a comment

Choose a reason for hiding this comment

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

thanks for taking care of review comments

Signed-off-by: shine.chen <shine.chen@mediatek.com>
@shine4chen
Copy link
Copy Markdown
Contributor Author

retest this please.

Signed-off-by: shine.chen <shine.chen@mediatek.com>
@shine4chen
Copy link
Copy Markdown
Contributor Author

retest this please

@lguohan
Copy link
Copy Markdown
Contributor

lguohan commented Nov 12, 2019

I saw binary in the pr. please remove the binary.

Signed-off-by: shine.chen <shine.chen@mediatek.com>
@shine4chen
Copy link
Copy Markdown
Contributor Author

@lguohan Thanks, done

Signed-off-by: shine.chen <shine.chen@mediatek.com>
rlhui
rlhui previously approved these changes Nov 22, 2019
@shine4chen
Copy link
Copy Markdown
Contributor Author

retest this please

stcheng
stcheng previously approved these changes Nov 26, 2019
@shine4chen
Copy link
Copy Markdown
Contributor Author

retest this please

1 similar comment
@shine4chen
Copy link
Copy Markdown
Contributor Author

retest this please

Signed-off-by: shine.chen <shine.chen@mediatek.com>
@shine4chen shine4chen dismissed stale reviews from stcheng, rlhui, gitsabari, and lisahnguyen via b44975f February 3, 2020 05:39
@shine4chen
Copy link
Copy Markdown
Contributor Author

@stcheng @rlhui @gitsabari @lisahnguyen I resolved some conflict and system automatically dismiss your approve. Would you please help to review and approve it again ?

@shine4chen shine4chen requested a review from rlhui February 4, 2020 09:17
@shine4chen shine4chen requested review from rlhui and removed request for rlhui February 12, 2020 03:21
@rlhui rlhui merged commit 0de72da into sonic-net:master Mar 22, 2020
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
Signed-off-by: Antony Rheneus <arheneus@marvell.com>
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
jianyuewu pushed a commit to jianyuewu/sonic-swss that referenced this pull request Dec 24, 2025
…#811)

**What I did**
Fix the issue of ignoring callback calls for removed keys.

**Why I did it**
ConfigDBConnector.listen method has a caching mechanism (added in sonic-net/sonic-swss-common#587 PR) that preloads the DB state before starting. When the notification about the changed key is received the listen method gets key data from the DB (in all cases when the key was added, updated, or removed) and compares the data with the cache. It fires the callback only if data differ from the cache. Otherwise, the callback is ignored. 

If the `client.hgetall(key)` is called for the removed key it returns an empty dictionary (`{}`). This can be confused with the data of the key with no attributes. For example: `{"TABLE": {"KEY": {}}}`. 

So if preloaded data contains a key with no attributes and the listener method receives a notification about the removal of such key the callback is not called. The listener will simply remove the key from the cache without calling the callback. This leads to the situation when the removal of the key is not handled.

The solution is to get data for the added or updated keys, and for the removed keys use `None` instead. This will ensure that the comparison with the cache will work as expected.

**How I verified it**
Compile the package and run the unit test. Unit tests are extended to cover the expected behavior.
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.

7 participants