Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issuing DEL command to remove APPL_DB:PORT_TABLE #17065

Closed
wants to merge 2 commits into from

Conversation

mihirpat1
Copy link
Contributor

Why I did it

This change is needed to issue a "DEL" command to remove the APPL_DB:PORT_TABLE. The current approach of issuing FLUSH command to remove the DB doesn't allow xcvrd to subscribe and act on PORT_TABLE deletion event.

The change set is part of implementation of the HLD OA crash handling to reinitialize port through xcvrd

Work item tracking
  • Microsoft ADO (number only):
    24264739

How I did it

Calling clean_up_tables function to issue "DEL" command for removing APPL_DB:PORT_TABLE.

How to verify it

Please refer to sonic-net/sonic-platform-daemons#403 for the test results.

Which release branch to backport (provide reason below if selected)

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

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mihirpat1 mihirpat1 requested a review from lguohan as a code owner November 2, 2023 01:26
@mihirpat1 mihirpat1 requested a review from prgeor November 2, 2023 01:28
@mihirpat1 mihirpat1 marked this pull request as draft November 2, 2023 01:28
@mihirpat1 mihirpat1 marked this pull request as ready for review November 3, 2023 00:47
@mihirpat1
Copy link
Contributor Author

@prgeor @shyam77git @jaganbal-a - It will be great if you can help in reviewing this.

@mihirpat1 mihirpat1 requested a review from keboliu November 3, 2023 18:35
files/scripts/swss.sh Outdated Show resolved Hide resolved
@@ -292,6 +292,7 @@ start() {
# Don't flush DB during warm boot
if [[ x"$WARM_BOOT" != x"true" ]]; then
debug "Flushing APP, ASIC, COUNTER, CONFIG, and partial STATE databases ..."
clean_up_tables APPL_DB "'PORT_TABLE:Ethernet*'"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think xcvrd should subscribe to STATE_DB instead of APP_DB. This should not be done here, IMO

Copy link
Contributor

Choose a reason for hiding this comment

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

@mihirpat1 i see Xcvrd subscribing to these tables. What am I missing?

  port_tbl_map = [
        {'CONFIG_DB': swsscommon.CFG_PORT_TABLE_NAME},
        {'STATE_DB': 'TRANSCEIVER_INFO'},
        {'STATE_DB': 'PORT_TABLE', 'FILTER': ['host_tx_ready']},
    ]

Copy link
Contributor Author

@mihirpat1 mihirpat1 Dec 5, 2023

Choose a reason for hiding this comment

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

@prsunny - XCVRD already subscribes to APPL_DB. With this change, I am changing the way to delete entries from APPL_DB. Am I missing something here?
https://github.com/sonic-net/sonic-platform-daemons/blob/502c0b6622008363cb1ed6d1b7c85b4093997093/sonic-xcvrd/xcvrd/xcvrd.py#L1173

Also, as @prgeor mentioned, XCVRD already subscribes to STATE_DB as well.

@mihirpat1
Copy link
Contributor Author

Closing this PR since I am now using STATE_DB instead of APPL_DB for killing xcvrd during OA crash scenario.

sonic-net/sonic-utilities#3111

@mihirpat1 mihirpat1 closed this Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants