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

[syncd] extend syncd service script to support both warm/cold shutdown #2238

Merged
merged 1 commit into from
Nov 15, 2018

Conversation

yxieca
Copy link
Contributor

@yxieca yxieca commented Nov 8, 2018

  • cold shutdown is used by regular service stop and/or fast reboot
  • warm shutdown is used by warm restart and/or warm reboot

Signed-off-by: Ying Xie [email protected]

- What I did
Move syncd shutdown knowledge to syncd service script. So that there is no more special handling for syncd service in normal/fast-reboot/warm-reboot cases.

- How to verify it
Regular service stop:
command: service swss stop

Thu Nov 8 16:50:40 UTC 2018 - Stopping swss service...
Thu Nov 8 16:50:40 UTC 2018 - Locking /tmp/swss-syncd-lock from swss service
Thu Nov 8 16:50:40 UTC 2018 - Locked /tmp/swss-syncd-lock (10) from swss service
Thu Nov 8 16:50:40 UTC 2018 - Warm boot flag: swss false.
Thu Nov 8 16:50:42 UTC 2018 - Stopped swss service...
Thu Nov 8 16:50:42 UTC 2018 - Unlocking /tmp/swss-syncd-lock (10) from swss service
Thu Nov 8 16:50:42 UTC 2018 - Stopping syncd service...
Thu Nov 8 16:50:42 UTC 2018 - Locking /tmp/swss-syncd-lock from syncd service
Thu Nov 8 16:50:42 UTC 2018 - Locked /tmp/swss-syncd-lock (10) from syncd service
Thu Nov 8 16:50:42 UTC 2018 - Warm boot flag: syncd false.
Thu Nov 8 16:50:42 UTC 2018 - cold shutdown syncd process ...
Thu Nov 8 16:50:46 UTC 2018 - Finished cold shutdown syncd process ...
Thu Nov 8 16:50:48 UTC 2018 - Stopped syncd service...
Thu Nov 8 16:50:48 UTC 2018 - Unlocking /tmp/swss-syncd-lock (10) from syncd service

Warm stop syncd (simulating syncd warm restart):
commands:
config warm_restart enable system
service syncd stop

Thu Nov 8 16:53:19 UTC 2018 - Stopping syncd service...
Thu Nov 8 16:53:19 UTC 2018 - Locking /tmp/swss-syncd-lock from syncd service
Thu Nov 8 16:53:19 UTC 2018 - Locked /tmp/swss-syncd-lock (10) from syncd service
Thu Nov 8 16:53:19 UTC 2018 - Warm boot flag: syncd true.
Thu Nov 8 16:53:19 UTC 2018 - warm shutdown syncd process ...
Thu Nov 8 16:53:44 UTC 2018 - Finished warm shutdown syncd process ...
Thu Nov 8 16:53:46 UTC 2018 - Stopped syncd service...
Thu Nov 8 16:53:46 UTC 2018 - Unlocking /tmp/swss-syncd-lock (10) from syncd service

fast-reboot simulation: docker kill swss

Thu Nov 8 16:55:27 UTC 2018 - Stopping swss service...
Thu Nov 8 16:55:27 UTC 2018 - Locking /tmp/swss-syncd-lock from swss service
Thu Nov 8 16:55:27 UTC 2018 - Locked /tmp/swss-syncd-lock (10) from swss service
Thu Nov 8 16:55:27 UTC 2018 - Warm boot flag: swss false.
Thu Nov 8 16:55:27 UTC 2018 - Stopped swss service...
Thu Nov 8 16:55:27 UTC 2018 - Unlocking /tmp/swss-syncd-lock (10) from swss service
Thu Nov 8 16:55:27 UTC 2018 - Stopping syncd service...
Thu Nov 8 16:55:27 UTC 2018 - Locking /tmp/swss-syncd-lock from syncd service
Thu Nov 8 16:55:27 UTC 2018 - Locked /tmp/swss-syncd-lock (10) from syncd service
Thu Nov 8 16:55:28 UTC 2018 - Warm boot flag: syncd false.
Thu Nov 8 16:55:28 UTC 2018 - cold shutdown syncd process ...
Thu Nov 8 16:55:28 UTC 2018 - Finished cold shutdown syncd process ...
Thu Nov 8 16:55:30 UTC 2018 - Stopped syncd service...
Thu Nov 8 16:55:30 UTC 2018 - Unlocking /tmp/swss-syncd-lock (10) from syncd service

