Bug #33771 -mysqld=--thread-handling=pool-of-threads causes the tests to fail
Submitted: 9 Jan 2008 14:43 Modified: 26 Apr 2008 3:28
Reporter: Georgi Kodinov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:6.0 BK OS:Linux (Fedora 8)
Assigned to: Davi Arnaut CPU Architecture:Any
Tags: libevent, thread
Triage: D3 (Medium)

[9 Jan 2008 14:43] Georgi Kodinov
Description:
several tests fail when "-mysqld=--thread-handling=pool-of-threads" is passed to mysql-test.run.
Failing tests are :
main.error_simulation          [ fail ]

mysqltest: At line 26: query 'SELECT MAX(a) FROM t1 GROUP BY a,b' succeeded - should have failed with errno 1022...

The result from queries just before the failure was:
DROP TABLE IF EXISTS t1;
Warnings:
Note    1051    Unknown table 't1'
CREATE TABLE t1 (
a varchar(32) character set utf8 collate utf8_bin NOT NULL,
b varchar(32) character set utf8 collate utf8_bin NOT NULL )
ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES
('AAAAAAAAAA','AAAAAAAAAA'), ('AAAAAAAAAB','AAAAAAAAAB '),
('AAAAAAAAAB','AAAAAAAAAB'), ('AAAAAAAAAC','AAAAAAAAAC'),
('AAAAAAAAAD','AAAAAAAAAD'), ('AAAAAAAAAE','AAAAAAAAAE'),
('AAAAAAAAAF','AAAAAAAAAF'), ('AAAAAAAAAG','AAAAAAAAAG'),
('AAAAAAAAAH','AAAAAAAAAH'), ('AAAAAAAAAI','AAAAAAAAAI'),
('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
set tmp_table_size=1024;
SELECT MAX(a) FROM t1 GROUP BY a,b;

More results from queries before failure can be found in /home/kgeorge/mysql/work/failing-libevent-6.0-opt/mysql-test/var/log/error_simulation.log

Stopping All Servers
Restoring snapshot of databases
Saving core.19153
Resuming Tests

main.openssl_1                 [ fail ]  timeout

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

main.ssl                       [ fail ]  timeout

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

main.ssl_compress              [ fail ]  timeout

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

main.symlink                   [ fail ]

mysqltest: At line 85: query 'create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQLTEST_VARDIR/run"' succeeded - should have failed with errno 1...

The result from queries just before the failure was:
< snip >
 `b` char(16) NOT NULL,
 `c` int(11) NOT NULL,
 PRIMARY KEY (`a`)
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
alter table t9 rename t8, add column d int not null;
alter table t8 rename t7;
rename table t7 to t9;
drop table t1;
SHOW CREATE TABLE t9;
Table   Create Table
t9      CREATE TABLE `t9` (
 `a` int(11) NOT NULL AUTO_INCREMENT,
 `b` char(16) NOT NULL,
 `c` int(11) NOT NULL,
 `d` int(11) NOT NULL,
 PRIMARY KEY (`a`)
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
Got one of the listed errors
Got one of the listed errors
Got one of the listed errors

More results from queries before failure can be found in /home/kgeorge/mysql/work/failing-libevent-6.0-opt/mysql-test/var/log/symlink.log

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

rpl.rpl_incident               [ fail ]  timeout

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

How to repeat:
Get a BK fresh version, compile and invoke "make test-pr". This on my system translates to :
./mysql-test-run.pl   --ps-protocol --mysqld=--binlog-format=row --mysqld=--thread-handling=pool-of-threads
[23 Jan 2008 21:21] Timothy Smith
Hi, I've got the same results on current -6.0, -6.0-build, and -5.2-maint (a 6.0 clone).

For the error_simulation test, I did some exploration.  In this particular case, if the entire server is started with --tmp-table-size=1024 then the test succeeds.  However, it's not enough to just do SET GLOBAL tmp_table_size=1024 in a running server, because this doesn't affect pooled threads which are already running, it only affects new threads.

Regards,

Timothy
[19 Feb 2008 11:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/42538

ChangeSet@1.2578, 2008-02-19 13:08:33+02:00, gkodinov@magare.gmz +1 -0
  Disabled the libevent tests for autopush.
  See bug #33771 for details
[13 Mar 2008 19:28] Bugs System
Pushed into 6.0.5-alpha
[21 Apr 2008 13:27] Davi Arnaut
SWAP_DEBUG_EXPLAIN pops and pushes a debug session, when popped/push the "default" settings are dropped, breaking any test case which relies on --loose-debug=d,dbug_execute_if_keyword. One option is to convert the test cases to use set session debug in the mean time.
[24 Apr 2008 11:55] Davi Arnaut
SSL related failures fixed in 6.0-runtime:

ChangeSet@stripped, 2008-04-23 09:33:25-03:00, davi@stripped +3 -0
  Fix for main.ssl and main.ssl_compress test case failures under pool-of-threads.
  
  The problem is that the SSL layer has a read buffer and might read
  more data than requested by the VIO layer. The SSL layer empties the
  socket buffer which causes the socket to not be signaled for IO if
  the client is waiting for a command which is sitting in the read
  buffer.
  
  The solution is to retrieve from the transport layer the number of
  bytes waiting in the read buffer. The data in the read buffer needs
  to be processed before waiting for more data.
[26 Apr 2008 3:28] Davi Arnaut
Pushed to 6.0-runtime

ChangeSet@1.2630, 2008-04-25 22:45:33+04:00, kostja@bodhi.(none) +5 -0
  Fix failure of error_simulation test in 'pst' build (prepared
  statements protocol + pool-of-threads).