[code sync] Merge code from sonic-net/sonic-platform-daemons:202505 to 202506#45
Merged
Merged
Conversation
mssonicbld
commented
Sep 4, 2025
Collaborator
…tem warm-reboot flag) to prevent post-warm-reboot port flaps (#671) <!-- Provide a general summary of your changes in the Title above --> #### Description This change switches xcvrd’s warm-reboot readiness check from the system warm-reboot flag to syncd’s restore_count != 0 in STATE_DB. In production, the finalizer clears the system warm-reboot flag before xcvrd publishes optics/port configs. xcvrd then assumes warm-reboot is over and pushes configs too early, which has been causing all ports to flap. #### Motivation and Context All port flapped during warm-reboot on Arista device from 202411->202505 upgrade #### How Has This Been Tested? root@str-7060-cx32-1:/var/log# sudo grep -nEi 'down[[:space:]]+to[[:space:]]+up|up[[:space:]]+to[[:space:]]+down' /var/log/syslog root@str-7060-cx32-1:/var/log# sudo grep -nEi 'down[[:space:]]+to[[:space:]]+up|up[[:space:]]+to[[:space:]]+down' /var/log/syslog.1 root@str-7060-cx32-1:/var/log# Warm-upgrade from 202311 to 202505 (unsupported upgrade path) which led to syncd crashed in new image, syncd will do cold-restart and reset restore_count, in this case xcvrd can publish SI settings correctly. ``` root@str2-7050cx3-acs-14:~# redis-cli -n 6 hgetall "WARM_RESTART_TABLE|syncd" 1) "restore_count" 2) "0" root@str2-7050cx3-acs-14:~# show warm_restart state name restore_count state ------------- --------------- ----------------------- fdbsyncd 0 disabled teamsyncd 0 reconciled bgp 0 disabled teammgrd 0 syncd 0 neighsyncd 0 reconciled nbrmgrd 0 warm-shutdown 0 warm-shutdown-succeeded portsyncd 0 coppmgrd 0 xcvrd 0 vlanmgrd 0 reconciled orchagent 0 reconciled rebootbackend 0 gearsyncd 0 tunnelmgrd 0 reconciled vxlanmgrd 0 reconciled intfmgrd 0 disabled vrfmgrd 0 disabled root@str2-7050cx3-acs-14:~# root@str2-7050cx3-acs-14:~# show reboot-cause User issued 'warm-reboot' command [User: admin, Time: Tue 02 Sep 2025 10:31:47 PM UTC] root@str2-7050cx3-acs-14:~# root@str2-7050cx3-acs-14:~# sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable false root@str2-7050cx3-acs-14:~# root@str2-7050cx3-acs-14:~# sudo zgrep -ai "xcvrd.*publish" /var/log/syslog 2025 Sep 2 22:42:45.394080 str2-7050cx3-acs-14 NOTICE pmon#xcvrd[37]: Publishing ASIC-side SI setting for port Ethernet108 in APP_DB: 2025 Sep 2 22:42:45.398251 str2-7050cx3-acs-14 NOTICE pmon#xcvrd[37]: Notify media setting: Published ASIC-side SI setting for lport Ethernet108 in APP_DB 2025 Sep 2 22:42:45.471204 str2-7050cx3-acs-14 NOTICE pmon#xcvrd[37]: Publishing ASIC-side SI setting for port Ethernet32 in APP_DB: No Port flapped from 202411->202505 warm upgrade after injected changes in pmon container. ``` #### Additional Information (Optional)
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.