full system warm-reboot simulation (swss service left syncd alone, syncd service will be stopped later):
commands:
config warm_restart enable system
docker kill swss

Thu Nov 8 16:56:56 UTC 2018 - Stopping swss service...
Thu Nov 8 16:56:56 UTC 2018 - Locking /tmp/swss-syncd-lock from swss service
Thu Nov 8 16:56:56 UTC 2018 - Locked /tmp/swss-syncd-lock (10) from swss service
Thu Nov 8 16:56:56 UTC 2018 - Warm boot flag: swss true.
Thu Nov 8 16:56:56 UTC 2018 - Stopped swss service...
Thu Nov 8 16:56:56 UTC 2018 - Unlocking /tmp/swss-syncd-lock (10) from swss service

- cold shutdown is used by regular service stop and/or fast reboot
- warm shutdown is used by warm restart and/or warm reboot

Signed-off-by: Ying Xie <[email protected]>
Copy link
Collaborator

@jipanyang jipanyang left a comment

Choose a reason for hiding this comment

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

Looks good to me

@qiluo-msft
Copy link
Collaborator

qiluo-msft commented Nov 9, 2018

One concern is the semantics of ConfigDb flags "WARM_RESTART|*".

They are originally designed to indicate service that warm start, because service starting is happens during boot up and there is no easy way to give argument.

Now you use it to indicate service that warm stop. In this situation, we can easily feed argument to whatever stop command, the ConfigDb method seems indirect and make system complex.

@yxieca
Copy link
Contributor Author

yxieca commented Nov 12, 2018

Qi,

Your claim of "WARM_RESTART|*" can only used during boot up path doesn't make sense to me. I cannot find any document to support this claim. Can you point me to the document made this claim?

Warm reboot is a whole feature, which includes shut down path and boot up path. Stating that the warm boot flag can only be used in boot up path is odd.

Regards,
Ying

@yxieca yxieca merged commit 8598cca into sonic-net:master Nov 15, 2018
@yxieca yxieca deleted the wb-syncd branch November 15, 2018 23:47
judyjoseph added a commit that referenced this pull request May 2, 2022
swss
f71c57e [ACL]Avoid incrementing crm count when ACL rule create fails (#2238)

utilities
8a93fde Allow fw update for other boot type against on the previous "none" boot fw update (#2040)
5837559 [show] fix get routing stack routine (#2137)
c888f29 [techsupport] improve robustness (#2117)
Ndancejic pushed a commit to Ndancejic/sonic-buildimage that referenced this pull request May 3, 2022
…et#2238)

* [ACL]Avoid incrementing crm count when ACL rule create fails
SuvarnaMeenakshi added a commit that referenced this pull request Jul 6, 2022
Update sonic-utilities submodule to include below commits:
7070794 Fix DBConfig not initialize issue in pfcwd (#2238)
b5d6659 [config/load_mgmt_config] Support load IPv6 mgmt IP (#2206)
3274b0e Added bf_drivers.log to zipped dump after execution of "show techsupport" (#2164)
8dee36c [portstat] Update portstat to use CounterTable API (#2207)
7d9faf3 Added support for Sonic cross-compilation build. (#2233)
c3620fc [GCU] Moving UniqueLanes from only validating moves, to be a supplemental YANG validator (#2234)
Signed-off-by: Suvarna Meenakshi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants