Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Default file name changed ; MYCHECK_RCPT can now be set from the default file ; check_for_crashed_tables() fixed and now checks Aria tables and exclude I_S & P_S #27

Merged
merged 7 commits into from
Jul 28, 2015

Conversation

jb-boin
Copy link
Contributor

@jb-boin jb-boin commented Jul 25, 2015

No description provided.

…variable can now be set from the default file ; The check_for_crashed_tables() function on the debian-start script has been fixed and now also checks Aria tables
@ottok
Copy link
Owner

ottok commented Jul 26, 2015

Thanks for the pull request!

Please rebase on latest git master since we just uploaded 10.0.20-3. Also please run git-buildpackage -d --git-pristine-tar and install the packages to verify that they work as you intended.

…its inclusion on the init script corrected to the new filename
…variable can now be set from the default file ; The check_for_crashed_tables() function on the debian-start script has been fixed and now also checks Aria tables
…its inclusion on the init script corrected to the new filename
There is a "set -e" at the beginning of the function that forces the script to stop if a command ends with a status !=0 and the "mysql" command returns with a status code !=0 if the SELECT COUNT(*) query is done on a crashed table which just stops the function before it could have logged and mailed the problematic table(s). A "set +e" has been added just before the execution of the "mysql" command so the execution will continue if a crashed table is encountered.

If a crashed table was encountered, the "mysql" command will return with a status different from 0
@jb-boin
Copy link
Contributor Author

jb-boin commented Jul 28, 2015

I did compile and test the packages on Jessie amd64 :
  • On my initial commit, I did forgot to modify the filename used in the init script and i also added it in debian-start.sh as its required to set "MYCHECK_RCPT", I did fix it in the commit e13167c.
  • The "check_for_crashed_tables()" function on debian-start.inc.sh wasnt working correctly because the "set -e" was making the function to abort its execution if a crashed table was encountered, I did fix it in the commit 1ea38f2.
  • After having fixed these issues, the default file is correctly created at the package installation and setting both variables seems to work as expected.
Here is a sample of the content of a mail sent by the check script :
ERROR 1017 (HY000) at line 1: Can't find file: './testdb/crashed.MAI' (errno: 2 "No such file or directory")

 Improperly closed tables are also reported if clients are accessing
 the tables *now*. A list of current connections is below.

+-----+------+-----------+----+---------+------+-------+------------------+----------+
| Id  | User | Host      | db | Command | Time | State | Info             | Progress |
+-----+------+-----------+----+---------+------+-------+------------------+----------+
| 289 | root | localhost |    | Query   | 0    | init  | show processlist | 0.000    |
+-----+------+-----------+----+---------+------+-------+------------------+----------+
Uptime: 3  Threads: 1  Questions: 854  Slow queries: 0  Opens: 269  Flush tables: 1  Open tables: 332  Queries per second avg: 284.666
And a sample of the output on the syslog :
Jul 28 14:37:36 hostname mysql[14935]: Starting MariaDB database server: mysqld ..
Jul 28 14:37:36 hostname mysql[14935]: Checking for corrupt, not cleanly closed and upgrade needing tables..
Jul 28 14:37:36 hostname /etc/mysql/debian-start[15263]: Upgrading MySQL tables if necessary.
Jul 28 14:37:36 hostname /etc/mysql/debian-start[15266]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Jul 28 14:37:36 hostname /etc/mysql/debian-start[15266]: Looking for 'mysql' as: /usr/bin/mysql
Jul 28 14:37:36 hostname /etc/mysql/debian-start[15266]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Jul 28 14:37:36 hostname /etc/mysql/debian-start[15266]: This installation of MySQL is already upgraded to 10.0.20-MariaDB, use --force if you still need to run mysql_upgrade
Jul 28 14:37:36 hostname /etc/mysql/debian-start[15284]: Checking for insecure root accounts.
Jul 28 14:37:36 hostname /etc/mysql/debian-start[15295]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: WARNING: mysqlcheck has found corrupt tables
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: ERROR 1017 (HY000) at line 1: Can't find file: './testdb/crashed.MAI' (errno: 2 "No such file or directory")
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: 
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]:  Improperly closed tables are also reported if clients are accessing
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]:  the tables *now*. A list of current connections is below.
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: 
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: +-----+------+-----------+----+---------+------+-------+------------------+----------+
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: | Id  | User | Host      | db | Command | Time | State | Info             | Progress |
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: +-----+------+-----------+----+---------+------+-------+------------------+----------+
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: | 289 | root | localhost |    | Query   | 0    | init  | show processlist | 0.000    |
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: +-----+------+-----------+----+---------+------+-------+------------------+----------+
Jul 28 14:37:38 hostname /etc/mysql/debian-start[15591]: Uptime: 3  Threads: 1  Questions: 854  Slow queries: 0  Opens: 269  Flush tables: 1  Open tables: 332  Queries per second avg: 284.666

ottok added a commit that referenced this pull request Jul 28, 2015
Improved init script options behaviour

* Default file name changed 
* MYCHECK_RCPT can now be set from the default file
* check_for_crashed_tables() fixed and now checks Aria tables and exclude I_S & P_S
@ottok ottok merged commit 0b9bbe0 into ottok:master Jul 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants