Bug 1210906
Summary: | Add /var/log/mysqld.log to sos mysql/mariadb plugin | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Michael Bayer <mbayer> | |
Component: | sos | Assignee: | Pavel Moravec <pmoravec> | |
Status: | CLOSED ERRATA | QA Contact: | David Kutálek <dkutalek> | |
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 7.1 | CC: | agk, bmr, dkutalek, gavin, isenfeld, jherrman, lyarwood, mbayer, pablo.iranzo, plambri, pmoravec, sbradley | |
Target Milestone: | rc | Keywords: | ZStream | |
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | sos-3.2-20.el7 | Doc Type: | Bug Fix | |
Doc Text: |
When using the sosreport utility on a Pacemaker node, one of the MariaDB MySQL server log-files was not properly collected. With this update, the underlying code has been corrected, and the log-file is now collected as expected.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1232720 1237208 1238200 (view as bug list) | Environment: | ||
Last Closed: | 2015-11-19 12:17:35 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1232720, 1237208, 1238200 |
Description
Michael Bayer
2015-04-10 21:36:26 UTC
My understanding is that this file is currently taken when adding --all-logs option, like in upstream: setup: # yum install mysql sos .. # rpm -qa | egrep '(sql|maria|sos)' mariadb-5.5.41-2.el7_0.x86_64 sqlite-3.7.17-4.el7.x86_64 mariadb-libs-5.5.41-2.el7_0.x86_64 sos-3.2-15.el7_1.1.noarch # touch /var/log/mysql.log # just to artificially generate the file check default plugin: # sosreport -o mysql .. Your sosreport has been generated and saved in: /var/tmp/sosreport-pmoravec-rhel7.gsslab.brq.redhat.com-20150411165050.tar.xz .. # tar tvJf /var/tmp/sosreport-pmoravec-rhel7.gsslab.brq.redhat.com-20150411165050.tar.xz | grep mysql.log # check plugin with --all-logs option: # sosreport -o mysql --all-logs .. Your sosreport has been generated and saved in: /var/tmp/sosreport-pmoravec-rhel7.gsslab.brq.redhat.com-20150411165219.tar.xz .. # tar tvJf /var/tmp/sosreport-pmoravec-rhel7.gsslab.brq.redhat.com-20150411165219.tar.xz | grep mysql.log -rw-r--r-- root/root 0 2015-04-11 16:43 sosreport-pmoravec-rhel7.gsslab.brq.redhat.com-20150411165219/var/log/mysql.log # See in your installed downstream sosreport file /usr/lib/python2.7/site-packages/sos/plugins/mysql.py, line 45: if self.get_option("all_logs"): self.add_copy_spec([ "/var/log/mysql*", "/var/log/mariadb*" ]) So my understanding is the sosreports without /var/log/mysql.log were run without option --all-logs (or maybe were run on some older sos version that did not collect the logfile). Michael, do you agree with that? Is the current behaviour acceptable? So let's look at the intent of the mysql package and the --all-logs flag. Without --all-logs, the MySQL plugin will in all cases grab the following files: /var/log/mysql/mysqld.log /var/log/mariadb/mariadb.log With --all-logs, it additionally adds full directories: /var/log/mysql* /var/log/mariadb I don't know where any of this is documented (there's nothing at http://sos.readthedocs.org/en/latest/index.html), so I can only guess as to the intent of this flag. However, the intent seems fairly clear: 1. the mysql plugin should grab all *primary* log files by default. this is why it hardcodes paths to mariadb.log, mysqld.log. 2. The mysql plugin should additionally grab entire directories which contain *archived* / rotated log files when --all-logs is set. This is why it is hardcoding directory names and using wildcards. In this case, we are looking for a *primary* log file, not archived / date-rotated log files. That is, we want the mysqld.log. It's just as hardcoded right now, the mysql plugin is using the wrong path for a Red Hat Pacemaker installation. So the proposal is just to add this alternate path for the primary log file. We'd rather not receive full directories of archived / log-rotated files nor do we have a reliable way to communicate the use of this flag to all customer and QE agents. That's correct; --all-logs is for the case where you really do want *all* logs (current, rotated, any random garbage the admin left lying around in there..). It's explicitly expected to scoop up whole directories (where applicable) and warns the user that this may significantly inflate the report size in the man page and online usage info: --all-logs Tell plugins to collect all possible log data ignoring any size limits and including logs in non-default locations. This option may significantly increase the size of reports. It is not intended to be used to collect "routine" current log files (although in many cases it may be used as a temporary workaround in the case that a current log file is absent from the plugin). I'd like to understand better why mysql.log exists in different places but regardless it seems that this should be added to the base collection (at least for the RedHatPlugin classes). > I'd like to understand better why mysql.log exists in different places It's something we want to correct for on the other end as well, but currently under Pacemaker with MariaDB-Galera, Pacemaker uses OCF resource agents to start and stop Mariadb, bypassing the usual systemd system, and sets up an explicit log path which currently defaults to /var/log/mysqld.log (see https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/mysql-common.sh#L21). This also overrides the /var/log/mariadb/mariadb.log location that is normally in our my.cnf setup. Upstream issue: https://github.com/sosreport/sos/issues/554 Committed to upstream as https://github.com/sosreport/sos/commit/f8ab86cbd2302812cd9160bec4478cb4f84e1442 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2118.html |