[MDEV-12920] Header changes in MariaDB 10.1.23 ? Created: 2017-05-25  Updated: 2017-06-13

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.1.23
Fix Version/s: 10.1

Type: Bug Priority: Major
Reporter: jocelyn fournier Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None
Environment:

gcc 6.3.0 on Ubuntu zesty


Issue Links:
Blocks
is blocked by MDEV-8843 Ship TokuBackup as part of MariaDB Closed

 Description   

Hi,

I'm trying to compile tokudb-backup against 10.1.23 and it fails with the following error :

[100%] Building CXX object plugin/tokudb-backup-plugin/CMakeFiles/tokudb_backup.dir/tokudb_backup.cc.o
[100%] Linking CXX shared module tokudb_backup.so
CMakeFiles/tokudb_backup.dir/tokudb_backup.cc.o: In function `tokudb_backup_progress_fun(float, char const*, void*)':
/home/scadmin/mariadb/plugin/tokudb-backup-plugin/tokudb_backup.cc:107: undefined reference to `my_realloc'
CMakeFiles/tokudb_backup.dir/tokudb_backup.cc.o: In function `tokudb_backup_check_throttle(THD*, st_mysql_sys_var*, void*, st_mysql_value*)':
/home/scadmin/mariadb/plugin/tokudb-backup-plugin/tokudb_backup.cc:640: undefined reference to `check_global_access(THD*, unsigned long, bool)'
CMakeFiles/tokudb_backup.dir/tokudb_backup.cc.o: In function `tokudb_backup_set_error_string(THD*, int, char const*, char const*, char const*, char const*) [clone .constprop.18]':
/home/scadmin/mariadb/plugin/tokudb-backup-plugin/tokudb_backup.cc:128: undefined reference to `my_malloc'

There's no compile issue with MariaDB 10.1.22 source code.

How to repeat:

Get 10.1.23 source code, extract and then :

cd mariadb-10.1.23;
cd plugin
git clone https://github.com/percona/tokudb-backup-plugin
cd tokudb-backup-plugin
git checkout tokudb-backup-0.17
git clone https://github.com/percona/Percona-TokuBackup
cd Percona-TokuBackup 
git checkout tokudb-backup-0.17
cd ..
rm -rf backup
ln -s Percona-TokuBackup/backup .
cd ../../../
rm -rf mariadb-server-build
mkdir mariadb-server-build
cd mariadb-server-build
cmake -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=../tokudb-backup -DTOKUDB_BACKUP_PLUGIN_VERSION=tokudb-backup-0.17 ../mariadb-10.1.23
cd plugin/tokudb-backup-plugin
make -j8

I do not expect this kind issue between minor version upgrade.

Thanks,
Jocelyn Fournier



 Comments   
Comment by Sergei Golubchik [ 2017-05-25 ]

This was probably caused by this commit: 7bf409593e.
In that commit we've cleaned up most plugins not to randomly use server internal symbols. And now we compile plugins with -Wl,--no-undefined which tells the linker that plugins should not have undefined symbols.

Storage engines are exempt from this rule, as are plugins that use RECOMPILE_FOR_EMBEDDED keyword (which explicitly means that a plugin bypasses the API and relies on server internals).

This commit does not change the ABI, it only affects how plugins are compiled.

Comment by jocelyn fournier [ 2017-05-25 ]

That's annoying. If I try to use the .so compiled with the 10.1.22 source, it doesn't work with 10.1.23:
2017-05-25 22:05:41 139951371901184 [ERROR] Can't open shared library 'tokudb_backup.so' (errno: 8, API version for DAEMON plugin tokudb_backup not supported by this version of the server)

Comment by Sergei Golubchik [ 2017-05-26 ]

Yes, this was always the case, since 5.5 or earlier. Some plugins have stable API, and their API version doesn't change for years. Some plugins have kind of unstable API, and there API version is set to match the server version, so old compiled plugins won't work. Storage engines are like that. And daemons too, for some reason, although they probably shouldn't be.

Anyway, your immediate workaround would be to add RECOMPILE_FOR_EMBEDDED to the CMakeLists.txt of this plugin. Like for MyISAM:

MYSQL_ADD_PLUGIN(myisam ${MYISAM_SOURCES} 
  STORAGE_ENGINE 
  MANDATORY 
  RECOMPILE_FOR_EMBEDDED)

Comment by jocelyn fournier [ 2017-05-26 ]

Thanks Sergei, I was able to compile successfully the plugin with the extra RECOMPILE_FOR_EMBEDDED

Comment by Sergei Golubchik [ 2017-05-26 ]

joce, I don't know what kind of fix we can do for this bug. I can freeze the Daemon API version, so that old daemon plugin binaries would work for newer servers. That's only guaranteed to work, of course, if the plugin doesn't use RECOMPILE_FOR_EMBEDDED, so it won't help you much.

Comment by jocelyn fournier [ 2017-05-26 ]

Why not marking all plugins impure by default in 10.1 to not break compatibly with old modules, explicitly declare mariabackup as pure, and let the "pure" by default change for 10.2?

Another option would be to include tokudb_backup as an official plugin
Or even better support both MyRocks and TokuDB in the new MariaDB backup.

Comment by Sergei Golubchik [ 2017-05-26 ]

Ok, thanks. I'll make it dependent on MDEV-8843 (Ship TokuBackup as part of MariaDB).

Generated at Thu Feb 08 08:01:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.