Commit cd85569
authored
[VOQ][saidump] Modify generate_dump: replace save_saidump with save_saidump_by_route_size (#2972)
* * [saidump]
• Saidump for DNX-SAI sonic-net/sonic-buildimage#13561
Solution and modification:
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/build_debian.sh, to install Python library rdbtools into the host.
(2) Updated sonic-buildimage/src/sonic-sairedis/saidump/saidump.cpp, add a new option -r, which updates the rdbtools's output-JSON files' format.
(3) Add a new script file: files/scripts/saidump.sh, to do the below steps
For each ASIC0, such as ASIC0,
#1. Save the Redis data.
sudo sonic-db-cli -n asic$1 SAVE > /dev/null
#2. Move dump files to /var/run/redisX/
docker exec database$1 sh -c "mv /var/lib/redis/dump.rdb /var/run/redis$1/"
#3. Run rdb command to convert the dump files into JSON files
sudo python /usr/local/bin/rdb --command json /var/run/redis$1/dump.rdb | sudo tee /var/run/redis$1/dump.json > /dev/null
#4. Run saidump -r to update the JSON files' format as same as the saidump before. Then we can get the saidump result in standard output.
docker exec syncd$1 sh -c "saidump -r /var/run/redis$1/dump.json"
#5. clear
sudo rm -f /var/run/redis$1/dump.rdb
sudo rm -f /var/run/redis$1/dump.json
(4) Update sonic-buildimage/src/sonic-utilities/scripts/generate_dump, replace saidump with saidump.sh
* * [saidump]
• Saidump for DNX-SAI sonic-net/sonic-buildimage#135611 parent f1e24ae commit cd85569
1 file changed
+102
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
866 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
867 | 925 | | |
868 | 926 | | |
| 927 | + | |
869 | 928 | | |
870 | 929 | | |
871 | 930 | | |
872 | 931 | | |
873 | 932 | | |
874 | | - | |
| 933 | + | |
875 | 934 | | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
884 | 975 | | |
885 | 976 | | |
886 | 977 | | |
| |||
1807 | 1898 | | |
1808 | 1899 | | |
1809 | 1900 | | |
1810 | | - | |
1811 | | - | |
1812 | | - | |
| 1901 | + | |
1813 | 1902 | | |
1814 | 1903 | | |
1815 | 1904 | | |
| |||
0 commit comments