Any logging code in MySQL.pm (--sqltrace or otherwise) does not log all transformer queries to the RQG log
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Random Query Generator |
Confirmed
|
Critical
|
John H. Embretsen |
Bug Description
The --sqltrace function does not correctly log all queries which were executed against mysqld to the RQG log. The difference seems to be in the transformed queries. Some are logged, some are not. Issue is easy to reproduce as described below.
In the example below, sqltrace output goes to /tmp/test1.log, log file output goes to /tmp/test1.txt
[roel@qaserver rqg]$ cat .bzr/branch/
893 <email address hidden>
[roel@qaserver rqg]$ cat test1
ps -ef | grep 'test1' | grep -v grep | awk '{print $2}' | xargs sudo kill -9 > /dev/null 2>&1
rm -Rf /tmp/test1
mkdir /tmp/test1
cd /ssd/rqg
bash -c "set -o pipefail; perl /ssd/rqg/runall.pl --queries=100000000 --seed=24433 --duration=900 --querytimeout=60 --reporter=
tail -n1 /tmp/test1.log
[roel@qaserver rqg]$ ./test1
2013-09-05T11:36:25 [21726] /ssd/rqg/runall.pl will exit with exit status STATUS_
[roel@qaserver rqg]$ grep "transforms" /tmp/test1.txt | wc -l
4607
[roel@qaserver rqg]$ grep "transforms" /tmp/test1.log | wc -l
1054
[roel@qaserver rqg]$ grep "transforms.
1925
[roel@qaserver rqg]$ grep "transforms.
457
[roel@qaserver rqg]$ grep "transforms.
[roel@qaserver rqg]$ grep "transforms.
[roel@qaserver rqg]$
This is likely reproducible on any MySQL version, but in this case I used Percona Server (lp:percona-server/5.5) at revid 564 <email address hidden> - the issue is consistently reproducible on it. If needbe, this server can easily be build by using the lp:percona-qa/build_percona.sh script and using the debug version. (i.e. bzr branch lp:percona-server/5.5 -> bzr branch lp:percona-qa -> go to 5.5 directory -> call percona-
Do you see this with, say, --threads=1?
Perl's printing functions are not 100% thread-safe, and we have seen before some issues with printing (and other things) in highly concurrent scenarios.