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

Warm reboot: Don't load json conifg like copp, ininip, ports and switch again upon… #1939

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions dockers/docker-orchagent/swssconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ fast_reboot

HWSKU=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['hwsku']"`

# Don't load json config if system warm start or
# swss docker warm start is enabled, the data already exists in appDB.
WARM_START=`redis-cli -n 4 hget "WARM_RESTART|system" enable`
if [ "$WARM_START" == "true" ]; then
exit 0
fi

WARM_START=`redis-cli -n 4 hget "WARM_RESTART|swss" enable`
Copy link
Collaborator

Choose a reason for hiding this comment

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

WARM_RESTART|swss [](start = 33, length = 17)

In the scope of this PR, what is the use case for

  1. WARM_RESTART|system == false
  2. WARM_RESTART|swss == true

Intuitively, this module should care only the swss one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are two scenarios:
<1> Individual SWSS docker restart.
either system == true or swss == true, warm start will be performed.

<2> system restart.
It is to be supported. But we may hit issue when system == false, swss == true. data would have been flushed at system init. SWSS docker has to perform extra check to make sure data exits for state restore.

if [ "$WARM_START" == "true" ]; then
exit 0
fi

Copy link
Collaborator

Choose a reason for hiding this comment

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

what if we have modified any of the json?

Copy link
Collaborator Author

@jipanyang jipanyang Aug 16, 2018

Choose a reason for hiding this comment

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

This is a good question. At restore phase, you get whatever the previous configurations are.

Should anything be changed for any configuration in the json files, probably there should be specific script, or program implemented for the delta update. It is similar to configDB data change.

I doubt this script is the right place to deal with each possible change. Maybe the long term solution is to eliminate these json files and make them part of the configDB.

SWSSCONFIG_ARGS="00-copp.config.json ipinip.json ports.json switch.json "

for file in $SWSSCONFIG_ARGS; do
Expand Down