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

[config/main.py] don't start/stop pmon during config reload #3

Closed
wants to merge 5 commits into from

Conversation

stephenxs
Copy link
Owner

@stephenxs stephenxs commented Sep 10, 2019

- What I did
Don't start/stop pmon during config reload since pmon is triggered by syncd.
This PR depends on [syncd.sh] stop pmon ahead of syncd in flows except warm reboot #7

- How I did it
For Mellanox platform, remove pmon from the services_to_stop and service_to_start list.

- How to verify it
execute "config reload" and "systemctl restart swss.service" and check whether all dockers start.

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

-->

@stephenxs stephenxs changed the title [config/main.py] don't start/stop pmon during config reload since pmo… [config/main.py] don't start/stop pmon during config reload Sep 10, 2019
config/main.py Outdated Show resolved Hide resolved
config/main.py Outdated Show resolved Hide resolved
config/main.py Show resolved Hide resolved
config/main.py Show resolved Hide resolved
config/main.py Outdated
@@ -295,6 +295,10 @@ def _stop_services():
'hostcfgd',
]

# on Mellanox platform pmon is stopped by syncd
if (version_info and version_info.get('asic_type') == 'mellanox'):

Choose a reason for hiding this comment

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

Parenthesis not required here (lets remove to be more python-way consistent).
Also, in which cases bool(version_info) == False ? Let's teat it as undefined platform error, otherwise we hide the problem and keep pmon in the list

Choose a reason for hiding this comment

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

At the beginning of the file lets initialize asic_type like this:

try:
    asic_type = version_info['asic_type']
except KeyError, TypeError:
    click.abort('undefined ASIC type')

Any subsequent code that uses asic_type knows that it is initialized correctly

Copy link
Owner Author

Choose a reason for hiding this comment

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

fixed.

config/main.py Outdated
@@ -349,6 +353,10 @@ def _restart_services():
'hostcfgd',
]

# on Mellanox platform pmon is started by syncd
if (version_info and version_info.get('asic_type') == 'mellanox'):

Choose a reason for hiding this comment

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

same as above comment

Copy link
Owner Author

Choose a reason for hiding this comment

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

fixed

Stephen Sun added 2 commits September 12, 2019 12:38
move model level initialization to the head of the file
add asic_type
other code adjusted accordingly
@stephenxs
Copy link
Owner Author

Community PR has [Mellanox] Don't start & stop pmon when config reload #671 been created.

@stephenxs stephenxs closed this Sep 25, 2019
stephenxs pushed a commit that referenced this pull request Nov 21, 2023
…aidump_by_route_size (sonic-net#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#13561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants