Tokutek / mysql-5.5

TokuDB for MySQL 5.5
http://www.tokutek.com/products/tokudb-for-mysql/
GNU General Public License v2.0
110 stars 38 forks source link

TokuDB DataDir cannot be changed on MySQL #24

Closed ehardway closed 10 years ago

ehardway commented 10 years ago

Issue: Once you setup TokuDB on MySQL you are forever locked in to the datadir that you specified. If you try to copy files and starting instance with another datadir specified the database will not start because of TokuDB errors.

This makes it awfully inconvenient when verifying backups or creating new slaves. Its also not consistent with the default MySQL behavior of other versions/distros.

How to Duplicate: Download a fresh copy of mariadb-5.5.30-tokudb-7.1.0-linux-x86_64.tar.gz .. then run mysql_install_db and use the below conf file..

[client] port = 3306 socket = /tmp/mysql.sock [mysqld] port = 3306 socket = /tmp/mysql.sock skip-external-locking key_buffer_size = 16M max_allowed_packet = 1M table_open_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M log-bin=mysql-bin binlog_format=mixed server-id = 1 datadir = /usr/local/mysql/data tmpdir = /usr/local/mysql/tmp

tokudb_commit_sync = off #set to ON to ensure latest committed transaction(s) not lost upon crash tokudb_pk_insert_mode = 2 tokudb_load_save_space = on tokudb_prelock_empty = on tokudb_create_index_online = on tokudb_disable_slow_alter = on tokudb_read_buf_size = 1M tokudb_disable_prefetching = 0 tokudb_row_format = tokudb_small tokudb_analyze_time = 20 tokudb_lock_timeout_debug = 3 tokudb_loader_memory_size = 1G #2147483648 tokudb_fsync_log_period = 1000 #milliseconds (set to 0 if commit_sync is on) tokudb_cache_size = 1G #21474836480 tokudb_directio = off tokudb_lock_timeout = 5000 #milliseconds tokudb_data_dir = /usr/local/mysql/data tokudb_log_dir = /usr/local/mysql/data tokudb_tmp_dir = /usr/local/mysql/tmp tokudb_checkpointing_period = 60 #seconds tokudb_write_status_frequency = 1000 tokudb_read_status_frequency = 10000 tokudb_fs_reserve_percent = 5 tokudb_cleaner_period = 1 tokudb_cleaner_iterations = 5

***\ Here is the log that proves mysql is starting properly

