** Summary changed:
- ARC Hit Ratio does not work in collectd zfs_arc
+ zfs_arc plugin skips hits/misses in collectd5.9.2g on 20.04
** Description changed:
$ lsb_release -rd
Description: Ubuntu 20.04 LTS
Release: 20.04
$ dpkg --list | grep collectd
ii collectd-core 5.9.2.g-1ubuntu5
amd64 statistics collection and monitoring daemon (core system)
-
- The zfs_arc plug-in for collectd is broken in 5.9.2g for the "ARC Hit Ratio"
graph: the graph does not populate with any information at all (all data points
come back -nan).
+ The zfs_arc plug-in for collectd is broken in 5.9.2g for the "hits" and
+ "misses" lines of /proc/spl/kstat/zfs/arcstats. Due to a bug in
+ zfs_arc.c, the first 2 lines of this file are skipped twice, resulting
+ in 4 lines being skipped.
I was able to confirm that just by taking /usr/lib/collectd/zfs_arc.so
from a working 18.04 installation and dropping it on the 20.04 box, the
problem could be resolved.
Then I rebuilt the package from source with a single hunk of code
removed from zfs_arc.c that was not present in 5.9.2, introduced in
5.9.2g, and removed again in upstream debian 5.10.0. This fixes the
- issue:
+ issue.
+
+ I also traced it to the collectd upstream and there the change was made
+ as part of commit 0cc3044f with a commit message that specifically
+ describes the problem.
+
--- collectd.5.9.2g/zfs_arc.c 2020-04-29 23:19:26.307645579 -0700
+++ collectd.5.10.0/zfs_arc.c 2020-04-29 23:20:19.658663146 -0700
@@ -231,23 +231,6 @@
- return -1;
- }
-
+ return -1;
+ }
+
- // Ignore the first two lines because they contain information about
- // the rest of the file.
- // See kstat_seq_show_headers module/spl/spl-kstat.c of the spl kernel
- // module.
- if (fgets(buffer, sizeof(buffer), fh) == NULL) {
- ERROR("zfs_arc plugin: \"%s\" does not contain a single line.",
- ZOL_ARCSTATS_FILE);
- fclose(fh);
- return (-1);
- }
- if (fgets(buffer, sizeof(buffer), fh) == NULL) {
- ERROR("zfs_arc plugin: \"%s\" does not contain at least two lines.",
- ZOL_ARCSTATS_FILE);
- fclose(fh);
- return (-1);
- }
-
- while (fgets(buffer, sizeof(buffer), fh) != NULL) {
- char *fields[3];
- value_t v;
+ while (fgets(buffer, sizeof(buffer), fh) != NULL) {
+ char *fields[3];
+ value_t v;
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1876135
Title:
zfs_arc plugin skips hits/misses in collectd5.9.2g on 20.04
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/collectd/+bug/1876135/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs