-
Notifications
You must be signed in to change notification settings - Fork 812
Backup STATE_DB PORT_TABLE|Ethernet during warm-reboot #3111
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -247,7 +247,17 @@ function backup_database() | |
| # Delete keys in stateDB except FDB_TABLE|*, MIRROR_SESSION_TABLE|*, WARM_RESTART_ENABLE_TABLE|*, FG_ROUTE_TABLE|* | ||
| sonic-db-cli STATE_DB eval " | ||
| for _, k in ipairs(redis.call('keys', '*')) do | ||
| if not string.match(k, 'FDB_TABLE|') and not string.match(k, 'WARM_RESTART_TABLE|') \ | ||
| if string.match(k, 'PORT_TABLE|Ethernet') then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zjswhhh do you think keeping port_table intact in state-db will cause any change in mux init logic for dualtor warmboot?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No it shouldn't. |
||
| for i, f in ipairs(redis.call('hgetall', k)) do | ||
| if i % 2 == 1 then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not clear on what this check looking for -
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vaibhavhd - This logic will help in selecting the field from FieldValue Pair. Since the Below snippet has a total of 11 FieldValue pairs. |
||
| if not string.match(f, 'host_tx_ready') \ | ||
| and not string.match(f, 'NPU_SI_SETTINGS_SYNC_STATUS') \ | ||
| and not string.match(f, 'CMIS_REINIT_REQUIRED') then | ||
|
Comment on lines
+253
to
+255
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
To prevent us from getting into any unlikely scenarios in # 2 above, this handling can be done by the target image's portorch. In other words, when the device boots into target image, the portsorch initializes these fields afresh after checking that system is undergoing warmboot by checking system warm-restart flag. The downside in this approach is that portorch will have no idea what these fields were set to in the base image. The argument is same for other fields such as OPER state (netdev_oper_status) and speeds. In the recovery path of warmboot these fields are set afresh based on SAI get calls (I think)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vaibhavhd you may want to review this https://github.com/sonic-net/sonic-utilities/pull/3240/files |
||
| redis.call('hdel', k, f) | ||
| end | ||
| end | ||
| end | ||
| elseif not string.match(k, 'FDB_TABLE|') and not string.match(k, 'WARM_RESTART_TABLE|') \ | ||
| and not string.match(k, 'MIRROR_SESSION_TABLE|') \ | ||
| and not string.match(k, 'FG_ROUTE_TABLE|') \ | ||
| and not string.match(k, 'WARM_RESTART_ENABLE_TABLE|') \ | ||
|
|
||
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.
Please update the comment accordingly.