140205 16:11:49 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 140205 16:11:49 InnoDB: The InnoDB memory heap is disabled 140205 16:11:49 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140205 16:11:49 InnoDB: Compressed tables use zlib 1.2.3 140205 16:11:49 InnoDB: Using Linux native AIO 140205 16:11:49 InnoDB: Initializing buffer pool, size = 128.0M 140205 16:11:49 InnoDB: Completed initialization of buffer pool 140205 16:11:49 InnoDB: highest supported file format is Barracuda. 140205 16:11:49 InnoDB: Waiting for the background threads to start 140205 16:11:50 Percona XtraDB (http://www.percona.com) 5.5.30-tokudb-7.1.0-MariaDB-30.1 started; log sequence number 1597945 140205 16:11:50 [Note] Plugin 'FEEDBACK' is disabled. Wed Feb 5 16:11:50 2014 Tokudb file system space is low 140205 16:11:50 [Note] Event Scheduler: Loaded 0 events 140205 16:11:50 [Note] /usr/local/mysql/bin/mysqld: ready for connections. Version: '5.5.30-tokudb-7.1.0-MariaDB-log' socket: '/tmp/mysql.sock' port: 3306 MariaDB Server

Shutdown of instance

140205 16:12:08 [Note] /usr/local/mysql/bin/mysqld: Normal shutdown

140205 16:12:08 [Note] Event Scheduler: Purging the queue. 0 events 140205 16:12:08 InnoDB: Starting shutdown... 140205 16:12:09 InnoDB: Shutdown completed; log sequence number 1597945 140205 16:12:10 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140205 16:12:10 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql94.pid ended

****\ To brake it shutdown mysql, then move the datadirs around and update the my.cnf file

****\ You will see in log output that mysql will not longer start because of toku registration problems.

sudo mv -v /usr/local/mysql/data /usr/local/mysql/data2 /usr/local/mysql/data' ->/usr/local/mysql/data2' sudo mv -v /usr/local/mysql/tmp /usr/local/mysql/tmp2 /usr/local/mysql/tmp' ->/usr/local/mysql/tmp2'

[client] port = 3306 socket = /tmp/mysql.sock [mysqld] port = 3306 socket = /tmp/mysql.sock skip-external-locking key_buffer_size = 16M max_allowed_packet = 1M table_open_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M log-bin=mysql-bin binlog_format=mixed server-id = 1 datadir = /usr/local/mysql/data2 tmpdir = /usr/local/mysql/tmp2

tokudb_commit_sync = off #set to ON to ensure latest committed transaction(s) not lost upon crash tokudb_pk_insert_mode = 2 tokudb_load_save_space = on tokudb_prelock_empty = on tokudb_create_index_online = on tokudb_disable_slow_alter = on tokudb_read_buf_size = 1M tokudb_disable_prefetching = 0 tokudb_row_format = tokudb_small tokudb_analyze_time = 20 tokudb_lock_timeout_debug = 3 tokudb_loader_memory_size = 1G #2147483648 tokudb_fsync_log_period = 1000 #milliseconds (set to 0 if commit_sync is on) tokudb_cache_size = 1G #21474836480 tokudb_directio = off tokudb_lock_timeout = 5000 #milliseconds tokudb_data_dir = /usr/local/mysql/data2 tokudb_log_dir = /usr/local/mysql/data2 tokudb_tmp_dir = /usr/local/mysql/tmp2 tokudb_checkpointing_period = 60 #seconds tokudb_write_status_frequency = 1000 tokudb_read_status_frequency = 10000 tokudb_fs_reserve_percent = 5 tokudb_cleaner_period = 1 tokudb_cleaner_iterations = 5 ~

140205 16:14:25 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data2 140205 16:14:25 InnoDB: The InnoDB memory heap is disabled 140205 16:14:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins 140205 16:14:25 InnoDB: Compressed tables use zlib 1.2.3 140205 16:14:25 InnoDB: Using Linux native AIO 140205 16:14:25 InnoDB: Initializing buffer pool, size = 128.0M 140205 16:14:25 InnoDB: Completed initialization of buffer pool 140205 16:14:25 InnoDB: highest supported file format is Barracuda. 140205 16:14:25 InnoDB: Waiting for the background threads to start 140205 16:14:26 Percona XtraDB (http://www.percona.com) 5.5.30-tokudb-7.1.0-MariaDB-30.1 started; log sequence number 1597945 140205 16:14:26 [Note] Plugin 'FEEDBACK' is disabled. Wed Feb 5 16:14:26 2014 Tokudb file system space is low 140205 16:14:28 [ERROR] Plugin 'TokuDB' init function returned error. 140205 16:14:28 [ERROR] Plugin 'TokuDB' registration as a STORAGE ENGINE failed. 140205 16:14:28 [ERROR] Unknown/unsupported storage engine: TokuDB 140205 16:14:28 [ERROR] Aborting

140205 16:14:28 InnoDB: Starting shutdown... 140205 16:14:29 InnoDB: Shutdown completed; log sequence number 1597945 140205 16:14:29 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

140205 16:14:29 mysqld_safe mysqld from pid file /usr/local/mysql/data2/mysql94.pid ended

tmcallaghan commented 10 years ago

This issue is confirmed, and the effort to change this behavior has not yet been assigned to a milestone.

tmcallaghan commented 10 years ago

Moved to Jira as https://tokutek.atlassian.net/browse/DB-606