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: Add support for swss docker warm restart #1982

Conversation

jipanyang
Copy link
Collaborator

- What I did
Add support for swss docker warm restart

- How I did it

- How to verify it

Perform system cold restart, and config reload, system could be started without issue.

Enable swss or system warm start, do systemctl restart swss , or upgrade_docker
swss got start again without affect data plane traffic.

root@sonic:~# sonic_installer upgrade_docker  --cleanup_image swss swss_test_01 ./docker-orchagent-brcm_test_01.gz  
New docker image will be installed, continue? [y/N]: y
Orchagent is in clean state and frozen for warm upgrade
Command: systemctl stop swss

Command: docker rm  swss
swss

Command: docker rmi  docker-orchagent-brcm:latest
Untagged: docker-orchagent-brcm:latest

Command: docker load < ././docker-orchagent-brcm_test_01.gz

Command: docker tag docker-orchagent-brcm:latest docker-orchagent-brcm:swss_test_01

Command: systemctl restart swss

Command: docker rmi -f a5f4711c7e3e
Untagged: docker-orchagent-brcm:warm-reboot.0-dirty-20180823.192608
Deleted: sha256:a5f4711c7e3e349356c5bb0f991bcd318a9f9de560a4bbca9d00e291d815c204
Deleted: sha256:a90f8d8df5e5c20735543dbc92920ba860c186e52320b7ec9cf5cd6de52bece9

Command: sleep 5

Done

