apache / trafficcontrol

Apache Traffic Control is an Open Source implementation of a Content Delivery Network
https://trafficcontrol.apache.org/
Apache License 2.0
1.09k stars 344 forks source link

t3c: Assumption about the use of ext4 #6181

Open smalenfant opened 3 years ago

smalenfant commented 3 years ago

When using t3c-apply. I noticed an error about ext4 on the output:

ERROR: torequest.go:417: 2021-09-09T14:05:17.344241746Z: unable to read /proc/fs/ext4, cannot audit disks for filesystem usage.

We use XFS because it is the default filesystem for Centos 7.

# ls -l /proc/fs/xfs/
total 0
lrwxrwxrwx 1 root root 23 Sep  9 14:10 stat -> /sys/fs/xfs/stats/stats
-r--r--r-- 1 root root  0 Sep  9 14:10 xqm
-r--r--r-- 1 root root  0 Sep  9 14:10 xqmstat

It seems like the intent is to verify that there is no partition on the ATS cache disks. We had multiple issues with that in the past and seems like something we definitively need to be proactive when installing caches. Maybe lsblk could be used instead?

# lsblk /dev/vdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vdb  253:16   0  10G  0 disk 
lsblk /dev/vda
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    253:0    0   20G  0 disk 
├─vda1 253:1    0    1G  0 part /boot
├─vda2 253:2    0  3.9G  0 part [SWAP]
├─vda3 253:3    0  200M  0 part /boot/efi
├─vda4 253:4    0    1K  0 part 
└─vda5 253:5    0 14.9G  0 part /

Other options might be /proc/diskstats and and /proc/partitions

https://github.com/apache/trafficcontrol/blob/a971b6c50b6a429ddbbbdfd2ca8ff1107b659eb8/cache-config/t3c-apply/torequest/torequest.go#L415-L426

smalenfant commented 3 years ago

I noticed that the "report" mode didn't work. But maybe it quits after the ext4 check?

[root@cdn1cdedge0002 ~]# t3c-apply -m report -F
set TSHome from the RPM config file  list '/opt/trafficserver'
TSHome: /opt/trafficserver, TSConfigDir: /opt/trafficserver/etc/trafficserver
Mon Sep 13 15:57:16 UTC 2021
ERROR: torequest.go:758: 2021-09-13T15:57:16.290168142Z: Traffic Ops is signaling that no update is waiting to be applied.
ERROR: torequest.go:275: 2021-09-13T15:57:16.290364567Z: status file /var/lib/trafficcontrol-cache-config/status/REPORTED does not exist.
ERROR: torequest.go:927: 2021-09-13T15:57:16.499564324Z: number of packages requiring installation: 0
ERROR: torequest.go:931: 2021-09-13T15:57:16.499703323Z: number of packages requiring removal: 0
ERROR: torequest.go:417: 2021-09-13T15:57:18.852518714Z: unable to read /proc/fs/ext4, cannot audit disks for filesystem usage.
[root@cdn1cdedge0002 ~]# echo $?
0
smalenfant commented 3 years ago

Ok, this has nothing to do with ext4. I removed the code and it has the same behavior. I created a new issue about report mode not displaying changes