Commit 10cb8515 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

[t:4260], [t:4239], merge handlerton changes to main

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@37752 c7de825b-a66e-492c-adef-691d508d4ae1
parent bc3a56f4
...@@ -4289,8 +4289,12 @@ int ha_tokudb::index_init(uint keynr, bool sorted) { ...@@ -4289,8 +4289,12 @@ int ha_tokudb::index_init(uint keynr, bool sorted) {
DBUG_ASSERT(keynr <= table->s->keys); DBUG_ASSERT(keynr <= table->s->keys);
DBUG_ASSERT(share->key_file[keynr]); DBUG_ASSERT(share->key_file[keynr]);
cursor_flags = get_cursor_isolation_flags(lock.type, thd); cursor_flags = get_cursor_isolation_flags(lock.type, thd);
if (use_write_locks) if (use_write_locks) {
cursor_flags |= DB_RMW; cursor_flags |= DB_RMW;
}
if (get_disable_prefetching(thd)) {
cursor_flags |= DBC_DISABLE_PREFETCHING;
}
if ((error = share->key_file[keynr]->cursor(share->key_file[keynr], transaction, &cursor, cursor_flags))) { if ((error = share->key_file[keynr]->cursor(share->key_file[keynr], transaction, &cursor, cursor_flags))) {
if (error == TOKUDB_MVCC_DICTIONARY_TOO_NEW) { if (error == TOKUDB_MVCC_DICTIONARY_TOO_NEW) {
error = HA_ERR_TABLE_DEF_CHANGED; error = HA_ERR_TABLE_DEF_CHANGED;
......
...@@ -93,6 +93,13 @@ static MYSQL_THDVAR_BOOL(create_index_online, ...@@ -93,6 +93,13 @@ static MYSQL_THDVAR_BOOL(create_index_online,
NULL, NULL,
FALSE FALSE
); );
static MYSQL_THDVAR_BOOL(disable_prefetching,
0,
"if on, prefetching disabled",
NULL,
NULL,
FALSE
);
static MYSQL_THDVAR_BOOL(prelock_empty, static MYSQL_THDVAR_BOOL(prelock_empty,
0, 0,
"Tokudb Prelock Empty Table", "Tokudb Prelock Empty Table",
...@@ -652,6 +659,10 @@ bool get_create_index_online(THD* thd) { ...@@ -652,6 +659,10 @@ bool get_create_index_online(THD* thd) {
return (THDVAR(thd, create_index_online) != 0); return (THDVAR(thd, create_index_online) != 0);
} }
bool get_disable_prefetching(THD* thd) {
return (THDVAR(thd, disable_prefetching) != 0);
}
bool get_prelock_empty(THD* thd) { bool get_prelock_empty(THD* thd) {
return (THDVAR(thd, prelock_empty) != 0); return (THDVAR(thd, prelock_empty) != 0);
} }
...@@ -1124,7 +1135,7 @@ format_time(u_int64_t time64, char *buf) { ...@@ -1124,7 +1135,7 @@ format_time(u_int64_t time64, char *buf) {
val, \ val, \
strlen(val)) strlen(val))
#define showval(v) \ #define SHOWVAL(v) \
snprintf(buf, bufsiz, "%" PRIu64, engstat.v); \ snprintf(buf, bufsiz, "%" PRIu64, engstat.v); \
STATPRINT(#v, buf); STATPRINT(#v, buf);
...@@ -1210,8 +1221,8 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { ...@@ -1210,8 +1221,8 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
STATPRINT("txn close (commit+abort)", buf); STATPRINT("txn close (commit+abort)", buf);
//3988 //3988
showval(txn_num_open); SHOWVAL(txn_num_open);
showval(txn_max_open); SHOWVAL(txn_max_open);
snprintf(buf, bufsiz, "%" PRIu64, engstat.txn_oldest_live); snprintf(buf, bufsiz, "%" PRIu64, engstat.txn_oldest_live);
STATPRINT("txn oldest live", buf); STATPRINT("txn oldest live", buf);
...@@ -1270,40 +1281,59 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { ...@@ -1270,40 +1281,59 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
snprintf(buf, bufsiz, "%" PRIu64, engstat.search_tries_gt_heightplus3); snprintf(buf, bufsiz, "%" PRIu64, engstat.search_tries_gt_heightplus3);
STATPRINT("search_tries_gt_heightplus3", buf); STATPRINT("search_tries_gt_heightplus3", buf);
showval(cleaner_executions); SHOWVAL(cleaner_executions);
showval(cleaner_total_nodes); SHOWVAL(cleaner_total_nodes);
showval(cleaner_h1_nodes); SHOWVAL(cleaner_h1_nodes);
showval(cleaner_hgt1_nodes); SHOWVAL(cleaner_hgt1_nodes);
showval(cleaner_empty_nodes); SHOWVAL(cleaner_empty_nodes);
showval(cleaner_nodes_dirtied); SHOWVAL(cleaner_nodes_dirtied);
showval(cleaner_max_buffer_size); SHOWVAL(cleaner_max_buffer_size);
showval(cleaner_min_buffer_size); SHOWVAL(cleaner_min_buffer_size);
showval(cleaner_total_buffer_size); SHOWVAL(cleaner_total_buffer_size);
showval(cleaner_max_buffer_workdone); SHOWVAL(cleaner_max_buffer_workdone);
showval(cleaner_min_buffer_workdone); SHOWVAL(cleaner_min_buffer_workdone);
showval(cleaner_total_buffer_workdone); SHOWVAL(cleaner_total_buffer_workdone);
showval(flush_total); SHOWVAL(flush_total);
showval(flush_in_memory); SHOWVAL(flush_in_memory);
showval(flush_needed_io); SHOWVAL(flush_needed_io);
showval(flush_cascades); SHOWVAL(flush_cascades);
showval(flush_cascades_1); SHOWVAL(flush_cascades_1);
showval(flush_cascades_2); SHOWVAL(flush_cascades_2);
showval(flush_cascades_3); SHOWVAL(flush_cascades_3);
showval(flush_cascades_4); SHOWVAL(flush_cascades_4);
showval(flush_cascades_5); SHOWVAL(flush_cascades_5);
showval(flush_cascades_gt_5); SHOWVAL(flush_cascades_gt_5);
showval(disk_flush_leaf); SHOWVAL(disk_flush_leaf);
showval(disk_flush_nonleaf); SHOWVAL(disk_flush_nonleaf);
showval(disk_flush_leaf_for_checkpoint); SHOWVAL(disk_flush_leaf_for_checkpoint);
showval(disk_flush_nonleaf_for_checkpoint); SHOWVAL(disk_flush_nonleaf_for_checkpoint);
showval(destroy_leaf); SHOWVAL(destroy_leaf);
showval(destroy_nonleaf); SHOWVAL(destroy_nonleaf);
showval(msg_bytes_in); SHOWVAL(msg_bytes_in);
showval(msg_bytes_out); SHOWVAL(msg_bytes_out);
showval(msg_bytes_curr); SHOWVAL(msg_bytes_curr);
showval(msg_bytes_max); SHOWVAL(msg_bytes_max);
showval(msg_num); SHOWVAL(msg_num);
showval(msg_num_broadcast); SHOWVAL(msg_num_broadcast);
SHOWVAL(num_basements_decompressed_normal);
SHOWVAL(num_basements_decompressed_aggressive);
SHOWVAL(num_basements_decompressed_prefetch);
SHOWVAL(num_basements_decompressed_write);
SHOWVAL(num_msg_buffer_decompressed_normal);
SHOWVAL(num_msg_buffer_decompressed_aggressive);
SHOWVAL(num_msg_buffer_decompressed_prefetch);
SHOWVAL(num_msg_buffer_decompressed_write);
SHOWVAL(num_pivots_fetched_query);
SHOWVAL(num_pivots_fetched_prefetch);
SHOWVAL(num_pivots_fetched_write);
SHOWVAL(num_basements_fetched_normal);
SHOWVAL(num_basements_fetched_aggressive);
SHOWVAL(num_basements_fetched_prefetch);
SHOWVAL(num_basements_fetched_write);
SHOWVAL(num_msg_buffer_fetched_normal);
SHOWVAL(num_msg_buffer_fetched_aggressive);
SHOWVAL(num_msg_buffer_fetched_prefetch);
SHOWVAL(num_msg_buffer_fetched_write);
snprintf(buf, bufsiz, "%" PRIu64, engstat.multi_inserts); snprintf(buf, bufsiz, "%" PRIu64, engstat.multi_inserts);
STATPRINT("dictionary inserts multi", buf); STATPRINT("dictionary inserts multi", buf);
...@@ -1324,10 +1354,10 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { ...@@ -1324,10 +1354,10 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
STATPRINT("dictionary sequential queries", buf); STATPRINT("dictionary sequential queries", buf);
//3988 //3988
showval(num_db_open); SHOWVAL(num_db_open);
showval(num_db_close); SHOWVAL(num_db_close);
showval(num_open_dbs); SHOWVAL(num_open_dbs);
showval(max_open_dbs); SHOWVAL(max_open_dbs);
snprintf(buf, bufsiz, "%" PRIu64, engstat.le_max_committed_xr); snprintf(buf, bufsiz, "%" PRIu64, engstat.le_max_committed_xr);
STATPRINT("le_max_committed_xr", buf); STATPRINT("le_max_committed_xr", buf);
...@@ -1435,11 +1465,11 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { ...@@ -1435,11 +1465,11 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
STATPRINT("range write locks exhausted", buf); STATPRINT("range write locks exhausted", buf);
//3988 //3988
showval(range_lt_create); SHOWVAL(range_lt_create);
showval(range_lt_create_fail); SHOWVAL(range_lt_create_fail);
showval(range_lt_destroy); SHOWVAL(range_lt_destroy);
showval(range_lt_num); SHOWVAL(range_lt_num);
showval(range_lt_num_max); SHOWVAL(range_lt_num_max);
snprintf(buf, bufsiz, "%" PRIu64, engstat.directory_read_locks); snprintf(buf, bufsiz, "%" PRIu64, engstat.directory_read_locks);
STATPRINT("directory_read_locks", buf); STATPRINT("directory_read_locks", buf);
...@@ -1792,6 +1822,7 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = { ...@@ -1792,6 +1822,7 @@ static struct st_mysql_sys_var *tokudb_system_variables[] = {
MYSQL_SYSVAR(load_save_space), MYSQL_SYSVAR(load_save_space),
MYSQL_SYSVAR(disable_slow_alter), MYSQL_SYSVAR(disable_slow_alter),
MYSQL_SYSVAR(create_index_online), MYSQL_SYSVAR(create_index_online),
MYSQL_SYSVAR(disable_prefetching),
MYSQL_SYSVAR(version), MYSQL_SYSVAR(version),
MYSQL_SYSVAR(init_flags), MYSQL_SYSVAR(init_flags),
MYSQL_SYSVAR(checkpointing_period), MYSQL_SYSVAR(checkpointing_period),
......
...@@ -14,6 +14,7 @@ uint get_pk_insert_mode(THD* thd); ...@@ -14,6 +14,7 @@ uint get_pk_insert_mode(THD* thd);
bool get_load_save_space(THD* thd); bool get_load_save_space(THD* thd);
bool get_disable_slow_alter(THD* thd); bool get_disable_slow_alter(THD* thd);
bool get_create_index_online(THD* thd); bool get_create_index_online(THD* thd);
bool get_disable_prefetching(THD* thd);
bool get_prelock_empty(THD* thd); bool get_prelock_empty(THD* thd);
uint get_tokudb_block_size(THD* thd); uint get_tokudb_block_size(THD* thd);
uint get_tokudb_read_block_size(THD* thd); uint get_tokudb_read_block_size(THD* thd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment