List:Commits« Previous MessageNext Message »
From:marko.makela Date:May 26 2012 4:26am
Subject:bzr push into mysql-trunk-wl6255 branch (marko.makela:3869 to 3870) WL#6255
View as plain text  
 3870 Marko Mäkelä	2012-05-26
      WL#6255 preparation: Add assertions to purge code.
      
      row_purge_remove_clust_if_poss_low(), row_purge_upd_exist_or_extern_func():
      Assert that dict_operation_lock is being S-latched. Narrow the scope
      of some variable declarations.
      
      In online table rebuild, there is a potential problem in BLOB retrieval.
      The planned solution is that we will have a lookup table of trx_id_t of
      rolled-back transactions. Any rows inserted or updated by such transactions
      will be ignored. A delete-mark operation will be buffered as a delete+purge
      in the online log, with the new PRIMARY KEY and the DB_TRX_ID of the record,
      and applied by looking up the fields in the rebuilt table.
      This (and the fact that the log apply will hold an S-latch or X-latch on
      the clustered index tree of the old table) should guarantee that the
      log apply will never dereference freed BLOBs in the old table.

    modified:
      storage/innobase/row/row0purge.cc
 3869 Marko Mäkelä	2012-05-25
      WL#6255 preparation: Relax some assertions and adjust functions
      for online table rebuild.
      
      For indicating that an online table rebuild is in progress, we will
      flag the online_status of the clustered index in the old table, and
      allocate index->online_log on the clustered index of the old table.
      This is different from the modification logging on secondary index
      creation. In secondary index creation, if the index is being built
      online, we will write all changes only to the log. In online table
      rebuild, we will log the changes in addition to changing the original
      table directly.
      
      Relax many assertions on dict_index_is_online_ddl().
      
      dict_index_set_online_status(): Remove the qualifier "secondary" index.
      
      dict_index_is_online_ddl(): Adjust the function comment.
      
      index->to_be_dropped, index->online_status: Refine the latching rules.
      
      online_index_status: Update the comment of ONLINE_INDEX_ABORTED.
      
      row_merge_is_index_usable(): Do not deny access to the clustered index
      of a table that is being rebuilt.

    modified:
      storage/innobase/btr/btr0cur.cc
      storage/innobase/include/dict0dict.h
      storage/innobase/include/dict0dict.ic
      storage/innobase/include/dict0mem.h
      storage/innobase/lock/lock0lock.cc
      storage/innobase/row/row0merge.cc
=== modified file 'storage/innobase/row/row0purge.cc'
--- a/storage/innobase/row/row0purge.cc	revid:marko.makela@stripped0525204032-kqdn46ajwkuh5y6w
+++ b/storage/innobase/row/row0purge.cc	revid:marko.makela@strippedg0g3denw1uig1qq
@@ -133,6 +133,10 @@ row_purge_remove_clust_if_poss_low(
 	ulint		offsets_[REC_OFFS_NORMAL_SIZE];
 	rec_offs_init(offsets_);
 
+#ifdef UNIV_SYNC_DEBUG
+	ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
+
 	index = dict_table_get_first_index(node->table);
 
 	pcur = &node->pcur;
@@ -545,14 +549,10 @@ row_purge_upd_exist_or_extern_func(
 	trx_undo_rec_t*	undo_rec)	/*!< in: record to purge */
 {
 	mem_heap_t*	heap;
-	ibool		is_insert;
-	ulint		rseg_id;
-	ulint		page_no;
-	ulint		offset;
-	ulint		i;
-	mtr_t		mtr;
 
-	ut_ad(node);
+#ifdef UNIV_SYNC_DEBUG
+	ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
 
 	if (node->rec_type == TRX_UNDO_UPD_DEL_REC
 	    || (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
@@ -585,7 +585,7 @@ row_purge_upd_exist_or_extern_func(
 
 skip_secondaries:
 	/* Free possible externally stored fields */
-	for (i = 0; i < upd_get_n_fields(node->update); i++) {
+	for (ulint i = 0; i < upd_get_n_fields(node->update); i++) {
 
 		const upd_field_t*	ufield
 			= upd_get_nth_field(node->update, i);
@@ -596,6 +596,11 @@ skip_secondaries:
 			ulint		internal_offset;
 			byte*		data_field;
 			dict_index_t*	index;
+			ibool		is_insert;
+			ulint		rseg_id;
+			ulint		page_no;
+			ulint		offset;
+			mtr_t		mtr;
 
 			/* We use the fact that new_val points to
 			undo_rec and get thus the offset of
@@ -814,7 +819,6 @@ row_purge_record_func(
 		dict_table_close(node->table, FALSE, FALSE);
 		node->table = NULL;
 	}
-
 }
 
 #ifdef UNIV_DEBUG

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl6255 branch (marko.makela:3869 to 3870) WL#6255marko.makela27 May