ES can't get btrfs filesystem stats

if ES data store in btrfs filesystem partition, then GET _nodes/stats/fs will return empty io_stats field. such as :

"fs" : {
        "timestamp" : 1586250875508,
        "total" : {
          "total_in_bytes" : 40002251653120,
          "free_in_bytes" : 16212569772032,
          "available_in_bytes" : 16206380437504
        },
        "data" : [
          {
            "path" : "/home/data/cluster/nodes/0",
            "mount" : "/home/data (/dev/sdb)",
            "type" : "btrfs",
            "total_in_bytes" : 40002251653120,
            "free_in_bytes" : 16212569772032,
            "available_in_bytes" : 16206380437504
          }
        ],
        "io_stats" : { }
      }

is there any way to fix it?

What OS are you using?

On Linux, these stats come from /proc/diskstats and I am unaware of any difference between btrfs and other filesystems.

On other operating systems these stats are always omitted, regardless of the filesystem.

CentOS 7/Kernel 3.10 or 5.6
ES can get io_stats when using ext4 or xfs but btrfs is empty on same system envrioment.
here is /proc/diskstats:

grep sdb /proc/diskstats
   8      16 sdb 586393003 109982 30391265392 2199288329 262632645 14809281 122797050312 689016458 0 60590581 2473033176 0 0 0 0

it seems read/write stats are no zero but es not display.

Hmm interesting.

Can you share the full contents of /proc/diskstats and /proc/self/mountinfo on your system?

cat /proc/diskstats

   8       0 sda 550581 100954 20600999 7659539 2261901 4764090 60133176 569017 0 1299335 7604460 0 0 0 0
   8       1 sda1 2551 250 51787 19563 41603 41723 166640 10685 0 15832 22195 0 0 0 0
   8       2 sda2 547975 100704 20548716 7639799 2220298 4722367 59966536 558332 0 1285305 7582106 0 0 0 0
   8      16 sdb 595266938 110437 30526567808 2308165797 265830085 14961235 124298952064 698124969 0 61249750 2585041124 0 0 0 0
 253       0 dm-0 494549 0 16021346 6071228 6327522 0 53128168 1262236 0 1083676 7333464 0 0 0 0
 253       1 dm-1 129 0 1912 328 0 0 0 0 0 45 328 0 0 0 0
 253       2 dm-2 160731 0 4524746 2645426 615147 0 6838368 99124 0 215664 2744550 0 0 0 0

cat /proc/self/mountinfo

22 68 0:21 / /sys rw,nosuid,nodev,noexec,relatime shared:6 - sysfs sysfs rw
23 68 0:5 / /proc rw,nosuid,nodev,noexec,relatime shared:5 - proc proc rw
24 68 0:6 / /dev rw,nosuid shared:2 - devtmpfs devtmpfs rw,size=65951280k,nr_inodes=16487820,mode=755
25 22 0:7 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:7 - securityfs securityfs rw
26 24 0:22 / /dev/shm rw,nosuid,nodev shared:3 - tmpfs tmpfs rw
27 24 0:23 / /dev/pts rw,nosuid,noexec,relatime shared:4 - devpts devpts rw,gid=5,mode=620,ptmxmode=000
28 68 0:24 / /run rw,nosuid,nodev shared:23 - tmpfs tmpfs rw,mode=755
29 22 0:25 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:8 - tmpfs tmpfs ro,mode=755
30 29 0:26 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:9 - cgroup cgroup rw,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd
31 22 0:27 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:21 - pstore pstore rw
32 29 0:28 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime shared:10 - cgroup cgroup rw,blkio
33 29 0:29 / /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime shared:11 - cgroup cgroup rw,pids
34 29 0:30 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:12 - cgroup cgroup rw,cpuset
35 29 0:31 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:13 - cgroup cgroup rw,memory
36 29 0:32 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:14 - cgroup cgroup rw,cpu,cpuacct
37 29 0:33 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime shared:15 - cgroup cgroup rw,freezer
38 29 0:34 / /sys/fs/cgroup/rdma rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,rdma
39 29 0:35 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime shared:17 - cgroup cgroup rw,devices
40 29 0:36 / /sys/fs/cgroup/net_cls,net_prio rw,nosuid,nodev,noexec,relatime shared:18 - cgroup cgroup rw,net_cls,net_prio
41 29 0:37 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime shared:19 - cgroup cgroup rw,perf_event
42 29 0:38 / /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime shared:20 - cgroup cgroup rw,hugetlb
65 22 0:39 / /sys/kernel/config rw,relatime shared:22 - configfs configfs rw
68 1 253:0 / / rw,relatime shared:1 - ext4 /dev/mapper/vg_root-lv_root rw
21 23 0:20 / /proc/sys/fs/binfmt_misc rw,relatime shared:24 - autofs systemd-1 rw,fd=36,pgrp=1,timeout=300,minproto=5,maxproto=5,direct,pipe_ino=3534
43 24 0:19 / /dev/mqueue rw,relatime shared:25 - mqueue mqueue rw
44 22 0:8 / /sys/kernel/debug rw,relatime shared:26 - debugfs debugfs rw
45 24 0:41 / /dev/hugepages rw,relatime shared:27 - hugetlbfs hugetlbfs rw,pagesize=2M
77 68 8:1 / /boot rw,relatime shared:28 - ext4 /dev/sda1 rw
79 68 253:2 / /home rw,relatime shared:29 - ext4 /dev/mapper/vg_root-lv_home rw
81 68 0:43 / /var/lib/nfs/rpc_pipefs rw,relatime shared:30 - rpc_pipefs sunrpc rw
85 79 0:42 / /home/data rw,noatime shared:31 - btrfs /dev/sdb rw,nodatasum,nodatacow,nobarrier,space_cache=v2,autodefrag,subvolid=5,subvol=/
84 28 0:46 / /run/user/0 rw,nosuid,nodev,relatime shared:32 - tmpfs tmpfs rw,size=13192872k,mode=700

Ok, this is reporting the major/minor versions of the device holding /home/data as 0:42 and /proc/diskstats doesn't contain any information for such a device, claiming instead that sdb is 8:16.

thanks for help

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.