-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Multi Asic] support of swss.rec and sairedis.rec for multi asic #6310
Conversation
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
retest vsimage please |
/var/log/swss/sairedis.rec | ||
/var/log/swss/swss.rec | ||
/var/log/swss/sairedis.*.rec | ||
/var/log/swss/swss.*.rec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this work for single asic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in the latest commit
pgrep -x orchagent | xargs /bin/kill -HUP 2>/dev/null || true | ||
# for multi asic platforms, there are multiple orchagents | ||
# send the SIGHUP only to the orchagent the which needs log file rotation | ||
if [ $(pgrep -x orchagent | wc -l) -gt 0 ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if somehow only one orchagent starts in the multi-asic platform, this logic could do wrong classification. why not use the num_asic variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is only on orchagent, the else block will take care of sending SIGHUP to the orchagent.
I tried using the using the num_asic by sourcing the asic.conf file source doesn't seem to work in this logrotate script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to use the asic.conf in the latest commit
if [ $(pgrep -x orchagent | wc -l) -gt 0 ]; then | ||
log_file=$1 | ||
log_file_name=${log_file#/var/log/swss/} | ||
pgrep -xa orchagent | grep $log_file_name | awk '{ print $1; }' | xargs /bin/kill -HUP 2>/dev/null || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does the pgrep -xa orchagent looks like on a multi-asic platform? can you provide output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admin@sonic:/var/log/swss$ pgrep -xa orchagent
11710 /usr/bin/orchagent -d /var/log/swss -b 8192 -i 03:00.0 -f swss.asic0.rec -j sairedis.asic0.rec -m 00:be:75:3a:ef:50
12159 /usr/bin/orchagent -d /var/log/swss -b 8192 -i 04:00.0 -f swss.asic1.rec -j sairedis.asic1.rec -m 00:be:75:3a:ef:50
12168 /usr/bin/orchagent -d /var/log/swss -b 8192 -i 08:00.0 -f swss.asic4.rec -j sairedis.asic4.rec -m 02:42:f0:7f:01:06
12169 /usr/bin/orchagent -d /var/log/swss -b 8192 -i 09:00.0 -f swss.asic5.rec -j sairedis.asic5.rec -m 02:42:f0:7f:01:02
12205 /usr/bin/orchagent -d /var/log/swss -b 8192 -i 05:00.0 -f swss.asic2.rec -j sairedis.asic2.rec -m 00:be:75:3a:ef:50
12236 /usr/bin/orchagent -d /var/log/swss -b 8192 -i 06:00.0 -f swss.asic3.rec -j sairedis.asic3.rec -m 00:be:75:3a:ef:50
Verification logs Single Asic
|
logger -p syslog.info -t "logrotate" "Sending SIGHUP to OA log_file_name:$log_file_name" | ||
pgrep -xa orchagent | grep $log_file_name | awk '{ print $1; }' | xargs /bin/kill -HUP 2>/dev/null || true | ||
else | ||
logger -p syslog.info -t "logrotate" "Sending SIGHUP to OA" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one minor comment i think for consistency if we can keep same syslog message format for both single and multi-asic.
Display file name for both.
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
retest |
retest this please |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan [email protected] - Why I did it This PR has the changes to support having different swss.rec and sairedis.rec for each asic. The logrotate script is updated as well - How I did it Update the orchagent.sh script to use the logfile name options in these PRs(sonic-net/sonic-swss#1546 and sonic-net/sonic-sairedis#747) In multi asic platforms the record files will be different for each asic, with the format swss.asic{x}.rec and sairedis.asic{x}.rec Update the logrotate script for multiasic platform .
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan [email protected] - Why I did it This PR has the changes to support having different swss.rec and sairedis.rec for each asic. The logrotate script is updated as well - How I did it Update the orchagent.sh script to use the logfile name options in these PRs(sonic-net/sonic-swss#1546 and sonic-net/sonic-sairedis#747) In multi asic platforms the record files will be different for each asic, with the format swss.asic{x}.rec and sairedis.asic{x}.rec Update the logrotate script for multiasic platform .
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan [email protected]
- Why I did it
This PR has the changes to support having different swss.rec and sairedis.rec for each asic.
The logrotate script is updated as well
- How I did it
Update the orchagent.sh script to use the logfile name options in these PRs([logfile]: Add option to specify swss rec file name sonic-swss#1546 and [logfile]: Add handling of Sairedis rec filename sonic-sairedis#747)
In multi asic platforms the record files will be different for each asic, with the format
swss.asic{x}.rec
andsairedis.asic{x}.rec
Update the logrotate script for multiasic platform .
- How to verify it
The following tests are done to verify
Verification logs multi asic
logrotate manually
admin@sonic:/var/log/swss$ sudo /usr/sbin/logrotate /etc/logrotate.conf /dev/null 2>&1
Verify the files are rotated
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)