-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
@prgeor @shyam77git @jaganbal-a - It will be great if you can help in reviewing this. |
@@ -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*'" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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']},
]
There was a problem hiding this comment.
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.
Closing this PR since I am now using STATE_DB instead of APPL_DB for killing xcvrd during OA crash scenario. |
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
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)
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)