List:Commits« Previous MessageNext Message »
From:marko.makela Date:May 10 2012 11:26am
Subject:bzr push into mysql-trunk-wl5854 branch (marko.makela:3765 to 3766) WL#5854
View as plain text  
 3766 Marko Mäkelä	2012-05-10
      WL#5854: Allocate index->lock and index->blobs_mutex separately
      from the rest of the dict_index_t, so that when there are multiple
      versions of a clustered index (and a table definition), these
      data structures will be shared among all of them.

    modified:
      storage/innobase/btr/btr0btr.cc
      storage/innobase/dict/dict0dict.cc
      storage/innobase/dict/dict0mem.cc
      storage/innobase/handler/handler0alter.cc
      storage/innobase/include/dict0dict.ic
      storage/innobase/include/dict0mem.h
 3765 Marko Mäkelä	2012-05-10 [merge]
      Merge mysql-trunk to mysql-trunk-wl5854.

    removed:
      mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
      mysql-test/suite/rpl/t/rpl_row_find_row_debug.test
    added:
      BUILD/SETUP.sh
      BUILD/build_mccge.sh
      mysql-test/extra/rpl_tests/rpl_row_idempotency.test
      mysql-test/include/rpl_hash_scan_assertion.inc
      mysql-test/r/blackhole.result
      mysql-test/suite/binlog/std_data/ver_trunk_row_v2.001
      mysql-test/suite/innodb/r/innodb_bug13635833.result
      mysql-test/suite/innodb/r/innodb_bug14006907.result
      mysql-test/suite/innodb/r/innodb_bug14007109.result
      mysql-test/suite/innodb/r/innodb_bug14007649.result
      mysql-test/suite/innodb/t/innodb_bug13635833.test
      mysql-test/suite/innodb/t/innodb_bug14006907.test
      mysql-test/suite/innodb/t/innodb_bug14007109.test
      mysql-test/suite/innodb/t/innodb_bug14007649.test
      mysql-test/suite/rpl/r/rpl_extra_row_data.result
      mysql-test/suite/rpl/r/rpl_row_hash_scan.result
      mysql-test/suite/rpl/r/rpl_row_hash_scan_sanity.result
      mysql-test/suite/rpl/r/rpl_row_merge_engine.result
      mysql-test/suite/rpl/t/rpl_extra_row_data-master.opt
      mysql-test/suite/rpl/t/rpl_extra_row_data-slave.opt
      mysql-test/suite/rpl/t/rpl_extra_row_data.test
      mysql-test/suite/rpl/t/rpl_row_hash_scan.test
      mysql-test/suite/rpl/t/rpl_row_hash_scan_sanity.test
      mysql-test/suite/rpl/t/rpl_row_merge_engine.test
      mysql-test/suite/sys_vars/r/log_bin_use_v1_row_events_basic.result
      mysql-test/suite/sys_vars/r/slave_rows_search_algorithms_basic.result
      mysql-test/suite/sys_vars/t/log_bin_use_v1_row_events_basic.test
      mysql-test/suite/sys_vars/t/slave_rows_search_algorithms_basic.test
      mysql-test/t/blackhole.test
      storage/innobase/include/ut0counter.h
      unittest/gunit/field_date-t.cc
      unittest/gunit/field_datetime-t.cc
      unittest/gunit/field_long-t.cc
      unittest/gunit/field_newdecimal-t.cc
      unittest/gunit/field_temporal_utils.h
      unittest/gunit/gunit_test_main_server.cc
      unittest/gunit/my_error-t.cc
    modified:
      CMakeLists.txt
      client/mysqlbinlog.cc
      client/mysqldump.c
      dbug/dbug.c
      include/my_base.h
      include/my_sys.h
      include/mysql/psi/mysql_socket.h
      man/CMakeLists.txt
      mysql-test/collections/default.daily
      mysql-test/collections/default.experimental
      mysql-test/collections/default.weekly
      mysql-test/extra/binlog_tests/binlog.test
      mysql-test/extra/rpl_tests/rpl_extra_col_master.test
      mysql-test/extra/rpl_tests/rpl_mts_crash_safe.inc
      mysql-test/extra/rpl_tests/rpl_record_compare.test
      mysql-test/include/index_merge2.inc
      mysql-test/include/subquery.inc
      mysql-test/include/wait_condition.inc
      mysql-test/r/cast.result
      mysql-test/r/ctype_collate.result
      mysql-test/r/ctype_errors.result
      mysql-test/r/ctype_ucs.result
      mysql-test/r/errors.result
      mysql-test/r/explain.result
      mysql-test/r/explain_json_all.result
      mysql-test/r/explain_json_none.result
      mysql-test/r/flush2.result
      mysql-test/r/gis.result
      mysql-test/r/index_merge_myisam.result
      mysql-test/r/multi_update.result
      mysql-test/r/multi_update_innodb.result
      mysql-test/r/mysqld--help-notwin.result
      mysql-test/r/mysqld--help-win.result
      mysql-test/r/mysqldump.result
      mysql-test/r/sp-bugs.result
      mysql-test/r/sp-destruct.result
      mysql-test/r/subquery_all.result
      mysql-test/r/subquery_all_bka.result
      mysql-test/r/subquery_all_bka_nixbnl.result
      mysql-test/r/subquery_nomat_nosj.result
      mysql-test/r/subquery_nomat_nosj_bka.result
      mysql-test/r/subquery_nomat_nosj_bka_nixbnl.result
      mysql-test/r/subquery_none.result
      mysql-test/r/subquery_none_bka.result
      mysql-test/r/subquery_none_bka_nixbnl.result
      mysql-test/r/subselect_innodb.result
      mysql-test/r/type_bit.result
      mysql-test/r/type_temporal_fractional.result
      mysql-test/r/user_var.result
      mysql-test/r/variables-big.result
      mysql-test/suite/binlog/r/binlog_old_versions.result
      mysql-test/suite/binlog/r/binlog_row_binlog.result
      mysql-test/suite/binlog/r/binlog_stm_binlog.result
      mysql-test/suite/binlog/r/binlog_variables_log_bin.result
      mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result
      mysql-test/suite/binlog/t/binlog_old_versions.test
      mysql-test/suite/engines/funcs/r/sq_all.result
      mysql-test/suite/engines/funcs/t/crash_manytables_string.test
      mysql-test/suite/engines/funcs/t/se_join_left_outer.test
      mysql-test/suite/engines/funcs/t/tc_partition_key.test
      mysql-test/suite/engines/funcs/t/tc_partition_linear_key.test
      mysql-test/suite/engines/iuds/t/strings_update_delete.test
      mysql-test/suite/explain_json_validate/r/explain_json_validate.result
      mysql-test/suite/innodb/r/innodb_monitor.result
      mysql-test/suite/innodb/r/innodb_stats_drop_locked.result
      mysql-test/suite/innodb/t/innodb_16k.test
      mysql-test/suite/innodb/t/innodb_bug13867871.test
      mysql-test/suite/innodb/t/innodb_bug56680.test
      mysql-test/suite/innodb/t/innodb_monitor.test
      mysql-test/suite/parts/t/rpl_partition.test
      mysql-test/suite/rpl/r/rpl_alter_repository.result
      mysql-test/suite/rpl/r/rpl_bug26395.result
      mysql-test/suite/rpl/r/rpl_change_master_dbug.result
      mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
      mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
      mysql-test/suite/rpl/r/rpl_gtid_sql_until_before_after.result
      mysql-test/suite/rpl/r/rpl_parallel_start_stop.result
      mysql-test/suite/rpl/r/rpl_relayrotate.result
      mysql-test/suite/rpl/r/rpl_row_idempotency.result
      mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
      mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
      mysql-test/suite/rpl/t/rpl_alter_repository.test
      mysql-test/suite/rpl/t/rpl_bug26395.test
      mysql-test/suite/rpl/t/rpl_change_master_dbug.test
      mysql-test/suite/rpl/t/rpl_check_gtid.test
      mysql-test/suite/rpl/t/rpl_checksum_cache.test
      mysql-test/suite/rpl/t/rpl_gtid_sql_until_before_after.test
      mysql-test/suite/rpl/t/rpl_gtid_stress_failover.test
      mysql-test/suite/rpl/t/rpl_non_direct_row_mixing_engines.test
      mysql-test/suite/rpl/t/rpl_optimize.test
      mysql-test/suite/rpl/t/rpl_parallel.test
      mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
      mysql-test/suite/rpl/t/rpl_parallel_start_stop.test
      mysql-test/suite/rpl/t/rpl_relayrotate.test
      mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt
      mysql-test/suite/rpl/t/rpl_row_idempotency.test
      mysql-test/suite/rpl/t/rpl_row_img_eng_min.test
      mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test
      mysql-test/suite/rpl/t/rpl_row_img_idx_min.test
      mysql-test/suite/rpl/t/rpl_row_img_idx_noblob.test
      mysql-test/suite/rpl/t/rpl_row_mixing_engines.test
      mysql-test/suite/rpl/t/rpl_sequential.test
      mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test
      mysql-test/suite/rpl/t/rpl_stm_mts_crash_safe.test
      mysql-test/suite/stress/t/ddl_innodb.test
      mysql-test/t/cast.test
      mysql-test/t/ctype_collate.test
      mysql-test/t/ctype_ucs.test
      mysql-test/t/ds_mrr-big.test
      mysql-test/t/errors.test
      mysql-test/t/events_time_zone.test
      mysql-test/t/gis.test
      mysql-test/t/greedy_optimizer.test
      mysql-test/t/index_merge_myisam.test
      mysql-test/t/innodb_explain_json_non_select_none.test
      mysql-test/t/multi_update.test
      mysql-test/t/multi_update_innodb.test
      mysql-test/t/mysql_client_test_embedded.test
      mysql-test/t/mysqldump.test
      mysql-test/t/sp-bugs.test
      mysql-test/t/ssl_8k_key.test
      mysql-test/t/subselect_innodb.test
      mysql-test/t/type_bit.test
      mysql-test/t/user_var.test
      mysql-test/t/variables-big.test
      mysys/my_conio.c
      mysys/my_error.c
      mysys/my_handler_errors.h
      sql-common/my_time.c
      sql/binlog.cc
      sql/field.cc
      sql/field.h
      sql/field_conv.cc
      sql/handler.cc
      sql/handler.h
      sql/item.cc
      sql/item.h
      sql/item_cmpfunc.cc
      sql/item_func.cc
      sql/item_func.h
      sql/item_strfunc.h
      sql/item_subselect.cc
      sql/item_timefunc.cc
      sql/item_timefunc.h
      sql/log.h
      sql/log_event.cc
      sql/log_event.h
      sql/log_event_old.cc
      sql/log_event_old.h
      sql/mysqld.cc
      sql/mysqld.h
      sql/opt_range.cc
      sql/password.c
      sql/rpl_constants.h
      sql/rpl_info_factory.cc
      sql/rpl_injector.cc
      sql/rpl_injector.h
      sql/rpl_rli.cc
      sql/rpl_slave.cc
      sql/rpl_utility.cc
      sql/rpl_utility.h
      sql/share/errmsg-utf8.txt
      sql/spatial.cc
      sql/sql_base.cc
      sql/sql_binlog.cc
      sql/sql_class.cc
      sql/sql_class.h
      sql/sql_executor.cc
      sql/sql_lex.cc
      sql/sql_lex.h
      sql/sql_planner.h
      sql/sql_select.cc
      sql/sql_select.h
      sql/sql_union.cc
      sql/sql_update.cc
      sql/sql_yacc.yy
      sql/sys_vars.cc
      sql/unireg.cc
      storage/blackhole/ha_blackhole.cc
      storage/blackhole/ha_blackhole.h
      storage/innobase/CMakeLists.txt
      storage/innobase/api/api0api.cc
      storage/innobase/btr/btr0cur.cc
      storage/innobase/buf/buf0dblwr.cc
      storage/innobase/buf/buf0flu.cc
      storage/innobase/buf/buf0lru.cc
      storage/innobase/buf/buf0rea.cc
      storage/innobase/dict/dict0dict.cc
      storage/innobase/dict/dict0load.cc
      storage/innobase/dict/dict0mem.cc
      storage/innobase/dict/dict0stats.cc
      storage/innobase/fil/fil0fil.cc
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/handler/ha_innodb.h
      storage/innobase/handler/handler0alter.cc
      storage/innobase/handler/i_s.cc
      storage/innobase/include/btr0pcur.h
      storage/innobase/include/btr0pcur.ic
      storage/innobase/include/buf0buf.h
      storage/innobase/include/buf0flu.ic
      storage/innobase/include/db0err.h
      storage/innobase/include/dict0dict.h
      storage/innobase/include/dict0mem.h
      storage/innobase/include/lock0lock.h
      storage/innobase/include/os0sync.h
      storage/innobase/include/srv0srv.h
      storage/innobase/include/sync0rw.h
      storage/innobase/include/sync0sync.h
      storage/innobase/include/sync0sync.ic
      storage/innobase/include/univ.i
      storage/innobase/lock/lock0lock.cc
      storage/innobase/lock/lock0wait.cc
      storage/innobase/log/log0log.cc
      storage/innobase/row/row0ins.cc
      storage/innobase/row/row0mysql.cc
      storage/innobase/row/row0sel.cc
      storage/innobase/srv/srv0mon.cc
      storage/innobase/srv/srv0srv.cc
      storage/innobase/srv/srv0start.cc
      storage/innobase/sync/sync0arr.cc
      storage/innobase/sync/sync0rw.cc
      storage/innobase/sync/sync0sync.cc
      storage/innobase/ut/ut0ut.cc
      unittest/gunit/CMakeLists.txt
      unittest/gunit/copy_info-t.cc
      unittest/gunit/create_field-t.cc
      unittest/gunit/decimal-t.cc
      unittest/gunit/fake_table.h
      unittest/gunit/field-t.cc
      unittest/gunit/field_timestamp-t.cc
      unittest/gunit/get_diagnostics-t.cc
      unittest/gunit/item-t.cc
      unittest/gunit/item_func_now_local-t.cc
      unittest/gunit/join_tab_sort-t.cc
      unittest/gunit/my_decimal-t.cc
      unittest/gunit/opt_range-t.cc
      unittest/gunit/segfault-t.cc
      unittest/gunit/sql_table-t.cc
      unittest/gunit/test_utils.cc
      unittest/gunit/test_utils.h
      unittest/unit.pl
