[MDEV-5142] Fatal memory leak in MariaDB 5.5.30 - any workaround? Created: 2013-10-15  Updated: 2013-11-07  Due: 2013-11-21  Resolved: 2013-10-28

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

Type: Bug Priority: Critical
Reporter: Ján Regeš Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: Memory_leak, tokudb
Environment:

Gentoo Linux, TokuDB with MariaDB 5.5.30



 Description   

Hi,

we are trying to test latest TokuDB with our project (TokuDB 7.1 with MariaDB 5.5.30)

TokuDB works fine, but we found one fatal memory leak. It not depends on MySQL engine (tested with TokuDB, InnoDB, MYISAM).

Below is link to TokuDB issue with example and steps to reproduce.
https://groups.google.com/forum/#!topic/tokudb-user/hkYkLIjCiVs

After consultations with TokuDB support, it looks like a bug in MariaDB 5.5.30. But, this bug isn't in MariaDB 5.5.33a. By info from TokuDB, latest MariaDB will be used at end of year - too late for us.

I see, that MariaDB has own TokuDB implementation, but it's not available for Gentoo Linux.

Question 1: is possible to combine latest MariaDB (without this bug) with TokuDB on Gentoo Linux?

Question 2: do you know about this memory leak? Maybe is there some simple applicable workaround/patch?

Thank you.



 Comments   
Comment by Elena Stepanova [ 2013-10-15 ]

Do you use binary packages or do you buld from source? If you are building from 5.5.33a source, what kind of problem do you have with building the server with TokuDB?

Comment by Ján Regeš [ 2013-10-15 ]

Hi Elena,

in first, thank you for you quick response.

I use this binary package: http://www.tokutek.com/download.php?download_file=mariadb-5.5.30-tokudb-7.1.0-linux-x86_64.tar.gz

It is possible to build MariaDB 5.5.33a with TokuDB? How? TokuDB has patched MariaDB only in version 5.5.30.

Thank you!

Comment by Ján Regeš [ 2013-10-15 ]

I'm going to try this procedure:

1) Install standard MariaDB 5.5.33a
2) Download RPM for Ubuntu (mariadb-engine-tokudb-5.5.33a-alt2.x86_64.rpm)
3) Unpack RPM by rpm2cpio & cpio
4) Then, i will try to install extracted ./usr/lib64/mysql/plugin/ha_tokudb.so into my MariaDB

Maybe, ha_tokudb.so will be compatible?

Comment by Elena Stepanova [ 2013-10-15 ]

Hi Ján,

Yes, it's possible to build MariaDB 5.5.33a with TokuDB if the system meets the requirements (it needs to be x86_64, have cmake 2.8.9+ and gcc 4.7+). You can just pick up the source package and try
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo && make

If everything works okay, TokuDB should be built as a plugin ha_tokudb.so which you install as usual.

Regarding your Q2, I needed to look at your use case – yes, we had a few bug reports for 5.5.30 each of which might cause the problem you observe (they were closely related anyway):
MDEV-4336
MDEV-4461
MDEV-4498
all of which were fixed in 5.5.31.

Sadly, there weren't any simple workarounds as far as i remember.

Comment by Elena Stepanova [ 2013-10-15 ]

There is no RPM for Ubuntu, but we provide deb packages, yes, you can try that. I did try to install on Ubuntu Precise the plugin built for Debian Wheezy and it worked, but we didn't do any performance testing to confirm that there is no degradation due to the cross system trick.

Comment by Ján Regeš [ 2013-10-15 ]

Elena, excellent answers!

So, i will:

1) Install MariaDB 5.5.33a by your binaries for Linux x86_64
2) download DEB from http://mirror.vpsfree.cz/mariadb/mariadb-5.5.33a/repo/debian/pool/main/m/mariadb-5.5/ (exactly mariadb-tokudb-engine-5.5_5.5.33a+maria-1~wheezy_amd64.deb)
3) unpack DEB
4) install ha_tokudb.so as usual

After this, i will report you my results

Thank you for you awesome support!

Comment by Ján Regeš [ 2013-10-16 ]

Hi Elena,

