Error log overwritten on server start

Bug #1703105 reported by Hrvoje Novosel on 2017-07-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to
Status tracked in 5.7
Fix Released

Bug Description

Starting or restarting Percona Server
mysql Ver 14.14 Distrib 5.6.36-82.0, for Linux (x86_64) using 6.2
CentOS Linux release 7.3.1611 (Core)
seems to truncate the existing error log file (/var/log/mysqld.log) leaving only the "as of current start" info in it.

I also have another setup with an older Percona Server
mysql Ver 14.14 Distrib 5.6.34-79.1, for Linux (x86_64) using 6.2
CentOS Linux release 7.3.1611 (Core)
and there the log is not overwritten but appended to, as expected.

Maybe related I also noticed on 5.6.34 the startup log starts with
170708 13:51:25 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-07-08 13:51:25 0 [Note] /usr/sbin/mysqld (mysqld 5.6.34-79.1-log) starting as process 8805 ...
2017-07-08 13:51:25 8805 [Note] Plugin 'FEDERATED' is disabled.

and on the 5.6.36 the first line is
2017-07-08 14:01:05 17157 [Note] Plugin 'FEDERATED' is disabled.

Tags: pkg Edit Tag help
Vishal kasle (vishal.percona) wrote :

Hello, I have successfully emulated the scenario and reproduced the bug in same environment. This will need discussion though if it is related to Percona Server or the CentOS. Attaching the history of commands while reproducing the bug in file error_log_rotate_test.txt

Changed in percona-server:
status: New → Opinion
Changed in percona-server:
status: Opinion → New
Sveta Smirnova (svetasmirnova) wrote :

Thank you for the report.

Please indicate which exact package of Percona Server do you use and how you installed it

Changed in percona-server:
status: New → Incomplete
Hrvoje Novosel (t-iyfo-b) wrote :

installed via YUM
Percona-Server-server-56.x86_64 5.6.36-rel82.1.el7 @percona-release-x86_64

(note this is updated version then the initial above, but the same behavior)

Changed in percona-server:
status: Incomplete → New
Nickolay Ihalainen (ihanick) wrote :

Log cleared by percona's systemd helper:

install -m 0640 -omysql -gmysql /dev/null /var/log/mysqld.log

Upstream is not affected, because it uses ExecStartPre=/usr/bin/mysql-systemd-start pre
+ log=/var/log/mysqld.log
+ '[' -e /var/log/mysqld.log ']'
+ chmod 0640 /var/log/mysqld.log
+ chown mysql:mysql /var/log/mysqld.log

PS 5.7 is not affected, because it checks -e /var/log/mysqld.log

tags: added: packaging
Nickolay Ihalainen (ihanick) wrote :

5.5 is not affected (also checks with -e before running install)

tags: added: pkg
removed: packaging

Percona now uses JIRA for bug reports so this bug report is migrated to:

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers