Commit 1ff6b8e
authored
[ssw] clean up DPU_APPL_DB and DPU_STATE_DB for DPU swss restart or DPU reboot (#25578)
<!--
Please make sure you've read and understood our contributing guidelines:
https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md
failure_prs.log skip_prs.log Make sure all your commits include a signature generated with `git commit -s` **
If this is a bug fix, make sure your description includes "fixes #xxxx", or
"closes #xxxx" or "resolves #xxxx"
Please provide the following information:
-->
reference: https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/yang-models/sonic-device_metadata.yang#L197
#### Why I did it
For sonic-net/SONiC#2175
sign-off: Jing Zhang [email protected]
##### Work item tracking
- Microsoft ADO **(number only)**:
#### How I did it
1. Check if DPU_APPL_DB is pingable
2. If yes, flush all DB entries when swss starts.
#### How to verify it
Tested on ssw testbed.
- Entries got removed.
```
$ redis-cli -p 6381 -n 15
127.0.0.1:6381[15]> keys *
1) "BFD_SESSION_TABLE:default:default:10.1.0.32"
2) "BFD_SESSION_TABLE:default:default:10.1.2.32"
3) "BFD_SESSION_TABLE:default:default:10.1.1.32"
127.0.0.1:6381[15]> keys *
(empty array)
```
```
$ redis-cli -p 6381 MONITOR
OK
... ...
1769395816.952661 [18 169.254.200.1:34286] "PING"
1769395816.952718 [16 169.254.200.1:34280] "PING"
1769395816.954712 [17 169.254.200.1:34296] "SELECT" "17"
1769395816.954877 [17 169.254.200.1:34296] "PING"
1769395817.183169 [15 169.254.200.1:34310] "SELECT" "15"
1769395817.183386 [15 169.254.200.1:34310] "PING"
1769395817.210425 [15 169.254.200.1:34320] "SELECT" "15"
1769395817.210602 [15 169.254.200.1:34320] "FLUSHDB"
1769395817.229074 [17 169.254.200.1:34322] "SELECT" "17"
1769395817.229309 [17 169.254.200.1:34322] "FLUSHDB"
```
<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->
#### Which release branch to backport (provide reason below if selected)
<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
#### Tested branch (Please provide the tested image version)
<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->
- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->
#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->
<!--
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->
#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->
#### A picture of a cute animal (not mandatory but encouraged)1 parent 60c7baa commit 1ff6b8e
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
411 | 425 | | |
412 | 426 | | |
413 | 427 | | |
| |||
0 commit comments