unfortunately, after installation, when i copied ha_tokudb.so and install it, is not possible to create TokuDB table and MySQL disconnect.

I use syntax like CREATE TABLE x [cols] ENGINE=TokuDB COMPRESSION=tokudb_lzma;

Below are error log and "show variables" result.

===== error log =====

131016 0:12:00 [Note] Event Scheduler: scheduler thread started with id 1
131016 0:12:10 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see http://kb.askmonty.org/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

Server version: 5.5.33a-MariaDB-log
key_buffer_size=536870912
read_buffer_size=1048576
max_used_connections=2
max_threads=102
thread_count=3
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1048331 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0x7f8feffd0000
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7f92eb4e4e20 thread_stack 0x80000
mysys/stacktrace.c:247(my_print_stacktrace)[0xb0bc9e]
sql/signal_handler.cc:153(handle_fatal_signal)[0x6eea32]
:0()[0x7f92edc3d170]
:0()[0x7f92ea8bed15]
sql/table.cc:1819(open_binary_frm)[0x632f51]
sql/handler.cc:4055(ha_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, bool))[0x6f5fc1]
sql/unireg.cc:500(rea_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, List<Create_field>&, unsigned int, st_key*, handler*))[0x63c69d]
sql/sql_table.cc:4483(mysql_create_table_no_lock(THD*, char const*, char const*, st_ha_create_information*, Alter_info*, bool, unsigned int, bool*))[0x60b560]
sql/sql_table.cc:4588(mysql_create_table(THD*, TABLE_LIST*, st_ha_create_information*, Alter_info*))[0x60c1a3]
sql/sql_parse.cc:2616(mysql_execute_command(THD*))[0x59827e]
sql/sql_parse.cc:5769(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x598490]
sql/sql_parse.cc:1073(dispatch_command(enum_server_command, THD*, char*, unsigned int))[0x599bce]
sql/sql_parse.cc:794(do_command(THD*))[0x59a13b]
sql/sql_connect.cc:1266(do_handle_one_connection(THD*))[0x6558d4]
sql/sql_connect.cc:1183(handle_one_connection)[0x655a0c]
:0()[0x7f92edc35bd5]
:0()[0x7f92ecd2bd7d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f8fbc023018): is an invalid pointer
Connection ID (thread ID): 3
Status: NOT_KILLED

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived
with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with
cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
131016 00:12:10 mysqld_safe Number of processes running now: 0
131016 00:12:10 mysqld_safe mysqld restarted
131016 0:12:10 [Warning] Using unique option prefix myisam_recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
131016 0:12:10 InnoDB: The InnoDB memory heap is disabled
131016 0:12:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
131016 0:12:10 InnoDB: Compressed tables use zlib 1.2.3
131016 0:12:10 InnoDB: Using Linux native AIO
131016 0:12:10 InnoDB: Initializing buffer pool, size = 10.0G
131016 0:12:11 InnoDB: Completed initialization of buffer pool
131016 0:12:11 InnoDB: highest supported file format is Barracuda.
131016 0:12:11 InnoDB: Waiting for the background threads to start
131016 0:12:12 Percona XtraDB (http://www.percona.com) 5.5.33a-MariaDB-31.1 started; log sequence number 1957029
131016 0:12:12 [Note] Plugin 'FEEDBACK' is disabled.
Wed Oct 16 00:12:12 2013 Tokudb recovery starting in env /opt/tokudb/data/
Wed Oct 16 00:12:12 2013 Tokudb recovery scanning backward from 357
Wed Oct 16 00:12:12 2013 Tokudb recovery bw_end_checkpoint at 357 timestamp 1381875120623132 xid 353 (bw_newer)
Wed Oct 16 00:12:12 2013 Tokudb recovery bw_begin_checkpoint at 353 timestamp 1381875120623126 (bw_between)
Wed Oct 16 00:12:12 2013 Tokudb recovery turning around at begin checkpoint 353 time 6
Wed Oct 16 00:12:12 2013 Tokudb recovery starts scanning forward to 357 from 353 left 4 (fw_between)
Wed Oct 16 00:12:12 2013 Tokudb recovery closing 2 dictionaries
Wed Oct 16 00:12:12 2013 Tokudb recovery making a checkpoint
Wed Oct 16 00:12:12 2013 Tokudb recovery done
131016 0:12:12 [Note] Recovering after a crash using tc.log
131016 0:12:12 [Note] Starting crash recovery...
131016 0:12:12 [Note] Crash recovery finished.
131016 0:12:12 [Note] Server socket created on IP: '0.0.0.0'.

===== show variables =====

aria_block_size 8192
aria_checkpoint_interval 30
aria_checkpoint_log_activity 1048576
aria_force_start_after_recovery_failures 0
aria_group_commit none
aria_group_commit_interval 0
aria_log_file_size 1073741824
aria_log_purge_type immediate
aria_max_sort_file_size 9223372036853727232
aria_page_checksum ON
aria_pagecache_age_threshold 300
aria_pagecache_buffer_size 134217728
aria_pagecache_division_limit 100
aria_recover NORMAL
aria_repair_threads 1
aria_sort_buffer_size 134217728
aria_stats_method nulls_unequal
aria_sync_log_dir NEWFILE
aria_used_for_temp_tables ON
auto_increment_increment 1
auto_increment_offset 1
autocommit ON
automatic_sp_privileges ON
back_log 50
basedir /opt/tokudb
big_tables OFF
binlog_annotate_row_events OFF
binlog_cache_size 16777216
binlog_checksum NONE
binlog_direct_non_transactional_updates OFF
binlog_format STATEMENT
binlog_optimize_thread_scheduling ON
binlog_stmt_cache_size 32768
bulk_insert_buffer_size 8388608
character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8
character_sets_dir /mnt/ssd-200gb/opt/tokudb/share/charsets/
collation_connection utf8_general_ci
collation_database utf8_general_ci
collation_server utf8_general_ci
completion_type NO_CHAIN
concurrent_insert AUTO
connect_timeout 10
datadir /opt/tokudb/data/
date_format %Y-%m-%d
datetime_format %Y-%m-%d %H:%i:%s
deadlock_search_depth_long 15
deadlock_search_depth_short 4
deadlock_timeout_long 50000000
deadlock_timeout_short 10000
debug_no_thread_alarm OFF
default_storage_engine InnoDB
default_week_format 0
delay_key_write ON
delayed_insert_limit 100
delayed_insert_timeout 300
delayed_queue_size 1000
div_precision_increment 4
engine_condition_pushdown OFF
error_count 0
event_scheduler ON
expensive_subquery_limit 100
expire_logs_days 0
external_user
extra_max_connections 1
extra_port 0
flush OFF
flush_time 0
foreign_key_checks ON
ft_boolean_syntax + -><()~*:""&|
ft_max_word_len 84
ft_min_word_len 4
ft_query_expansion_limit 20
ft_stopword_file (built-in)
general_log ON
general_log_file /opt/tokudb/log/general.log
group_concat_max_len 65536
have_compress YES
have_crypt YES
have_csv YES
have_dynamic_loading YES
have_geometry YES
have_innodb YES
have_ndbcluster NO
have_openssl DISABLED
have_partitioning YES
have_profiling YES
have_query_cache YES
have_rtree_keys YES
have_ssl DISABLED
have_symlink YES
hostname myxdb01
identity 0
ignore_builtin_innodb OFF
ignore_db_dirs
in_transaction 0
init_connect
init_file
init_slave
innodb_adaptive_flushing ON
innodb_adaptive_flushing_method estimate
innodb_adaptive_hash_index ON
innodb_adaptive_hash_index_partitions 1
innodb_additional_mem_pool_size 8388608
innodb_autoextend_increment 8
innodb_autoinc_lock_mode 1
innodb_blocking_buffer_pool_restore OFF
innodb_buffer_pool_instances 1
innodb_buffer_pool_populate OFF
innodb_buffer_pool_restore_at_startup 0
innodb_buffer_pool_shm_checksum ON
innodb_buffer_pool_shm_key 0
innodb_buffer_pool_size 10737418240
innodb_change_buffering all
innodb_checkpoint_age_target 0
innodb_checksums ON
innodb_commit_concurrency 0
innodb_concurrency_tickets 500
innodb_corrupt_table_action assert
innodb_data_file_path ibdata1:128M;ibdata2:50M:autoextend
innodb_data_home_dir
innodb_dict_size_limit 0
innodb_doublewrite OFF
innodb_doublewrite_file
innodb_fake_changes OFF
innodb_fast_checksum OFF
innodb_fast_shutdown 1
innodb_file_format Barracuda
innodb_file_format_check ON
innodb_file_format_max Barracuda
innodb_file_per_table ON
innodb_flush_log_at_trx_commit 2
innodb_flush_method O_DIRECT
innodb_flush_neighbor_pages area
innodb_force_load_corrupted OFF
innodb_force_recovery 0
innodb_ibuf_accel_rate 100
innodb_ibuf_active_contract 1
innodb_ibuf_max_size 5368692736
innodb_import_table_from_xtrabackup 0
innodb_io_capacity 3000
innodb_kill_idle_transaction 0
innodb_large_prefix OFF
innodb_lazy_drop_table 0
innodb_lock_wait_timeout 300
innodb_locking_fake_changes ON
innodb_locks_unsafe_for_binlog OFF
innodb_log_block_size 512
innodb_log_buffer_size 16777216
innodb_log_file_size 1073741824
innodb_log_files_in_group 3
innodb_log_group_home_dir ./
innodb_max_bitmap_file_size 104857600
innodb_max_changed_pages 1000000
innodb_max_dirty_pages_pct 90
innodb_max_purge_lag 0
innodb_merge_sort_block_size 1048576
innodb_mirrored_log_groups 1
innodb_old_blocks_pct 37
innodb_old_blocks_time 0
innodb_open_files 2000
innodb_page_size 16384
innodb_print_all_deadlocks OFF
innodb_purge_batch_size 20
innodb_purge_threads 1
innodb_random_read_ahead OFF
innodb_read_ahead linear
innodb_read_ahead_threshold 56
innodb_read_io_threads 8
innodb_recovery_stats OFF
innodb_recovery_update_relay_log OFF
innodb_replication_delay 0
innodb_rollback_on_timeout OFF
innodb_rollback_segments 128
innodb_show_locks_held 10
innodb_show_verbose_locks 0
innodb_spin_wait_delay 6
innodb_stats_auto_update 1
innodb_stats_method nulls_equal
innodb_stats_on_metadata ON
innodb_stats_sample_pages 8
innodb_stats_update_need_lock 1
innodb_strict_mode OFF
innodb_support_xa OFF
innodb_sync_spin_loops 30
innodb_table_locks ON
innodb_thread_concurrency 8
innodb_thread_concurrency_timer_based OFF
innodb_thread_sleep_delay 10000
innodb_track_changed_pages OFF
innodb_use_atomic_writes OFF
innodb_use_fallocate OFF
innodb_use_global_flush_log_at_trx_commit ON
innodb_use_native_aio ON
innodb_use_sys_malloc ON
innodb_use_sys_stats_table OFF
innodb_version 5.5.33a-MariaDB-31.1
innodb_write_io_threads 8
insert_id 0
interactive_timeout 28800
join_buffer_size 4194304
join_buffer_space_limit 2097152
join_cache_level 2
keep_files_on_create OFF
key_buffer_size 536870912
key_cache_age_threshold 300
key_cache_block_size 1024
key_cache_division_limit 100
key_cache_segments 0
large_files_support ON
large_page_size 0
large_pages OFF
last_insert_id 0
lc_messages en_US
lc_messages_dir
lc_time_names en_US
license GPL
local_infile ON
lock_wait_timeout 31536000
locked_in_memory OFF
log ON
log_bin OFF
log_bin_trust_function_creators OFF
log_error /opt/tokudb/log/mysqld.err
log_output FILE
log_queries_not_using_indexes OFF
log_slave_updates OFF
log_slow_filter admin,filesort,filesort_on_disk,full_join,full_scan,query_cache,query_cache_miss,tmp_table,tmp_table_on_disk
log_slow_queries OFF
log_slow_rate_limit 1
log_slow_verbosity
log_warnings 2
long_query_time 5.000000
low_priority_updates OFF
lower_case_file_system OFF
lower_case_table_names 0
master_verify_checksum OFF
max_allowed_packet 16777216
max_binlog_cache_size 18446744073709547520
max_binlog_size 1073741824
max_binlog_stmt_cache_size 18446744073709547520
max_connect_errors 100
max_connections 100
max_delayed_threads 20
max_error_count 64
max_heap_table_size 536870912
max_insert_delayed_threads 20
max_join_size 18446744073709551615
max_length_for_sort_data 1024
max_long_data_size 16777216
max_prepared_stmt_count 500000
max_relay_log_size 0
max_seeks_for_key 4294967295
max_sort_length 1024
max_sp_recursion_depth 0
max_tmp_tables 32
max_user_connections 0
max_write_lock_count 4294967295
metadata_locks_cache_size 1024
min_examined_row_limit 0
mrr_buffer_size 262144
multi_range_count 256
myisam_block_size 1024
myisam_data_pointer_size 6
myisam_max_sort_file_size 10737418240
myisam_mmap_size 18446744073709551615
myisam_recover_options DEFAULT
myisam_repair_threads 1
myisam_sort_buffer_size 8388608
myisam_stats_method nulls_unequal
myisam_use_mmap OFF
net_buffer_length 32768
net_read_timeout 30
net_retry_count 10
net_write_timeout 60
old OFF
old_alter_table OFF
old_passwords OFF
open_files_limit 65536
optimizer_prune_level 1
optimizer_search_depth 1
optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off
performance_schema OFF
performance_schema_events_waits_history_long_size 10000
performance_schema_events_waits_history_size 10
performance_schema_max_cond_classes 80
performance_schema_max_cond_instances 1000
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 1000000
performance_schema_max_rwlock_classes 30
performance_schema_max_rwlock_instances 1000000
performance_schema_max_table_handles 100000
performance_schema_max_table_instances 50000
performance_schema_max_thread_classes 50
performance_schema_max_thread_instances 1000
pid_file /opt/tokudb/run/mysqld-tokudb.pid
plugin_dir /opt/tokudb/lib/plugin/
plugin_maturity unknown
port 3308
preload_buffer_size 32768
profiling ON
profiling_history_size 15
progress_report_time 56
protocol_version 10
proxy_user
pseudo_slave_mode OFF
pseudo_thread_id 2
query_alloc_block_size 8192
query_cache_limit 536870912
query_cache_min_res_unit 4096
query_cache_size 536870912
query_cache_strip_comments OFF
query_cache_type ON
query_cache_wlock_invalidate OFF
query_prealloc_size 8192
rand_seed1 0
rand_seed2 0
range_alloc_block_size 4096
read_buffer_size 1048576
read_only OFF
read_rnd_buffer_size 4194304
relay_log
relay_log_index
relay_log_info_file relay-log.info
relay_log_purge ON
relay_log_recovery OFF
relay_log_space_limit 0
replicate_annotate_row_events OFF
replicate_do_db
replicate_do_table
replicate_events_marked_for_skip replicate
replicate_ignore_db
replicate_ignore_table
replicate_wild_do_table
replicate_wild_ignore_table
report_host
report_password
report_port 3308
report_user
rowid_merge_buff_size 8388608
rpl_recovery_rank 0
secure_auth OFF
secure_file_priv
server_id 10
skip_external_locking ON
skip_name_resolve ON
skip_networking OFF
skip_replication OFF
skip_show_database OFF
slave_compressed_protocol OFF
slave_exec_mode STRICT
slave_load_tmpdir /tmp
slave_max_allowed_packet 1073741824
slave_net_timeout 3600
slave_skip_errors OFF
slave_sql_verify_checksum ON
slave_transaction_retries 10
slave_type_conversions
slow_launch_time 2
slow_query_log OFF
slow_query_log_file /opt/tokudb/log/slow_query.log
socket /opt/tokudb/run/mysqld-tokudb.sock
sort_buffer_size 4194304
sql_auto_is_null OFF
sql_big_selects ON
sql_big_tables OFF
sql_buffer_result OFF
sql_log_bin ON
sql_log_off OFF
sql_low_priority_updates OFF
sql_max_join_size 18446744073709551615
sql_mode
sql_notes ON
sql_quote_show_create ON
sql_safe_updates OFF
sql_select_limit 18446744073709551615
sql_slave_skip_counter 0
sql_warnings OFF
ssl_ca
ssl_capath
ssl_cert
ssl_cipher
ssl_key
storage_engine InnoDB
stored_program_cache 256
sync_binlog 0
sync_frm ON
sync_master_info 0
sync_relay_log 0
sync_relay_log_info 0
system_time_zone CEST
table_definition_cache 400
table_open_cache 2048
thread_cache_size 1000
thread_concurrency 8
thread_handling one-thread-per-connection
thread_pool_idle_timeout 60
thread_pool_max_threads 500
thread_pool_oversubscribe 3
thread_pool_size 16
thread_pool_stall_limit 500
thread_stack 524288
time_format %H:%i:%s
time_zone SYSTEM
timed_mutexes OFF
timestamp 1381875456.926299
tmp_table_size 536870912
tmpdir /tmp
tokudb_analyze_time 60
tokudb_block_size 4194304
tokudb_cache_size 67622520832
tokudb_checkpoint_lock OFF
tokudb_checkpoint_on_flush_logs OFF
tokudb_checkpointing_period 60
tokudb_cleaner_iterations 5
tokudb_cleaner_period 1
tokudb_commit_sync ON
tokudb_create_index_online ON
tokudb_data_dir
tokudb_debug 0
tokudb_directio OFF
tokudb_disable_hot_alter OFF
tokudb_disable_prefetching OFF
tokudb_disable_slow_alter OFF
tokudb_fs_reserve_percent 5
tokudb_fsync_log_period 0
tokudb_gdb_on_fatal ON
tokudb_gdb_path /usr/bin/gdb
tokudb_init_flags 11403457
tokudb_load_save_space OFF
tokudb_lock_timeout 4000
tokudb_log_client_errors OFF
tokudb_log_dir
tokudb_max_lock_memory 8452815104
tokudb_pk_insert_mode 1
tokudb_prelock_empty ON
tokudb_read_block_size 131072
tokudb_read_buf_size 131072
tokudb_read_status_frequency 10000
tokudb_row_format tokudb_default
tokudb_tmp_dir
tokudb_version 7.0.4
tokudb_write_status_frequency 1000
transaction_alloc_block_size 8192
transaction_prealloc_size 4096
tx_isolation REPEATABLE-READ
unique_checks ON
updatable_views_with_limit YES
userstat OFF
version 5.5.33a-MariaDB-log
version_comment MariaDB Server
version_compile_machine x86_64
version_compile_os Linux
wait_timeout 28800
warning_count 0

Comment by Elena Stepanova [ 2013-10-16 ]

Too bad. Apparently Gentoo and Ubuntu have less in common than Ubuntu and Debian

I have a 64-bit Gentoo, will try to build the server with TokuDB there (need to install gcc 4.7+ first, it might be not fast in a VM), will let you know whether it works.

Comment by Ján Regeš [ 2013-10-16 ]

Elena, thank you.

If you have any result, tell me.

Btw, i used MariaDB 5.5.33a (binary - mariadb-5.5.33a-linux-x86_64.tar.gz) and then copied ha_tokudb.so from DEB, and for next test also from overlay http://gpo.zugaina.org/dev-db/mariadb (MariaDB 5.5.33a with tokudb USE flag). Both ha_tokudb.so without success.

Comment by Elena Stepanova [ 2013-10-17 ]

Hi Ján,

I was able to build the plugin on Gentoo without a problem (after I had managed to install gcc 4.7.2). I can create a table, and I also ran some of TokuDB tests from the package, which mostly passed; there are a couple that fail, but we had them on the release builds as well.
I have Gentoo Base System release 2.1, Linux gentoo 3.6.11-gentoo – is it enough to determine the version? I'm not really a Gentoo user, so I don't know the routine.

Anyway, I've uploaded the library to our ftp at ftp://ftp.askmonty.org/public , the file ha_tokudb.so.gentoo, you can try it out. If it doesn't work for you either, I suggest trying to build the server with TokuDB on the local machine.

Comment by Sergei Golubchik [ 2013-10-17 ]

Ján, fwiw, I'm using Gentoo on my primary development box and routinely build MariaDB + TokuDB there.
You need gcc 4.7 and cmake 2.8.10 (? don't remember. I have 2.8.11.2). And, as far as I remember, that's all.

But I didn't try to build MariaDB from the zugania overlay.

Comment by Alexey Zilber [ 2013-10-18 ]

I'm having a similar issue using the same TokuDB package on Centos6. Similar in that it takes about 2-3 days for MariaDB 5.5.30 to completely eat up all system ram. tokudb_cache_size = 60G on a system with 128GB of ram. It seems to eat ram faster after it reaches about 75GB in use.

I do not use views or joins.

Comment by Elena Stepanova [ 2013-10-18 ]

Hi Alexey,

It doesn't really look any similar to the problem in this bug report apart from it being also an issue with memory. If you have a reason to believe that it's a leak in MariaDB server rather than in TokuDB engine, could you please file a separate bug report? Although, since it's going to be hard to reproduce locally due to the nature of the problem (several days, unknown schema, unknown workflow), it would be really great if you could try MariaDB 5.5.33a with TokuDB and see if you still observe it.

Thanks.

Comment by Elena Stepanova [ 2013-10-22 ]

Hi Ján,

Did either the uploaded binary or a build from source work for you as a workaround?

Comment by Ján Regeš [ 2013-10-24 ]

Hi Elena,

Unfortunatelly, problem still exists

1) I use latest Gentoo with kernel 3.11.6 and with all packages in latest versions (GLIBC 2.17)
2) I installed from binaries "mariadb-5.5.33a-linux-x86_64.tar.gz (requires GLIBC_2.14+)"
3) I put your ha_tokudb.so from ftp://ftp.askmonty.org/public into plugins and set "plugin-load = ha_tokudb" into my.cnf
4) Now, sample database with innodb works file - also with view
5) But, when i try to create any TokuDB table, or change existing table engine to TokuDB, mysql crashed.