=== modified file 'storage/innobase/btr/btr0btr.cc'
--- a/storage/innobase/btr/btr0btr.cc	revid:marko.makela@oracle.com-20120510104821-eht09pzqhw4wzthl
+++ b/storage/innobase/btr/btr0btr.cc	revid:marko.makela@stripped0112547-5au30h69jlo94a8z
@@ -97,9 +97,9 @@ btr_blob_dbg_rbt_insert(
 	if (btr_blob_dbg_msg) {
 		btr_blob_dbg_msg_issue("insert", b, ctx);
 	}
-	mutex_enter(&index->blobs_mutex);
+	mutex_enter(index->blobs_mutex);
 	rbt_insert(index->blobs, b, b);
-	mutex_exit(&index->blobs_mutex);
+	mutex_exit(index->blobs_mutex);
 }
 
 /** Remove from index->blobs a reference to an off-page column.
@@ -117,9 +117,9 @@ btr_blob_dbg_rbt_delete(
 	if (btr_blob_dbg_msg) {
 		btr_blob_dbg_msg_issue("delete", b, ctx);
 	}
-	mutex_enter(&index->blobs_mutex);
+	mutex_enter(index->blobs_mutex);
 	ut_a(rbt_delete(index->blobs, b));
-	mutex_exit(&index->blobs_mutex);
+	mutex_exit(index->blobs_mutex);
 }
 
 /**************************************************************//**
@@ -352,7 +352,7 @@ btr_blob_dbg_is_empty(
 		return(success);
 	}
 
-	mutex_enter(&index->blobs_mutex);
+	mutex_enter(index->blobs_mutex);
 
 	for (node = rbt_first(index->blobs);
 	     node != NULL; node = rbt_next(index->blobs, node)) {
@@ -376,7 +376,7 @@ btr_blob_dbg_is_empty(
 		}
 	}
 
-	mutex_exit(&index->blobs_mutex);
+	mutex_exit(index->blobs_mutex);
 	return(success);
 }
 
@@ -543,7 +543,7 @@ btr_blob_dbg_set_deleted_flag(
 				ut_error;
 			}
 
-			mutex_enter(&index->blobs_mutex);
+			mutex_enter(index->blobs_mutex);
 			node = rbt_lookup(index->blobs, &b);
 			ut_a(node);
 
@@ -552,10 +552,10 @@ btr_blob_dbg_set_deleted_flag(
 			c->del = del;
 			if (btr_blob_dbg_msg) {
 				b = *c;
-				mutex_exit(&index->blobs_mutex);
+				mutex_exit(index->blobs_mutex);
 				btr_blob_dbg_msg_issue("del_mk", &b, "");
 			} else {
-				mutex_exit(&index->blobs_mutex);
+				mutex_exit(index->blobs_mutex);
 			}
 		}
 	}
@@ -594,7 +594,7 @@ btr_blob_dbg_owner(
 
 	ut_a(b.owner == own);
 
-	mutex_enter(&index->blobs_mutex);
+	mutex_enter(index->blobs_mutex);
 	node = rbt_lookup(index->blobs, &b);
 	/* row_ins_clust_index_entry_by_modify() invokes
 	btr_cur_unmark_extern_fields() also for the newly inserted
@@ -615,7 +615,7 @@ btr_blob_dbg_owner(
 		}
 	}
 
-	mutex_exit(&index->blobs_mutex);
+	mutex_exit(index->blobs_mutex);
 }
 #endif /* UNIV_BLOB_DEBUG */
 