127.0.0.1:6379[6]> hgetall  "WARM_RESTART_TABLE|orchagent"
1) "restart_count"
2) "2"
3) "state"
4) "reconciled"
127.0.0.1:6379[6]> hgetall "WARM_RESTART_TABLE|neighsyncd"
1) "restart_count"
2) "2"

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
@jipanyang jipanyang changed the title Add support for swss docker warm restart Warm reboot: Add support for swss docker warm restart Aug 24, 2018
SWSS_WARM_START=`/usr/bin/docker exec database redis-cli -n 4 HGET "WARM_RESTART|swss" enable`
# if warm start enabled, just do swss docker start.
# Don't flush DB or try to start other modules.
if [[ "$SYSTEM_WARM_START" == "true" ]] || [[ "$SWSS_WARM_START" == "true" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

add x"$SYSTEM_WARM_START" == x"true" to avoid empty variable.

@lguohan lguohan merged commit 3f37b96 into sonic-net:master Aug 25, 2018
stephenxs added a commit to stephenxs/sonic-buildimage that referenced this pull request Nov 23, 2021
bb0733a [aclorch] Add ACL_TABLE_TYPE configuration  (sonic-net#1982)
59cab5d Support for setting switch level DSCP to TC QoS map (sonic-net#2023)
da21172 [aclorch] add generic AclOrch::updateAclRule() method (sonic-net#1993)
4f6cb05 [Reclaiming buffer] Support reclaiming buffer in traditional model (sonic-net#2011)
32d7a69 [Reclaiming buffer] Common code update (sonic-net#1996)
b91d8ba [swss] L2 Forwarding Enhancements (sonic-net#1716)
797dab4 [muxorch] Bind all ports to drop ACL table (sonic-net#2027)
99929cd [lgtm.yml] add libgmock-dev (sonic-net#2035)
8727ae5 [flex counter] Flex counter threads consume too much CPU resources sonic-net#9202 (sonic-net#2031)
103fdf0 Remove redundant calls to get child scheduler group during initialization (sonic-net#1965)
18ea840 [macsec]: MACsec statistics support (sonic-net#1867)
0c46242 [orchagent] Flush pipeline every 1 second, not only when select will timeout (sonic-net#2003)
339101c [cbf] Add class-based forwarding support (sonic-net#1963)
24a615b Fix issue: accumulative headroom can exceed limit in rare scenario (sonic-net#2020)
708e232 Test divide by zero processing path (sonic-net#2028)
8f1d035 [macsecmgr]: Wait for port up before enabling macsec (sonic-net#2032)
4912a77 Remove buffer drop counter when port is removed (sonic-net#1860)
f9462c4 [Dynamic buffer] [Mellanox] Calculate the peer response time according to the speed (sonic-net#1930)
8b5a401 Routed subinterface enhancements (sonic-net#2017)
cdea5e9 Fix next hop compilation (sonic-net#2025)
37c197d [SRV6] Sonic-swss changes for SRV6 (sonic-net#1964)
f502c32 [vnetorch] Add ECMP support for vnet tunnel routes (sonic-net#1960)

Signed-off-by: Stephen Sun <stephens@nvidia.com>
liat-grozovik pushed a commit that referenced this pull request Nov 24, 2021
bb0733a [aclorch] Add ACL_TABLE_TYPE configuration  (#1982)
59cab5d Support for setting switch level DSCP to TC QoS map (#2023)
da21172 [aclorch] add generic AclOrch::updateAclRule() method (#1993)
4f6cb05 [Reclaiming buffer] Support reclaiming buffer in traditional model (#2011)
32d7a69 [Reclaiming buffer] Common code update (#1996)
b91d8ba [swss] L2 Forwarding Enhancements (#1716)
797dab4 [muxorch] Bind all ports to drop ACL table (#2027)
99929cd [lgtm.yml] add libgmock-dev (#2035)
8727ae5 [flex counter] Flex counter threads consume too much CPU resources #9202 (#2031)
103fdf0 Remove redundant calls to get child scheduler group during initialization (#1965)
18ea840 [macsec]: MACsec statistics support (#1867)
0c46242 [orchagent] Flush pipeline every 1 second, not only when select will timeout (#2003)
339101c [cbf] Add class-based forwarding support (#1963)
24a615b Fix issue: accumulative headroom can exceed limit in rare scenario (#2020)
708e232 Test divide by zero processing path (#2028)
8f1d035 [macsecmgr]: Wait for port up before enabling macsec (#2032)
4912a77 Remove buffer drop counter when port is removed (#1860)
f9462c4 [Dynamic buffer] [Mellanox] Calculate the peer response time according to the speed (#1930)
8b5a401 Routed subinterface enhancements (#2017)
cdea5e9 Fix next hop compilation (#2025)
37c197d [SRV6] Sonic-swss changes for SRV6 (#1964)
f502c32 [vnetorch] Add ECMP support for vnet tunnel routes (#1960)

Signed-off-by: Stephen Sun <stephens@nvidia.com>
vivekrnv pushed a commit to vivekrnv/sonic-buildimage that referenced this pull request Jan 18, 2022
d9f3afe [fdbshow] Adding more options for fdbshow and show mac (sonic-net#1982)
902e14f Revert "Revert "[Barefoot] Added CLI to list/set P4 profile (sonic-net#1951)"" (sonic-net#2019)
5cc9dd5 Revert "Revert "[sonic-package-manager] support sonic-cli-gen and packages with YANG model (sonic-net#1650)" (sonic-net#1972)" (sonic-net#1994)

Signed-off-by: Vivek Reddy Karri <vkarri@s-build-sonic-01.mts.labs.mlnx>
qiluo-msft pushed a commit that referenced this pull request Jan 19, 2022
```
d9f3afe [fdbshow] Adding more options for fdbshow and show mac (#1982)
902e14f Revert "Revert "[Barefoot] Added CLI to list/set P4 profile (#1951)"" (#2019)
5cc9dd5 Revert "Revert "[sonic-package-manager] support sonic-cli-gen and packages with YANG model (#1650)" (#1972)" (#1994)
```
judyjoseph added a commit that referenced this pull request Jan 23, 2022
51a9fbf [debug dump] Missing Dict Key handled in the MatchOptimizer (#2014)
ac8fdd3 [Auto Techsupport] Added Event Driven TS to Command Reference  (#1985)
458a0c2 [fdbshow] Adding more options for fdbshow and show mac (#1982)
theasianpianist pushed a commit to theasianpianist/sonic-buildimage that referenced this pull request Feb 5, 2022
* [aclorch] Add ACL_TABLE_TYPE configuration

Added an API to create a table with configurable ACL table type
(matches, bpoints, actions). Implemented a handler for new
ACL_TABLE_TYPE CONFIG DB table.

Implemented UT for the above.

HLD: sonic-net/SONiC#867

DEPENDS ON: sonic-net/sonic-swss-common#546 sonic-net/sonic-sairedis#957

I implemented ACL table type concept. Till this change, there are predefined ACL table types orchagent knows about (L3, L3V6, etc.) and if other orch requires a custom table a new table type needs to be defined in aclorch.
This PR addresses this limitation by introducing AclTableType which can be constructed from a set of matches, actions and bpoint types user needs. There is also a new handler for ACL_TABLE_TYPE table which is used for user to define table types.
Currently, some of built-in ACL table types that requires special handling are distinguished from others by their names (TABLE_TYPE_MIRROR, TABLE_TYPE_MIRRORV6) and a special handling is performed by an AclOrch.

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
taras-keryk pushed a commit to taras-keryk/sonic-buildimage that referenced this pull request Apr 28, 2022
#### What I did
 Added more options to filter output in show mac and fdbshow command.
Introduced options for filter by address and filter by type.
Added one more option to display only count.
Introduced show command to display fdb aging time in the switch.

#### How I did it
Modifying fdbshow and show scripts to include the above-mentioned options

#### How to verify it
Added UT for all the newly introduced options and commands

#### Previous command output (if the output of a command-line utility has changed)
```
show mac -h
Usage: show mac [OPTIONS]

  Show MAC (FDB) entries

Options:
  -v, --vlan TEXT
  -p, --port TEXT
  --verbose        Enable verbose output
  -h, -?, --help   Show this message and exit.
```
#### New command output (if the output of a command-line utility has changed)
```
show mac -h
Usage: show mac [OPTIONS] COMMAND [ARGS]...

  Show MAC (FDB) entries

Options:
  -v, --vlan TEXT
  -p, --port TEXT
  -a, --address TEXT
  -t, --type TEXT
  -c, --count
  --verbose           Enable verbose output
  -h, -?, --help      Show this message and exit.

Commands:
  aging-time

show mac
  No.    Vlan  MacAddress         Port         Type
-----  ------  -----------------  -----------  -------
    1      10  98:03:9B:82:BB:5B  Ethernet60   Dynamic
    2      10  EC:0D:9A:CD:91:72  Ethernet64   Dynamic
    3      10  EC:0D:9A:CD:91:73  Ethernet124  Dynamic
Total number of entries 3

show mac --address EC:0D:9A:CD:91:72
  No.    Vlan  MacAddress         Port        Type
-----  ------  -----------------  ----------  -------
    1      10  EC:0D:9A:CD:91:72  Ethernet64  Dynamic

show mac --count
Total number of entries 3

show mac --type Dynamic
  No.    Vlan  MacAddress         Port         Type
-----  ------  -----------------  -----------  -------
    1      10  98:03:9B:82:BB:5B  Ethernet60   Dynamic
    2      10  EC:0D:9A:CD:91:72  Ethernet64   Dynamic
    3      10  EC:0D:9A:CD:91:73  Ethernet124  Dynamic
Total number of entries 3

show mac aging-time
Aging time for switch is 600 seconds
```
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.

3 participants