rackerlabs / recap

A system status reporting tool
GNU General Public License v2.0
91 stars 55 forks source link

MySQL InnoDB status report is not retrieved if MySQL tmpdir points to a symlink #238

Closed tonodor closed 3 years ago

tonodor commented 3 years ago

I have found that if MySQL tmpdir points to a symlink, recap fails to retrieve the InnoDB status report. This is because it compares the path of InnoDB temporary files with the tmpdir value but fails because the paths contain the destination folder:

# mysql -Bse "SHOW VARIABLES LIKE 'tmpdir';"
tmpdir  /var/lib/mysqltmp

# ll /var/lib/mysqltmp
lrwxrwxrwx. 1 root root 14 Dec 24 11:39 /var/lib/mysqltmp -> /data/mysqltmp

# ll /proc/7305/fd | grep mysqltmp
lrwx------. 1 mysql mysql 64 Dec 24 11:44 11 -> /data/mysqltmp/ibywyLPT (deleted)
lrwx------. 1 mysql mysql 64 Dec 24 11:44 4 -> /data/mysqltmp/ibdgvlds (deleted)
lrwx------. 1 mysql mysql 64 Dec 24 11:44 5 -> /data/mysqltmp/ib0yHSjl (deleted)
lrwx------. 1 mysql mysql 64 Dec 24 11:44 6 -> /data/mysqltmp/ibphpqqe (deleted)
lrwx------. 1 mysql mysql 64 Dec 24 11:44 7 -> /data/mysqltmp/ibntvYF0 (deleted)

I'm going to submit a PR to address this.

tonyskapunk commented 3 years ago

Hi, @tonodor thanks for reporting this issue, and thanks for providing a PR. I'll review and provide feedback there.

tonyskapunk commented 3 years ago

Fixed in #239