[MDEV-4554] MariaDB 5.5.30 no longer works with MyDumper Created: 2013-05-21  Updated: 2013-05-24  Due: 2013-06-21  Resolved: 2013-05-24

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.30
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: George L Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS 6.4 64bit, Nginx 1.4.1, PHP 5.3.25 PHP-FPM, MariaDB 5.5.30 via official YUM repository


Attachments: Text File CMakeCache.txt     File CMakeLists.txt.diff     Text File mydumper-static-libmysql-link.patch    

 Description   

Problem: Mydumper 0.5.2 no longer works and can not be compiled with MariaDB 5.5.30 while it worked fine with MariaDB 5.5.24. So something changed since MariaDB 5.5.24 ?

Detail of problem at https://bugs.launchpad.net/mandriva/+bug/803982, Mydumper folks won't fix it at their end so it's left up to MariaDB folks to tackle it I hope as Mydumper is very useful for much faster multi-threaded backups !.

error = 'undefined reference to `my_net_read''

-- ------------------------------------------------
-- MYSQL_CONFIG = /usr/bin/mysql_config
-- CMAKE_INSTALL_PREFIX = /usr/local
-- BUILD_DOCS = ON
-- RUN_CPPCHECK = OFF
-- Change a values with: cmake -D<Variable>=<Value>
-- ------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/mydumper-0.5.2
Scanning dependencies of target mydumper
[ 20%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
[ 40%] Building C object CMakeFiles/mydumper.dir/binlog.c.o
[ 60%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
[ 80%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
Linking C executable mydumper
CMakeFiles/mydumper.dir/binlog.c.o: In function `get_binlog_file':
/usr/local/src/mydumper-0.5.2/binlog.c:160: undefined reference to `my_net_read'
collect2: ld returned 1 exit status
make[2]: *** [mydumper] Error 1
make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
make: *** [all] Error 2



 Comments   
Comment by Vladislav Vaintroub [ 2013-05-21 ]

Why don't you link with static library that has all symbols? Or, remove binlog.c from compilation, as Domas suggested in the comments to the link you pasted

Comment by George L [ 2013-05-21 ]

Unfortunately, don't have the skills or knowledge in this area to do that

Comment by Vladislav Vaintroub [ 2013-05-21 ]

ok, in this case I think I could help. Can you attach CMakeCache.txt that you got in your build directory for mydumper?

Comment by Vladislav Vaintroub [ 2013-05-21 ]

To answer "So something changed since MariaDB 5.5.24 ?", yes, something changed. We use the same versioning and restrict exports just like distros do, to be able to be the drop.in replacement we claim to be.
Now "my_net_read" function is not in the official API, and not even in the list of exports that have been "promoted" to the official API by distro packagers. So there is no wonder it does not link. But it should link with static library since there is no way to resitrct symbols there.

Comment by George L [ 2013-05-22 ]

Hi Vladislav thank you very much for your help it's much appreciated. Would be great to continue being able to use mydumper with MariaDB 5.5.x as it's several times faster than mysqldump http://vbtechsupport.com/1716/ and as fast as Percona Xtrabackup with parallel threads especially on DB sizes >40GB.

Here's the attached CMakeCache.txt

Comment by Vladislav Vaintroub [ 2013-05-23 ]

I'm using current version of mydumper, and they no more link with shared library (but still have bugs nonetheless)

so the whole procedure to build mydumper (on CentOS 6.3) looks like that, to me
0. Install MariaDB-devel with yum
1. get current lanchpad version of mydumper
bzr branch lp:mydumper
cd mydumper

3. now, I need to patch CMakeLists.txt like in the attachment, to prevent unresolved symbols (from libdl, libm and so on)
4. cmake . && make

Comment by Vladislav Vaintroub [ 2013-05-23 ]

patch to CMakeLists.txt attached

Comment by Vladislav Vaintroub [ 2013-05-23 ]

I'm closing it as not-a-bug, since it seems to be already fixed in mydumper.

Please reopen if you still have problems (i.e instructions in previous comment do not work)

Comment by George L [ 2013-05-24 ]

Cheers. thanks for the help, I am already using 0.5.2 mydumper and tried launchpad download as well, seems I am not getting the latest ?

rpm -qa | grep MariaDB
MariaDB-compat-5.5.31-1.x86_64
MariaDB-test-5.5.31-1.x86_64
MariaDB-common-5.5.31-1.x86_64
MariaDB-devel-5.5.31-1.x86_64
MariaDB-shared-5.5.31-1.x86_64
MariaDB-server-5.5.31-1.x86_64
MariaDB-client-5.5.31-1.x86_64

bzr branch lp:mydumper
cd mydumper
patch -p0 < CmakeLists.txt.diff

make

Scanning dependencies of target mydumper
[ 20%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
[ 40%] Building C object CMakeFiles/mydumper.dir/binlog.c.o
[ 60%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
[ 80%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
Linking C executable mydumper
CMakeFiles/mydumper.dir/binlog.c.o: In function `get_binlog_file':
/usr/local/src/mydumper/binlog.c:160: undefined reference to `my_net_read'
collect2: ld returned 1 exit status
make[2]: *** [mydumper] Error 1
make[1]: *** [CMakeFiles/mydumper.dir/all] Error 2
make: *** [all] Error 2

the current CMakeCache.txt file http://pastebin.com/raw.php?i=K082fREt

Comment by Vladislav Vaintroub [ 2013-05-24 ]

Strange. Perhaps the difference is that I used later cmake on my box. Anyway.

try following
rm CMakeCache.txt
cmake . -DMYSQL_LIBRARIES_mysqlclient_r=/usr/lib64/libmysqlclient_r.a
make

The above forces using static library for linking . I hope that this static library is there on your machine (if I install MariaDB-devel, it is there)

Comment by George L [ 2013-05-24 ]

Sweet success ! That was the fix needed

Vladislav you're a life saver - thanks for all the help !!!

Scanning dependencies of target mydumper
[ 20%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o
[ 40%] Building C object CMakeFiles/mydumper.dir/binlog.c.o
[ 60%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o
[ 80%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o
Linking C executable mydumper
[ 80%] Built target mydumper
Scanning dependencies of target myloader
[100%] Building C object CMakeFiles/myloader.dir/myloader.c.o
Linking C executable myloader
[100%] Built target myloader

Comment by Vladislav Vaintroub [ 2013-05-24 ]

Attached a full patch for mydumper that would prefer linking libmysqlclient_r statically. If you apply it , you should be able to build mydumper using just

cmake . && make

Comment by George L [ 2013-05-24 ]

Tested new patch and confirm all works with just cmake . && make

thanks Vladislav

Generated at Thu Feb 08 06:57:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.