Error log overwritten on server start

Bug #1703105 reported by Hrvoje Novosel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
High
EvgeniyPatlan
5.7
Invalid
Undecided
Unassigned

Bug Description

Starting or restarting Percona Server
mysql Ver 14.14 Distrib 5.6.36-82.0, for Linux (x86_64) using 6.2
on
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
on
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
Revision history for this message
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
Revision history for this message
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
Revision history for this message
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
Revision history for this message
Nickolay Ihalainen (ihanick) wrote :

Log cleared by percona's systemd helper:
https://github.com/percona/percona-server/blob/5.6/build-ps/rpm/mysql-systemd#L58

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
https://github.com/percona/percona-server/blob/5.7/scripts/systemd/mysqld_pre_systemd.in#L62

tags: added: packaging
Revision history for this message
Nickolay Ihalainen (ihanick) wrote :

5.5 is not affected (also checks with -e before running install)
https://github.com/percona/percona-server/blob/5.5/build-ps/rpm/mysql-systemd#L58

tags: added: pkg
removed: packaging
Revision history for this message
EvgeniyPatlan (evgeniy-patlan) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3720

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.