@@ -1433,8 +1433,10 @@ btr_create(
 	} else {
 #ifdef UNIV_BLOB_DEBUG
 		if ((type & DICT_CLUSTERED) && !index->blobs) {
+			index->blobs_mutex = static_cast<mutex_t*>(
+				ut_malloc(sizeof *index->blobs_mutex));
 			mutex_create(PFS_NOT_INSTRUMENTED,
-				     &index->blobs_mutex, SYNC_ANY_LATCH);
+				     index->blobs_mutex, SYNC_ANY_LATCH);
 			index->blobs = rbt_create(sizeof(btr_blob_dbg_t),
 						  btr_blob_dbg_cmp);
 		}

=== modified file 'storage/innobase/dict/dict0dict.cc'
--- a/storage/innobase/dict/dict0dict.cc	revid:marko.makela@stripped
+++ b/storage/innobase/dict/dict0dict.cc	revid:marko.makela@oracle.com-20120510112547-5au30h69jlo94a8z
@@ -2223,7 +2223,9 @@ undo_size_ok:
 	new_index->stat_n_leaf_pages = 1;
 
 	new_index->page = page_no;
-	rw_lock_create(index_tree_rw_lock_key, &new_index->lock,
+	new_index->lock = static_cast<rw_lock_t*>(
+		ut_malloc(sizeof *new_index->lock));
+	rw_lock_create(index_tree_rw_lock_key, new_index->lock,
 		       dict_index_is_ibuf(index)
 		       ? SYNC_IBUF_INDEX_TREE : SYNC_INDEX_TREE);
 
@@ -2257,7 +2259,8 @@ undo_size_ok:
 		}
 	}
 
