Skip to content

[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
mlok-nokia:sonic-db-cli-access-chassis-app-db
Closed

[chassis][multiasic][sonic-db-cli] No need to access chassis_app_db from namespace in swss.sh#19960
mlok-nokia wants to merge 1 commit intosonic-net:masterfrom
mlok-nokia:sonic-db-cli-access-chassis-app-db

Conversation

@mlok-nokia
Copy link
Copy Markdown
Contributor

@mlok-nokia mlok-nokia commented Aug 20, 2024

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
  • Microsoft ADO (number only):

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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202405

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)

…ce in swss.sh

Signed-off-by: mlok <marty.lok@nokia.com>
@mlok-nokia mlok-nokia requested a review from lguohan as a code owner August 20, 2024 01:14
@mlok-nokia
Copy link
Copy Markdown
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

@arlakshm
Copy link
Copy Markdown
Contributor

@arista-nwolfe, @kenneth-arista can you please review as well

Copy link
Copy Markdown
Collaborator

@kenneth-arista kenneth-arista left a comment

Choose a reason for hiding this comment

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

lgtm

@arista-nwolfe
Copy link
Copy Markdown
Contributor

LGTM


# First, delete SYSTEM_NEIGH entries
num_neigh=`$SONIC_DB_CLI CHASSIS_APP_DB EVAL "
num_neigh=`sonic-db-cli CHASSIS_APP_DB EVAL "
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is very difficult to understand the diffence between sonic-db-cli and $SONIC_DB_CLI, making code very difficult to maintain, like landmine.

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.

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

@rlhui rlhui added the P0 Priority of the issue label Aug 21, 2024
@qiluo-msft qiluo-msft requested a review from liuh-80 August 21, 2024 18:23
@qiluo-msft
Copy link
Copy Markdown
Collaborator

@wenyiz2021 is discuss with @mlok-nokia whether we should close this PR.

@wenyiz2021
Copy link
Copy Markdown
Contributor

good to close this as sonic-net/sonic-swss-common#883 merged

@wenyiz2021 wenyiz2021 closed this Aug 22, 2024
@mlok-nokia mlok-nokia deleted the sonic-db-cli-access-chassis-app-db branch September 27, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P0 Priority of the issue

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.