Bug #32991 | mysqlimport --use-threads test fails on solaris | ||
---|---|---|---|
Submitted: | 5 Dec 2007 9:32 | Modified: | 6 Aug 2009 23:54 |
Reporter: | Alexander Nozdrin | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S2 (Serious) |
Version: | 5.1, 6.0 | OS: | Any |
Assigned to: | Jim Winstead | CPU Architecture: | Any |
Tags: | disabled, mysqldump.test, mysqlimport, pushbuild error, race condition |
[5 Dec 2007 9:32]
Alexander Nozdrin
[13 Feb 2008 14:07]
Magnus Blåudd
Experimented a little more with this and it is easily reproduced on sol10-sparc-a. The problem seems to be that mysqlimport fsils to connect when run with --n um-threads>1, is it really built with the thread safe library? To reproduce, build mysql-5.1 on sol10-sparc-a. Start the server with ./mtr mysqldump --start-and-exit Create and fill tables: mysql> create table t1 (a text , b text); mysql> create table t2 (a text , b text); mysql> insert t1 values ("Duck, Duck", "goose"); mysql> insert t1 values ("Duck, Duck", "pidgeon"); mysql> insert t2 values ("We the people", "in order to perform"); mysql> insert t2 values ("a more perfect", "union"); mysql> select * from t1; mysql> select * from t2; Run mysqldump to create t1.txt and t2. txt in var/tmp ../client/mysqldump -S var/tm p/master.socl k--tab=var/tmp/ test Run mysqlimport continuously in a while loop. $> while mysqlimport.sh ; do date; done It will fail and report that mysqlimport couldn't connect to mysqld through socket mysqlimport.sh would look something like: ../client/mysqlimport -uroot --debug-check --port=10170 --socket=/tmp/MfLgwlfAyM/master.sock --password= --silent --use-threads=2 test /export/home/mysqldev/users/magnus/mysql-5.1.24-rc-pb472/mysql-test/var/tmp/t1.txt /export/home/mysqldev/users/magnus/mysql-5.1.24-rc-pb472/mysql-test/var/tmp/t2.txt /export/home/mysqldev/users/magnus/mysql-5.1.24-rc-pb472/mysql-test/var/std_data_ln/words.dat /export/home/mysqldev/users/magnus/mysql-5.1.24-rc-pb472/mysql-test/var/std_data_ln/words2.dat $1 Posible problems: 1. Not using thread safe library. All clients in client/ is compiled with DUNDEF_THREADS_HACK, remove that defined and let each client include what they need to get either thread safe or non thread safe code. 2. The mysqlimport need a small retry loop when connecting - not so good, the clients should connect every time.
[13 Feb 2008 14:09]
Magnus Blåudd
"All clients in client/ is compiled with DUNDEF_THREADS_HACK," and then we go though hoops in order to get thread safety in the one that needs it.
[13 Feb 2008 16:37]
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/42228 ChangeSet@1.2548, 2008-02-13 17:39:23+01:00, sven@riska.(none) +2 -0 BUG#32991: Races in mysqldump.test (or mysqldump.test fails sporadically) This is *not* a fix to the bug. I'm only disabling the failing part of mysqldump.test until the bug is fixed. Whoever fixes it, please re-enable the test.
[13 Feb 2008 17:25]
Sven Sandberg
The submitted patch does *not* fix the bug. It only disables the test case until the bug is fixed, so that not everyone gets errors in pushbuild. Whoever fixes this bug, please re-enable the test. The error is in mysqlimport, and happens when the --use-threads flag is used. I looked superficially at it (checked global variables used from worker_thread() in client/mysqlimport.c), and could not see anything strange. (Except that the global 'exitcode' variable is used without a mutex, but it should not cause this sort of error). The error log on sol10-sparc-a says "errno=23", which on this machine means "illegal seek". I'm just guessing, but could printf() be non-thread-safe on this platform?
[25 Mar 2008 11:23]
Bugs System
Pushed into 5.1.24-rc
[26 Mar 2008 19:01]
Bugs System
Pushed into 6.0.5-alpha
[2 May 2008 18:54]
Jim Winstead
Considering that there's a comment about the -DUNDEF_THREADS_HACK saying it a fix for MIT-pthreads, it can probably just be removed. Otherwise the same CFLAGS used for mysqlslap should be used for mysqlimport.
[2 May 2008 22:22]
Jim Winstead
Unset UNDEF_THREADS_HACK for mysqlimport, because it uses threads
Attachment: bug32991.patch (text/plain), 426 bytes.
[2 May 2008 22:22]
Jim Winstead
I can't reproduce the problem on sol10-sparc-a, but the attached patch will compile mysqlimport the same way as mysqlslap, to avoid the UNDEF_THREADS_HACK hack.
[3 Jul 2008 21:30]
Sveta Smirnova
Probably bug #37789 is related.
[7 Jan 2009 0:46]
Timothy Smith
Looks ok; I agree it would be nice to get rid of UNDEF_THREADS_HACK entirely, but maybe needs more research. This patch is simple.
[12 May 2009 17:46]
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/73853 2894 Jim Winstead 2009-05-12 mysqlimport was not always compiled correctly to allow thread support, required for the --use-threads option. (Bug #32991) modified: client/Makefile.am mysql-test/r/mysqldump.result mysql-test/t/mysqldump.test
[13 Jul 2009 19:41]
Jim Winstead
Pushed to 5.1-bugteam and mysql-pe.
[4 Aug 2009 19:51]
Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090804194615-h40sa098mx4z49qg) (version source revid:jimw@mysql.com-20090713193847-xj6gbgm2a1zwwanv) (merge vers: 5.4.4-alpha) (pib:11)
[4 Aug 2009 20:45]
Bugs System
Pushed into 5.1.38 (revid:davi.arnaut@sun.com-20090804204317-ggodqkik7de6nfpz) (version source revid:davi.arnaut@sun.com-20090804204317-ggodqkik7de6nfpz) (merge vers: 5.1.38) (pib:11)
[6 Aug 2009 23:54]
Paul DuBois
Noted in 5.1.38, 5.4.4 changelogs. mysqlimport was not always compiled correctly to enable thread support, which is required for the --use-threads option.
[12 Aug 2009 22:59]
Paul DuBois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.
[15 Aug 2009 2:16]
Paul DuBois
Ignore previous comment about 5.4.2.
[1 Oct 2009 5:59]
Bugs System
Pushed into 5.1.39-ndb-6.3.28 (revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (version source revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (merge vers: 5.1.39-ndb-6.3.28) (pib:11)
[1 Oct 2009 7:25]
Bugs System
Pushed into 5.1.39-ndb-7.0.9 (revid:jonas@mysql.com-20091001072547-kv17uu06hfjhgjay) (version source revid:jonas@mysql.com-20091001071652-irejtnumzbpsbgk2) (merge vers: 5.1.39-ndb-7.0.9) (pib:11)
[1 Oct 2009 13:25]
Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (version source revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (merge vers: 5.1.39-ndb-7.1.0) (pib:11)
[5 Oct 2009 10:50]
Bugs System
Pushed into 5.1.39-ndb-6.2.19 (revid:jonas@mysql.com-20091005103850-dwij2dojwpvf5hi6) (version source revid:jonas@mysql.com-20090930185117-bhud4ek1y0hsj1nv) (merge vers: 5.1.39-ndb-6.2.19) (pib:11)
[9 Oct 2009 1:28]
Paul DuBois
The 5.4 fix has been pushed to 5.4.2.