-	dict_sys->size += mem_heap_get_size(new_index->heap);
+	dict_sys->size += mem_heap_get_size(new_index->heap)
+		+ sizeof new_index->lock;
 
 	dict_mem_index_free(index);
 
@@ -2349,12 +2352,13 @@ dict_index_remove_from_cache_low(
 		}
 	} while (srv_shutdown_state == SRV_SHUTDOWN_NONE || !lru_evict);
 
-	rw_lock_free(&index->lock);
+	rw_lock_free(index->lock);
+	ut_free(index->lock);
 
 	/* Remove the index from the list of indexes of the table */
 	UT_LIST_REMOVE(indexes, table->indexes, index);
 
-	size = mem_heap_get_size(index->heap);
+	size = mem_heap_get_size(index->heap) + sizeof index->lock;
 
 	ut_ad(dict_sys->size >= size);
 

=== modified file 'storage/innobase/dict/dict0mem.cc'
--- a/storage/innobase/dict/dict0mem.cc	revid:marko.makela@stripped20120510104821-eht09pzqhw4wzthl
+++ b/storage/innobase/dict/dict0mem.cc	revid:marko.makela@stripped47-5au30h69jlo94a8z
@@ -579,7 +579,8 @@ dict_mem_index_free(
 	ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
 #ifdef UNIV_BLOB_DEBUG
 	if (index->blobs) {
-		mutex_free(&index->blobs_mutex);
+		mutex_free(index->blobs_mutex);
+		ut_free(index->blobs_mutex);
 		rbt_free(index->blobs);
 	}
 #endif /* UNIV_BLOB_DEBUG */

=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc	revid:marko.makela@strippedom-20120510104821-eht09pzqhw4wzthl
+++ b/storage/innobase/handler/handler0alter.cc	revid:marko.makela@stripped0120510112547-5au30h69jlo94a8z
@@ -1698,9 +1698,9 @@ col_fail:
 			DBUG_EXECUTE_IF("innodb_OOM_prepare_inplace_alter",
 					error = DB_OUT_OF_MEMORY;
 					goto error_handling;);
-			rw_lock_x_lock(&add_index[num_created]->lock);
+			rw_lock_x_lock(add_index[num_created]->lock);
 			bool ok = row_log_allocate(add_index[num_created]);
-			rw_lock_x_unlock(&add_index[num_created]->lock);
+			rw_lock_x_unlock(add_index[num_created]->lock);
 
 			if (!ok) {
 				error = DB_OUT_OF_MEMORY;

=== modified file 'storage/innobase/include/dict0dict.ic'
--- a/storage/innobase/include/dict0dict.ic	revid:marko.makela@stripped0510104821-eht09pzqhw4wzthl
+++ b/storage/innobase/include/dict0dict.ic	revid:marko.makela@stripped47-5au30h69jlo94a8z
@@ -1098,8 +1098,9 @@ dict_index_get_lock(
 {
 	ut_ad(index);
 	ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
+	ut_ad(index->lock);
 
-	return(&(index->lock));
+	return(index->lock);
 }
 
 /********************************************************************//**

=== modified file 'storage/innobase/include/dict0mem.h'
--- a/storage/innobase/include/dict0mem.h	revid:marko.makela@oracle.com-20120510104821-eht09pzqhw4wzthl
+++ b/storage/innobase/include/dict0mem.h	revid:marko.makela@strippedm-20120510112547-5au30h69jlo94a8z
@@ -531,14 +531,14 @@ struct dict_index_struct{
 				/*!< approximate number of leaf pages in the
 				index tree */
 	/* @} */
-	rw_lock_t	lock;	/*!< read-write lock protecting the
+	rw_lock_t*	lock;	/*!< read-write lock protecting the
 				upper levels of the index tree */
 	trx_id_t	trx_id; /*!< id of the transaction that created this
 				index, or 0 if the index existed
 				when InnoDB was started up */
 #endif /* !UNIV_HOTBACKUP */
 #ifdef UNIV_BLOB_DEBUG
-	mutex_t		blobs_mutex;
+	mutex_t*	blobs_mutex;
 				/*!< mutex protecting blobs */
 	ib_rbt_t*	blobs;	/*!< map of (page_no,heap_no,field_no)
 				to first_blob_page_no; protected by

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5854 branch (marko.makela:3765 to 3766) WL#5854marko.makela7 Jun