[chassis][multiasic][sonic-db-cli] No need to access chassis_app_db from namespace in swss.sh#19960
Closed
mlok-nokia wants to merge 1 commit intosonic-net:masterfrom
Closed
Conversation
…ce in swss.sh Signed-off-by: mlok <marty.lok@nokia.com>
Contributor
Author
|
@arlakshm @judyjoseph This PR address the sonic-db-cli unable to access to the CHASSIS_APP_DB issue from namespace in swss.sh. Please review it. Thanks |
Contributor
|
@arista-nwolfe, @kenneth-arista can you please review as well |
arlakshm
approved these changes
Aug 20, 2024
judyjoseph
approved these changes
Aug 20, 2024
Contributor
|
LGTM |
wenyiz2021
approved these changes
Aug 21, 2024
lguohan
reviewed
Aug 21, 2024
|
|
||
| # First, delete SYSTEM_NEIGH entries | ||
| num_neigh=`$SONIC_DB_CLI CHASSIS_APP_DB EVAL " | ||
| num_neigh=`sonic-db-cli CHASSIS_APP_DB EVAL " |
Collaborator
There was a problem hiding this comment.
this is very difficult to understand the diffence between sonic-db-cli and $SONIC_DB_CLI, making code very difficult to maintain, like landmine.
Contributor
There was a problem hiding this comment.
could add a different variable to use sonic-db-cli from host:
if [ "$DEV" ]; then
NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace
SONIC_DB_CLI="sonic-db-cli -n $NET_NS"
SONIC_DB_CLI_HOST="sonic-db-cli"
else
NET_NS=""
SONIC_DB_CLI="sonic-db-cli"
SONIC_DB_CLI_HOST="sonic-db-cli"
fi
Collaborator
|
@wenyiz2021 is discuss with @mlok-nokia whether we should close this PR. |
liuh-80
approved these changes
Aug 22, 2024
Contributor
|
good to close this as sonic-net/sonic-swss-common#883 merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
Currently, in the multiaisc linecard, the sonic-db-cli is not able access from CHASSIS_APP_DB from namespace. The swss,sh call SONIC_DB_CLI to ping and access the CHASSIS_APP_DB. There is also a PR (sonic-net/sonic-swss-common#896) try to address it. Since sonic-db-cli can access the CHASSIS_APP_DB from host instead of the namespace, we modify the swss.sh to use sonic-db-cli instead of SONIC_DB_CLI which use the sonic-db-cli -n asic#.
Work item tracking
How I did it
Modify the swss.sh to use sonic_db_cli instead of "SONIC_DB_CLI" to access the CHASSIS_APP_DB since there is no need to access the CHASSIS_APP_DB from namespace in the swss.sh. Comparing to PR sonic-net/sonic-swss-common#896, this PR is more straight forward to address the issue based on the swss.sh implementation. Anyway, both PRs have no conflict.
How to verify it
The mutilasic swss# container should be able to be UP and running without any issue.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
[x] 202405
[x] master
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)