[MDEV-15034] Jemalloc 5 breaks TokuDB Created: 2018-01-22 Updated: 2023-04-27 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Server, Storage Engine - TokuDB |
| Affects Version/s: | 10.2.12 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Michal Schorm | Assignee: | Vicențiu Ciorbaru |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | upstream | ||
| Environment: |
Fedora Rawhide - Koji Building system |
||
| Description |
|
Hello, I can't build MariaDB with TokuDB while passing the testsuite on x64_64. I've built 10.2.12 into Fedora without TokuDB without any problem. However the users have broken update path, if new TokuDB subpackage is not provided. – The testsuite will freeze on one tests - that is not always the same and does not belong to TokuDB testsuite. Few times, I'm lucky and the testsuite won't freeze. But in such case, >500 test will fail (when none should). – I filed this report now, because I need to start working on it and any help will be appreciated. I'll gather as much info as I can and I'll try to make reproducer in other places, that Fedora build system with Rawhide buildroot. |
| Comments |
| Comment by Daniel Black [ 2018-01-22 ] | |||||||||||||||||||||||
|
Is a url for that build available? I only see the ones after you disabled tokudb. https://koji.fedoraproject.org/koji/builds?userID=mschorm&order=-build_id&prefix=m | |||||||||||||||||||||||
| Comment by Michal Schorm [ 2018-01-23 ] | |||||||||||||||||||||||
|
I made a latest scratch build, to ensure that the issue didn't vanished in a meantime: You can see that:
instead of
or
| |||||||||||||||||||||||
| Comment by Elena Stepanova [ 2018-01-23 ] | |||||||||||||||||||||||
|
It doesn't know the option --tokudb because as it says earlier, it cannot load plugins from ha_tokudb.so, including the engine itself. Why it cannot load plugins, that's the question. | |||||||||||||||||||||||
| Comment by Michal Schorm [ 2018-01-23 ] | |||||||||||||||||||||||
|
I forgot to paste the link to the whole build, my bad: All the available logs are accessible from there. | |||||||||||||||||||||||
| Comment by Elena Stepanova [ 2018-01-23 ] | |||||||||||||||||||||||
|
It might be the problem that cvicentiu investigated just recently, with jemalloc 5.0. This log shows jemalloc 5.0.1:
| |||||||||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2018-01-23 ] | |||||||||||||||||||||||
|
Hi mschorm https://raw.githubusercontent.com/jemalloc/jemalloc/master/ChangeLog Currently I don't have a solution to this. | |||||||||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2018-01-23 ] | |||||||||||||||||||||||
|
From Jemalloc's ChangeLog: I'm not sure how stable the link is.
| |||||||||||||||||||||||
| Comment by Michal Schorm [ 2018-02-18 ] | |||||||||||||||||||||||
|
Discussion on the Percona upstream: TDB-108 | |||||||||||||||||||||||
| Comment by Michal Schorm [ 2019-01-23 ] | |||||||||||||||||||||||
|
It seems, everything works (in the built package). However I still hit:
CMake warning message originating from "storage/tokudb/CMakeLists.txt" line 51. And from looking at "storage/tokudb/CMakeLists.txt" and "cmake/jemalloc.cmake" I wasn't able to tell if it's an real issue or just a false positive. My CMake configuration is: I have "jemalloc-devel" package in the buildroot. SPECfile: I do then ship the built package with:
in the /usr/lib/systemd/system/mariadb.service.d/tokudb.conf (but I don't have this configuration in the buildroot - can that be an issue?) | |||||||||||||||||||||||
| Comment by Michal Schorm [ 2019-05-10 ] | |||||||||||||||||||||||
|
Can be closed. I finally found a solution. The "WITH_JEMALLOC" is likethe only option, that does not accept uppercase values, beacuse it's not CMake bool, but a string, which does not have those uppercase values defined. When using "yes" or "no", it works as expected. — Offtopic question: | |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2019-05-10 ] | |||||||||||||||||||||||
|
We used to link ha_tokudb.so with jemalloc. But it means that jemalloc was loaded run-time (with ha_tokudb.so) into an already running process (mysqld). This sounds like a suspicious idea. Still it used to work until jemalloc 5. With jemalloc 5 it broke completely, jemalloc failed to initialize when loaded run-time. It wanted to handle the whole process. So, I've came up with this LD_PRELOAD approach. When tokudb rpm is not installed, there is no jemalloc. And tokudb rpm brings in /usr/lib/systemd/system/mariadb.service.d/tokudb.conf which LD_PRELOADs jemalloc for the whole server. As a bonus a user has a freedom not to load jemalloc or to load, say, tcmalloc instead — some users have requested that. |