Package: munin-plugins-core
Version: 2.0.67-1~bpo10+1
Severity: normal
Tags: patch
Dear Maintainer,
* What led up to the situation?
munin plugin mysql_, invoked as for example mysql_qcache (or any other,
sometimes (but not always) fails with errors like:
Unknown section: Main thread process no. 21673, id 139511430366976,
state: sleeping at /etc/munin/plugins/mysql_qcache line 1382
thus resulting in VERY unusable mysql munin stats (about 20% visible,
80% broken in my case)
* What exactly did you do (or not do) that was effective (or
ineffective)?
tried upgrading munin-plugins-core all the way from 2.0.33-1, via
2.0.49-1~bpo9+1:to 2.0.67-1~bpo10+1
* What was the outcome of this action?
error still sporadically happens
* What outcome did you expect instead?
I expected the plugin to not die with error, but instead returns
available data.
After some debugging, I found out the problem is output of "show engine innodb
status"
which sometimes (when mysql views are used in some way?) returns this output on
which
mysql_ barfs:
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
2 read views open inside InnoDB
1 RW transactions active inside InnoDB
0 RO transactions active inside InnoDB
1 out of 1000 descriptors used
---OLDEST VIEW---
Normal read view
Read view low limit trx n:o 14142166371
Read view up limit trx id 14142166371
Read view low limit trx id 14142166371
Read view individually stored trx ids:
-----------------
Main thread process no. 21673, id 139511430366976, state: sleeping
Number of rows inserted 9568126016, updated 1596177407, deleted 515944374,
read 15378019524560
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 16020000.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
instead of this output which is parsed OK:
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
0 read views open inside InnoDB
0 RW transactions active inside InnoDB
0 RO transactions active inside InnoDB
0 out of 1000 descriptors used
Main thread process no. 21673, id 139511430366976, state: sleeping
Number of rows inserted 9568124954, updated 1596176891, deleted 515943708,
read 15377906700512
0.17 inserts/s, 1.67 updates/s, 0.00 deletes/s, 880245.13 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
Attached patch quickly removes the offending (non-standardly formatted) and
unused "---OLDEST VIEW---" section, thus fixing the issue.
-- System Information:
Debian Release: 9.8
APT prefers oldstable
APT policy: (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.19.0-0.bpo.2-amd64 (SMP w/32 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages munin-plugins-core depends on:
ii munin-common 2.0.67-1~bpo10+1
ii perl 5.24.1-3+deb9u5
Versions of packages munin-plugins-core recommends:
pn libnet-snmp-perl <none>
Versions of packages munin-plugins-core suggests:
pn acpi | lm-sensors <none>
pn conntrack <none>
pn default-mysql-client <none>
ii ethtool 1:4.8-1+b1
ii hdparm 9.51+ds-1+deb9u1
ii libcache-cache-perl 1.08-2
ii libdbd-mysql-perl 4.041-2
pn libdbd-pg-perl <none>
ii libhttp-date-perl 6.02-1
ii liblwp-useragent-determined-perl 1.07-1
pn libnet-dns-perl <none>
pn libnet-ip-perl <none>
pn libnet-irc-perl <none>
pn libnet-ldap-perl <none>
pn libnet-netmask-perl <none>
pn libnet-telnet-perl <none>
ii libwww-perl 6.15-1
pn libxml-parser-perl <none>
pn libxml-simple-perl <none>
pn logtail <none>
ii net-tools 1.60+git20161116.90da8a0-1
ii python3 3.5.3-1
pn ruby <none>
ii smartmontools 6.5+svn4324-1
-- no debconf information
--- /usr/share/munin/plugins/mysql_.orig 2021-03-08 11:57:43.000000000
+0100
+++ /usr/share/munin/plugins/mysql_ 2021-07-28 21:33:05.984676113 +0200
@@ -1348,6 +1348,9 @@
sub parse_innodb_status {
local $_ = shift;
+ # remove non-stanard (and useless) "---OLDEST VIEW---" section, as it
breaks the plugin
+ s{^---OLDEST VIEW---\v.*?^-----------------\v}{}ms;
+
# Add a dummy section to the end in case the innodb status output
# has been truncated (Happens for status > 64K characters)
$_ .= "\n----------\nDUMMY\n";