sonic-net / sonic-sairedis

SAI object interface to Redis database, as used in the SONiC project
Other
56 stars 259 forks source link

To fix the issue: show_techsupport & saidump errors during testbed testing by replacing redis-rdb-tool with rdb-cli #1391

Open JunhongMao opened 2 months ago

JunhongMao commented 2 months ago

Why I did it

Fix issue: https://github.com/sonic-net/sonic-sairedis/issues/1387 The latest redis-rdb-tools-0.1.15 doesn't support Redis 7.0. Redis 7.0 was released in 2020 and adopted by SONiC's latest version. So, this issue turned out.

https://github.com/sripathikrishnan/redis-rdb-tools

I.e., the rdb-tools is far behind the Redis 7.0. The librdb can perfectly fix this issue. Please see quote from https://github.com/redis/librdb.

Motivation behind this project There is a genuine need by the Redis community for a versatile RDB file parser that can export data, perform data analysis, or merely extract raw data from RDB and RESTORE it against a live Redis server. However, available parsers have shortcomings in some aspects such as lack of long-term support, lagging far behind the latest Redis release, and usually not being optimized for memory, performance, or high-traffic streaming for production environments. Additionally, most of them are not written in C, which limits the reuse of Redis components and the potential to contribute back to Redis repo. To address these issues, it is worthwhile to develop a new parser with a modern architecture, that maybe can also challenge the current integrated RDB parser of Redis and even replace it in the future.

So, the below PRS are to replace rdbtools with librdb's tool rdb-cli. https://github.com/sonic-net/sonic-buildimage/pull/19268 https://github.com/sonic-net/sonic-sairedis/pull/1391

The above PRs are based on the below PRs. https://github.com/sonic-net/sonic-sairedis/pull/1288 https://github.com/sonic-net/sonic-sairedis/pull/1298 https://github.com/sonic-net/sonic-buildimage/pull/16466 https://github.com/sonic-net/sonic-utilities/pull/2972

How I did it

To use the Redis-db SAVE option to save the snapshot of DB each time and recover later, instead of looping through each entry in the table and saving it.

(1) Updated sonic-buildimage repo's platform/broadcom/docker-syncd-brcm-dnx/Dockerfile.j2, 
 install rdb-cli into the syncd containter.
(2) Updated sonic-sairedis repo's script file: files/scripts/saidump.sh, replace rdbtools with rdb-cli.
(3) Updated sonic-sairedis repo's saidump/saidump.cpp, to process the rdb-cli's ouput json file.

How to verify it

Method 1: On T2 setup with more than 96K routes, execute CLI command -- generate_dump No error should be shown

Method 2: Go into syncd0 container. admin@ixre-egl-board30:~$ docker exec -it syncd0 bash Run below command, get saidump's sha1sum value. root@ixre-egl-board30:/# saidump | sha1sum 1893097ecaeae72383432a54bfe4b285d05b23e5 - Run below command, get saidump.sh's sha1sum value. root@ixre-egl-board30:/# saidump.sh | sha1sum 1893097ecaeae72383432a54bfe4b285d05b23e5 - The two sha1sum values should be the same and no error should be shown. Method 3: To run the testbed show_techsupport test case.

Which release branch to backport (provide reason below if selected)

Tested branch (Please provide the tested image version)

JunhongMao commented 2 months ago

@mlok-nokia @kcudnik, please help to review, thanks.

kcudnik commented 2 months ago

Please fix coverage

kcudnik commented 2 months ago

manyfiles have changes permissions from 644 to 755, please revert

JunhongMao commented 2 months ago

Hi @kcudnik , @mlok-nokia , please help check the below three checks' failures. I'm not sure how to fix them. Thanks.

image image
kcudnik commented 2 months ago

Not related to the change

JunhongMao commented 1 month ago

@kcudnik , @mlok-nokia , please help to review this PR, fix the checking errors, and approve to merge it. Thanks.

JunhongMao commented 1 month ago

@kcudnik, how do we fix the checking error? Thanks.

kcudnik commented 1 month ago

Hey, I'm not sure this is not related to your or, I'm currently on vacation can look into that when I'm back

JunhongMao commented 1 month ago

@kcudnik When will you be available to see it?

kcudnik commented 1 month ago

Are those test errors related to your PR ?

JunhongMao commented 1 month ago

Are those test errors related to your PR ?

No. They are irrelevant to my modifications.

JunhongMao commented 1 month ago

Thanks. @kcudnik, How to get this PR and https://github.com/sonic-net/sonic-buildimage/pull/19268 to be merged?

JunhongMao commented 3 weeks ago

Hi @kcudnik @mlok-nokia , it was strange. This PR wasn't be merged automatically after @kcudnik's approval. I tried to merge the latest changes from the Master into this branch but got a checking failure. So I revert it. How to solve this situation? And how to merge https://github.com/sonic-net/sonic-buildimage/pull/19268? Thanks.

rlhui commented 4 days ago

@kcudnik would you like to sign off this?