Details below. Thank you.

Now, i will trying to build MariaDB also from source "mariadb-5.5.33a.tar.gz".

EXAMPLE SQL:
--------------------

[SQL]CREATE TABLE `balicek2` (
`id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
`apl_kod` varchar(30) NOT NULL,
`nazev` varchar(100) NOT NULL,
`pristupny_partnerum` char(1) DEFAULT 'N',
PRIMARY KEY (`id`),
UNIQUE KEY `UK_apl_kod` (`apl_kod`) USING BTREE
) ENGINE=TokuDB DEFAULT CHARSET=utf8 COMPRESSION=TOKUDB_LZMA;
[Err] 2003 - Can't connect to MySQL server on '192.168.2.9' (10038)

LOG:
-------

131024 15:08:50 [Note] /opt/tokudb/bin/mysqld: ready for connections.
Version: '5.5.33a-MariaDB-log' socket: '/opt/tokudb/run/mysqld-tokudb.sock' port: 3307 MariaDB Server
131024 15:08:50 [Note] Event Scheduler: scheduler thread started with id 1
131024 15:13:46 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see http://kb.askmonty.org/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

Server version: 5.5.33a-MariaDB-log
key_buffer_size=536870912
read_buffer_size=1048576
max_used_connections=8
max_threads=102
thread_count=8
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1048331 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0x7ffa87efe000
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7ffa77556e20 thread_stack 0x80000
mysys/stacktrace.c:247(my_print_stacktrace)[0xad495b]
sql/signal_handler.cc:153(handle_fatal_signal)[0x6db194]
:0()[0x7ffbe29d9170]
:0()[0x7ffbdfc6d715]
sql/table.cc:1819(open_binary_frm)[0x63b01d]
sql/handler.cc:4055(ha_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, bool))[0x6e2992]
sql/unireg.cc:500(rea_create_table(THD*, char const*, char const*, char const*, st_ha_create_information*, List<Create_field>&, unsigned int, st_key*, handler*))[0x64b9f7]
sql/sql_table.cc:4483(mysql_create_table_no_lock)[0x61499d]
sql/sql_table.cc:6738(mysql_alter_table(THD*, char*, char*, st_ha_create_information*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool, bool))[0x61b659]
sql/sql_alter.cc:106(Alter_table_statement::execute(THD*))[0x814ff2]
sql/sql_parse.cc:4485(mysql_execute_command(THD*))[0x59efb8]
sql/sql_parse.cc:5769(mysql_parse)[0x5a51e4]
sql/sql_parse.cc:5720(mysql_parse)[0x5a781f]
sql/sql_connect.cc:1266(do_handle_one_connection(THD*))[0x6608b3]
sql/sql_connect.cc:1183(handle_one_connection)[0x6609fc]
:0()[0x7ffbe29d1bd5]
:0()[0x7ffbe2108d7d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7ffa58c23018): is an invalid pointer
Connection ID (thread ID): 11
Status: NOT_KILLED

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_p
ushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_
cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_s
ize=off,table_elimination=on,extended_keys=off

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
131024 15:13:46 mysqld_safe Number of processes running now: 0
131024 15:13:46 mysqld_safe mysqld restarted

TOKUDB VARIABLES:
----------------------------

tokudb_analyze_time 60
tokudb_block_size 4194304
tokudb_cache_size 16863524864
tokudb_checkpoint_lock OFF
tokudb_checkpoint_on_flush_logs OFF
tokudb_checkpointing_period 60
tokudb_cleaner_iterations 5
tokudb_cleaner_period 1
tokudb_commit_sync ON
tokudb_create_index_online ON
tokudb_data_dir
tokudb_debug 0
tokudb_directio OFF
tokudb_disable_hot_alter OFF
tokudb_disable_prefetching OFF
tokudb_disable_slow_alter OFF
tokudb_fs_reserve_percent 5
tokudb_fsync_log_period 0
tokudb_gdb_on_fatal ON
tokudb_gdb_path /usr/bin/gdb
tokudb_init_flags 11403457
tokudb_load_save_space OFF
tokudb_lock_timeout 4000
tokudb_log_client_errors OFF
tokudb_log_dir
tokudb_max_lock_memory 2107940608
tokudb_pk_insert_mode 1
tokudb_prelock_empty ON
tokudb_read_block_size 131072
tokudb_read_buf_size 131072
tokudb_read_status_frequency 10000
tokudb_row_format tokudb_default
tokudb_tmp_dir
tokudb_version 7.0.4
tokudb_write_status_frequency 1000

Comment by Ján Regeš [ 2013-10-24 ]

Hi Elena,

big win, here :-D

After compiling MariaDB from sources (with cmake), it works great!!!

I was surprised, that ha_tokudb.so is part of compiled sources :o) I thought, that ha_tokudb.so is compiled only for a specific distribution and for Gentoo must be copied from others "sources".

So, this task could be closed.

Thank you for your great support!

Jan

Comment by Elena Stepanova [ 2013-10-28 ]

Closing as fixed assuming that the requested workaround has been successfully found, and that the actual memory leak was indeed the one that is already fixed in the recent MariaDB versions. For the issue that Alexey mentioned on the way, if it still exists, please file another bug report.

Comment by Ján Regeš [ 2013-11-07 ]

Hi Elena,

one unrelated question - is already possible to download MariaDB 10.0.5 with TokuDB? I need just sources to build with cmake.

I have this performance-related issue in MariaDB 5.5.33a: https://mariadb.atlassian.net/browse/MDEV-5255

So, i would like to test it with TokuDB in MariaDB 10.0.5.

Page https://downloads.mariadb.org/mariadb/10.0.5/ linked on page https://mariadb.com/kb/en/mariadb-1005-release-notes/ doesn't work yet.

Thank you.

Jan

Comment by Elena Stepanova [ 2013-11-07 ]

Hi Ján,

The packages are available now via the link above. Sorry for the delay.

Generated at Thu Feb 08 07:02:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.