diff options
Diffstat (limited to 'storage/spider/spd_trx.cc')
-rw-r--r-- | storage/spider/spd_trx.cc | 288 |
1 files changed, 2 insertions, 286 deletions
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc index 0023a5d4bbc..3cdb1f844be 100644 --- a/storage/spider/spd_trx.cc +++ b/storage/spider/spd_trx.cc @@ -1168,30 +1168,6 @@ int spider_free_trx_alloc( trx->trx_another_conn_hash.array.max_element * trx->trx_another_conn_hash.array.size_of_element); my_hash_free(&trx->trx_another_conn_hash); -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - spider_free_mem_calc(spider_current_trx, - trx->trx_direct_hs_r_conn_hash_id, - trx->trx_direct_hs_r_conn_hash.array.max_element * - trx->trx_direct_hs_r_conn_hash.array.size_of_element); - my_hash_free(&trx->trx_direct_hs_r_conn_hash); - spider_free_mem_calc(spider_current_trx, - trx->trx_direct_hs_w_conn_hash_id, - trx->trx_direct_hs_w_conn_hash.array.max_element * - trx->trx_direct_hs_w_conn_hash.array.size_of_element); - my_hash_free(&trx->trx_direct_hs_w_conn_hash); -#endif -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - spider_free_mem_calc(spider_current_trx, - trx->trx_hs_r_conn_hash_id, - trx->trx_hs_r_conn_hash.array.max_element * - trx->trx_hs_r_conn_hash.array.size_of_element); - my_hash_free(&trx->trx_hs_r_conn_hash); - spider_free_mem_calc(spider_current_trx, - trx->trx_hs_w_conn_hash_id, - trx->trx_hs_w_conn_hash.array.max_element * - trx->trx_hs_w_conn_hash.array.size_of_element); - my_hash_free(&trx->trx_hs_w_conn_hash); -#endif spider_free_mem_calc(spider_current_trx, trx->trx_ha_hash_id, trx->trx_ha_hash.array.max_element * @@ -1278,58 +1254,6 @@ SPIDER_TRX *spider_get_trx( trx->trx_another_conn_hash.array.max_element * trx->trx_another_conn_hash.array.size_of_element); -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - if ( - my_hash_init(&trx->trx_hs_r_conn_hash, spd_charset_utf8mb3_bin, 32, 0, 0, - (my_hash_get_key) spider_conn_get_key, 0, 0) - ) - goto error_hs_r_init_hash; - spider_alloc_calc_mem_init(trx->trx_hs_r_conn_hash, 153); - spider_alloc_calc_mem( - thd ? ((SPIDER_TRX *) thd_get_ha_data(thd, spider_hton_ptr)) : NULL, - trx->trx_hs_r_conn_hash, - trx->trx_hs_r_conn_hash.array.max_element * - trx->trx_hs_r_conn_hash.array.size_of_element); - - if ( - my_hash_init(&trx->trx_hs_w_conn_hash, spd_charset_utf8mb3_bin, 32, 0, 0, - (my_hash_get_key) spider_conn_get_key, 0, 0) - ) - goto error_hs_w_init_hash; - spider_alloc_calc_mem_init(trx->trx_hs_w_conn_hash, 154); - spider_alloc_calc_mem( - thd ? ((SPIDER_TRX *) thd_get_ha_data(thd, spider_hton_ptr)) : NULL, - trx->trx_hs_w_conn_hash, - trx->trx_hs_w_conn_hash.array.max_element * - trx->trx_hs_w_conn_hash.array.size_of_element); -#endif - -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - if ( - my_hash_init(&trx->trx_direct_hs_r_conn_hash, spd_charset_utf8mb3_bin, 32, - 0, 0, (my_hash_get_key) spider_conn_get_key, 0, 0) - ) - goto error_direct_hs_r_init_hash; - spider_alloc_calc_mem_init(trx->trx_direct_hs_r_conn_hash, 155); - spider_alloc_calc_mem( - thd ? ((SPIDER_TRX *) thd_get_ha_data(thd, spider_hton_ptr)) : NULL, - trx->trx_direct_hs_r_conn_hash, - trx->trx_direct_hs_r_conn_hash.array.max_element * - trx->trx_direct_hs_r_conn_hash.array.size_of_element); - - if ( - my_hash_init(&trx->trx_direct_hs_w_conn_hash, spd_charset_utf8mb3_bin, 32, - 0, 0, (my_hash_get_key) spider_conn_get_key, 0, 0) - ) - goto error_direct_hs_w_init_hash; - spider_alloc_calc_mem_init(trx->trx_direct_hs_w_conn_hash, 156); - spider_alloc_calc_mem( - thd ? ((SPIDER_TRX *) thd_get_ha_data(thd, spider_hton_ptr)) : NULL, - trx->trx_direct_hs_w_conn_hash, - trx->trx_direct_hs_w_conn_hash.array.max_element * - trx->trx_direct_hs_w_conn_hash.array.size_of_element); -#endif - if ( my_hash_init(PSI_INSTRUMENT_ME, &trx->trx_alter_table_hash, spd_charset_utf8mb3_bin, 32, 0, 0, (my_hash_get_key) @@ -1369,10 +1293,6 @@ SPIDER_TRX *spider_get_trx( ++spider_thread_id; pthread_mutex_unlock(&spider_thread_id_mutex); trx->trx_conn_adjustment = 1; -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - trx->trx_hs_r_conn_adjustment = 1; - trx->trx_hs_w_conn_adjustment = 1; -#endif if (thd) { @@ -1526,38 +1446,6 @@ error_init_trx_ha_hash: trx->trx_alter_table_hash.array.size_of_element); my_hash_free(&trx->trx_alter_table_hash); error_init_alter_hash: -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - spider_free_mem_calc( - thd ? ((SPIDER_TRX *) thd_get_ha_data(thd, spider_hton_ptr)) : NULL, - trx->trx_direct_hs_w_conn_hash_id, - trx->trx_direct_hs_w_conn_hash.array.max_element * - trx->trx_direct_hs_w_conn_hash.array.size_of_element); - my_hash_free(&trx->trx_direct_hs_w_conn_hash); -error_direct_hs_w_init_hash: - spider_free_mem_calc( - thd ? ((SPIDER_TRX *) thd_get_ha_data(thd, spider_hton_ptr)) : NULL, - trx->trx_direct_hs_r_conn_hash_id, - trx->trx_direct_hs_r_conn_hash.array.max_element * - trx->trx_direct_hs_r_conn_hash.array.size_of_element); - my_hash_free(&trx->trx_direct_hs_r_conn_hash); -error_direct_hs_r_init_hash: -#endif -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - spider_free_mem_calc( - thd ? ((SPIDER_TRX *) thd_get_ha_data(thd, spider_hton_ptr)) : NULL, - trx->trx_hs_w_conn_hash_id, - trx->trx_hs_w_conn_hash.array.max_element * - trx->trx_hs_w_conn_hash.array.size_of_element); - my_hash_free(&trx->trx_hs_w_conn_hash); -error_hs_w_init_hash: - spider_free_mem_calc( - thd ? ((SPIDER_TRX *) thd_get_ha_data(thd, spider_hton_ptr)) : NULL, - trx->trx_hs_r_conn_hash_id, - trx->trx_hs_r_conn_hash.array.max_element * - trx->trx_hs_r_conn_hash.array.size_of_element); - my_hash_free(&trx->trx_hs_r_conn_hash); -error_hs_r_init_hash: -#endif spider_free_mem_calc( thd ? ((SPIDER_TRX *) thd_get_ha_data(thd, spider_hton_ptr)) : NULL, trx->trx_another_conn_hash_id, @@ -3741,28 +3629,6 @@ int spider_check_trx_and_get_conn( if (!trx_ha || trx_ha->wait_for_reusing) spider_trx_set_link_idx_for_all(spider); -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) -#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS - if (use_conn_kind) - { - for (roop_count = 0; roop_count < (int) share->link_count; roop_count++) - { - if ( -/* - spider->conn_kind[roop_count] != SPIDER_CONN_KIND_MYSQL && -*/ - share->hs_dbton_ids[spider->conn_link_idx[roop_count]] == - SPIDER_DBTON_SIZE - ) { - /* can't use hs interface */ - spider->conn_kind[roop_count] = SPIDER_CONN_KIND_MYSQL; - spider_clear_bit(spider->do_hs_direct_update, roop_count); - } - } - } -#endif -#endif - if (semi_table_lock_conn) first_byte = '0' + spider_param_semi_table_lock(thd, share->semi_table_lock); @@ -3778,14 +3644,6 @@ int spider_check_trx_and_get_conn( trx_ha->wait_for_reusing || trx->spider_thread_id != spider->spider_thread_id || trx->trx_conn_adjustment != spider->trx_conn_adjustment || -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - (use_conn_kind && - ( - trx->trx_hs_r_conn_adjustment != spider->trx_hs_r_conn_adjustment || - trx->trx_hs_w_conn_adjustment != spider->trx_hs_w_conn_adjustment - ) - ) || -#endif first_byte != *spider->conn_keys[0] || share->link_statuses[spider->conn_link_idx[spider->search_link_idx]] == SPIDER_LINK_STATUS_NG @@ -3795,13 +3653,6 @@ int spider_check_trx_and_get_conn( "spider change thd" : "spider next trx")); spider->wide_handler->trx = trx; spider->trx_conn_adjustment = trx->trx_conn_adjustment; -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - if (use_conn_kind) - { - spider->trx_hs_r_conn_adjustment = trx->trx_hs_r_conn_adjustment; - spider->trx_hs_w_conn_adjustment = trx->trx_hs_w_conn_adjustment; - } -#endif if ( spider->spider_thread_id != trx->spider_thread_id || spider->search_link_query_id != thd->query_id @@ -3846,12 +3697,6 @@ int spider_check_trx_and_get_conn( { if (!spider->handler_opened(roop_count, SPIDER_CONN_KIND_MYSQL)) spider->conns[roop_count] = NULL; -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - if (!spider->handler_opened(roop_count, SPIDER_CONN_KIND_HS_READ)) - spider->hs_r_conns[roop_count] = NULL; - if (!spider->handler_opened(roop_count, SPIDER_CONN_KIND_HS_WRITE)) - spider->hs_w_conns[roop_count] = NULL; -#endif } bool search_link_idx_is_checked = FALSE; for ( @@ -3868,18 +3713,8 @@ int spider_check_trx_and_get_conn( if (roop_count == spider->search_link_idx) search_link_idx_is_checked = TRUE; if ( -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - ( -#endif tgt_conn_kind == SPIDER_CONN_KIND_MYSQL && !spider->conns[roop_count] -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - ) || - (tgt_conn_kind == SPIDER_CONN_KIND_HS_READ && - !spider->hs_r_conns[roop_count]) || - (tgt_conn_kind == SPIDER_CONN_KIND_HS_WRITE && - !spider->hs_w_conns[roop_count]) -#endif ) { *spider->conn_keys[roop_count] = first_byte; if ( @@ -3919,51 +3754,6 @@ int spider_check_trx_and_get_conn( } conn->error_mode &= spider->error_mode; } -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) -#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS - if ( - spider->do_direct_update && - spider_bit_is_set(spider->do_hs_direct_update, roop_count) && - !spider->hs_w_conns[roop_count] - ) { - if ( - !(conn = - spider_get_conn(share, roop_count, - spider->conn_keys[roop_count], trx, - spider, FALSE, TRUE, - SPIDER_CONN_KIND_HS_WRITE, - &error_num)) - ) { - if ( - share->monitoring_kind[roop_count] && - spider->need_mons[roop_count] - ) { - error_num = spider_ping_table_mon_from_table( - trx, - trx->thd, - share, - roop_count, - (uint32) share->monitoring_sid[roop_count], - share->table_name, - share->table_name_length, - spider->conn_link_idx[roop_count], - NULL, - 0, - share->monitoring_kind[roop_count], - share->monitoring_limit[roop_count], - share->monitoring_flag[roop_count], - TRUE - ); - } - DBUG_PRINT("info",("spider get conn error")); - *spider->conn_keys[0] = first_byte_bak; - spider->spider_thread_id = 0; - DBUG_RETURN(error_num); - } - conn->error_mode &= spider->error_mode; - } -#endif -#endif } if (!search_link_idx_is_checked) { @@ -4002,21 +3792,8 @@ int spider_check_trx_and_get_conn( ) { if (roop_count == spider->search_link_idx) search_link_idx_is_checked = TRUE; -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - if ( - !use_conn_kind || - spider->conn_kind[roop_count] == SPIDER_CONN_KIND_MYSQL - ) { -#endif - conn = spider->conns[roop_count]; -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - } else if (spider->conn_kind[roop_count] == SPIDER_CONN_KIND_HS_READ) - { - conn = spider->hs_r_conns[roop_count]; - } else { - conn = spider->hs_w_conns[roop_count]; - } -#endif + + conn= spider->conns[roop_count]; if (!conn) { @@ -4056,53 +3833,6 @@ int spider_check_trx_and_get_conn( } } conn->error_mode &= spider->error_mode; -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) -#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS - if ( - spider->do_direct_update && - spider_bit_is_set(spider->do_hs_direct_update, roop_count) - ) { - conn = spider->hs_w_conns[roop_count]; - if (!conn) - { - DBUG_PRINT("info",("spider get hs_w_conn %d", roop_count)); - if ( - !(conn = - spider_get_conn(share, roop_count, - spider->conn_keys[roop_count], trx, - spider, FALSE, TRUE, - SPIDER_CONN_KIND_HS_WRITE, - &error_num)) - ) { - if ( - share->monitoring_kind[roop_count] && - spider->need_mons[roop_count] - ) { - error_num = spider_ping_table_mon_from_table( - trx, - trx->thd, - share, - roop_count, - (uint32) share->monitoring_sid[roop_count], - share->table_name, - share->table_name_length, - spider->conn_link_idx[roop_count], - NULL, - 0, - share->monitoring_kind[roop_count], - share->monitoring_limit[roop_count], - share->monitoring_flag[roop_count], - TRUE - ); - } - DBUG_PRINT("info",("spider get conn error")); - DBUG_RETURN(error_num); - } - } - } - conn->error_mode &= spider->error_mode; -#endif -#endif } if (!search_link_idx_is_checked) { @@ -4358,20 +4088,6 @@ void spider_trx_set_link_idx_for_all( share->conn_keys[0]), char*); DBUG_PRINT("info",("spider conn_keys[%d]=%s", roop_count, spider->conn_keys[roop_count])); -#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) - spider->hs_r_conn_keys[roop_count] = - ADD_TO_PTR(spider->conn_keys_first_ptr, - PTR_BYTE_DIFF(share->hs_read_conn_keys[conn_link_idx[roop_count]], - share->conn_keys[0]), char*); - DBUG_PRINT("info",("spider hs_r_conn_keys[%d]=%s", - roop_count, spider->hs_r_conn_keys[roop_count])); - spider->hs_w_conn_keys[roop_count] = - ADD_TO_PTR(spider->conn_keys_first_ptr, - PTR_BYTE_DIFF(share->hs_write_conn_keys[conn_link_idx[roop_count]], - share->conn_keys[0]), char*); - DBUG_PRINT("info",("spider hs_w_conn_keys[%d]=%s", - roop_count, spider->hs_w_conn_keys[roop_count])); -#endif } DBUG_VOID_RETURN; } |