List:Commits« Previous MessageNext Message »
From:marko.makela Date:April 28 2011 7:44am
Subject:bzr push into mysql-trunk-innodb branch (marko.makela:3609 to 3611)
View as plain text  
 3611 Marko Mäkelä	2011-04-28
      Remove some debug code that was added in MySQL 3.23.44.
      
      Until MySQL 3.23.44, there was an incorrect optimization in the
      transaction commit. The update_undo log would be discarded at commit
      if it comprised only one page, it did not delete-mark anything, and
      there was only one read view in trx_sys->view_list. (It looks like
      that the read view could have belonged to a different transaction, if
      the committing transaction used consistent reads.) Ever since then,
      update_undo logs can only be discarded by the purge.
      
      trx_purge_sys_print(): Remove.
      
      trx_undo_prev_version_build(): On corruption, never print out anything
      and return DB_ERROR, but let an assertion fail instead. These
      printouts have apparently never been triggered in the 10 years of
      their existence. The only references to them were found in corrupted
      databases or when attempting to rescue a corrupted database. In such
      situations, the assertion failures can be avoided by setting
      innodb_force_recovery=5.
      
      rb:652 approved by Sunny Bains

    modified:
      storage/innobase/include/trx0purge.h
      storage/innobase/include/trx0rec.h
      storage/innobase/trx/trx0purge.c
      storage/innobase/trx/trx0rec.c
 3610 Marko Mäkelä	2011-04-28
      Fix a typo in an #ifdef.

    modified:
      include/mysql/psi/mysql_thread.h
 3609 Vasil Dimov	2011-04-28 [merge]
      Merge mysql-trunk -> mysql-trunk-innodb

    modified:
      .bzrignore
      cmake/maintainer.cmake
      cmd-line-utils/libedit/vi.c
      include/m_ctype.h
      include/mysql/psi/mysql_file.h
      include/mysql/psi/mysql_stage.h
      include/mysql/psi/mysql_statement.h
      include/mysql/psi/mysql_table.h
      include/mysql/psi/mysql_thread.h
      include/mysql/psi/psi.h
      mysql-test/collections/default.experimental
      mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
      mysql-test/include/join_cache.inc
      mysql-test/r/func_time.result
      mysql-test/r/grant.result
      mysql-test/r/having.result
      mysql-test/r/join_cache_jcl1.result
      mysql-test/r/join_cache_jcl2.result
      mysql-test/r/join_cache_jcl3.result
      mysql-test/r/join_cache_jcl4.result
      mysql-test/r/join_cache_jcl5.result
      mysql-test/r/join_cache_jcl6.result
      mysql-test/r/join_cache_jcl7.result
      mysql-test/r/join_cache_jcl8.result
      mysql-test/r/loaddata.result
      mysql-test/suite/binlog/r/binlog_bug23533.result
      mysql-test/suite/binlog/t/binlog_bug23533.test
      mysql-test/suite/parts/inc/partition_check_drop.inc
      mysql-test/suite/parts/inc/partition_layout_check1.inc
      mysql-test/suite/parts/inc/partition_layout_check2.inc
      mysql-test/t/func_time.test
      mysql-test/t/grant.test
      mysql-test/t/having.test
      mysql-test/t/loaddata.test
      mysql-test/t/mysqlbinlog_raw_mode.test
      mysys/default.c
      mysys/my_init.c
      plugin/semisync/semisync_master_plugin.cc
      sql-common/my_time.c
      sql/debug_sync.cc
      sql/events.cc
      sql/ha_ndbcluster.cc
      sql/ha_partition.cc
      sql/ha_partition.h
      sql/handler.cc
      sql/handler.h
      sql/item_cmpfunc.cc
      sql/item_func.cc
      sql/item_timefunc.cc
      sql/mdl.cc
      sql/mysqld.cc
      sql/mysqld.h
      sql/opt_range.cc
      sql/rpl_master.cc
      sql/rpl_slave.cc
      sql/sp.cc
      sql/sp.h
      sql/sp_cache.cc
      sql/sql_acl.cc
      sql/sql_audit.cc
      sql/sql_base.cc
      sql/sql_base.h
      sql/sql_class.cc
      sql/sql_db.cc
      sql/sql_join_cache.cc
      sql/sql_load.cc
      sql/sql_parse.cc
      sql/sql_plugin.cc
      sql/sql_select.cc
      sql/sql_select.h
      sql/sql_servers.cc
      sql/sql_udf.cc
      sql/structs.h
      sql/table.cc
      sql/tztime.cc
      storage/archive/ha_archive.cc
      storage/blackhole/ha_blackhole.cc
      storage/csv/ha_tina.cc
      storage/example/ha_example.cc
      storage/federated/ha_federated.cc
      storage/heap/ha_heap.cc
      storage/heap/ha_heap.h
      storage/heap/hp_static.c
      storage/innobase/handler/ha_innodb.cc
      storage/myisam/ha_myisam.cc
      storage/myisam/ha_myisam.h
      storage/myisam/mi_static.c
      storage/myisammrg/ha_myisammrg.cc
      storage/myisammrg/ha_myisammrg.h
      storage/myisammrg/myrg_static.c
=== modified file 'include/mysql/psi/mysql_thread.h'
--- a/include/mysql/psi/mysql_thread.h	revid:vasil.dimov@stripped7
+++ b/include/mysql/psi/mysql_thread.h	revid:marko.makela@stripped
@@ -1120,7 +1120,7 @@ static inline int inline_mysql_cond_broa
 }
 
 static inline void inline_mysql_thread_register(
-#ifdef HAVE_PSI_THREAD__INTERFACE
+#ifdef HAVE_PSI_THREAD_INTERFACE
   const char *category,
   PSI_thread_info *info,
   int count

=== modified file 'storage/innobase/include/trx0purge.h'
--- a/storage/innobase/include/trx0purge.h	revid:vasil.dimov@stripped57
+++ b/storage/innobase/include/trx0purge.h	revid:marko.makela@stripped
@@ -100,13 +100,6 @@ trx_purge(
 					submit to task queue. */
 	ulint	limit);			/*!< in: the maximum number of
 					records to purge in one batch */
-/******************************************************************//**
-Prints information of the purge system to stderr. */
-UNIV_INTERN
-void
-trx_purge_sys_print(void);
-/*======================*/
-
 /** This is the purge pointer/iterator. We need both the undo no and the
 transaction no up to which purge has parsed and applied the records. */
 typedef struct purge_iter_struct {

=== modified file 'storage/innobase/include/trx0rec.h'
--- a/storage/innobase/include/trx0rec.h	revid:vasil.dimov@strippedjk857
+++ b/storage/innobase/include/trx0rec.h	revid:marko.makela@stripped
@@ -245,8 +245,7 @@ that the caller has a latch on the index
 and an s-latch on the purge_view. This guarantees that the stack of versions
 is locked.
 @return DB_SUCCESS, or DB_MISSING_HISTORY if the previous version is
-earlier than purge_view, which means that it may have been removed,
-DB_ERROR if corrupted record */
+earlier than purge_view, which means that it may have been removed */
 UNIV_INTERN
 ulint
 trx_undo_prev_version_build(

=== modified file 'storage/innobase/trx/trx0purge.c'
--- a/storage/innobase/trx/trx0purge.c	revid:vasil.dimov@stripped44314-jcn6h419ie3jk857
+++ b/storage/innobase/trx/trx0purge.c	revid:marko.makela@strippeddg97dl34a
@@ -1309,28 +1309,3 @@ run_synchronously:
 
 	return(n_pages_handled);
 }
-
-/******************************************************************//**
-Prints information of the purge system to stderr. */
-UNIV_INTERN
-void
-trx_purge_sys_print(void)
-/*=====================*/
-{
-	fprintf(stderr, "InnoDB: Purge system view:\n");
-	read_view_print(purge_sys->view);
-
-	fprintf(stderr, "InnoDB: Purge trx n:o " TRX_ID_FMT
-		", undo n:o " TRX_ID_FMT "\n",
-		(ullint) purge_sys->limit.trx_no,
-		(ullint) purge_sys->limit.undo_no);
-	fprintf(stderr,
-		"InnoDB: Purge next stored %lu, page_no %lu, offset %lu,\n"
-		"InnoDB: Purge hdr_page_no %lu, hdr_offset %lu\n",
-		(ulong) purge_sys->next_stored,
-		(ulong) purge_sys->page_no,
-		(ulong) purge_sys->offset,
-		(ulong) purge_sys->hdr_page_no,
-		(ulong) purge_sys->hdr_offset);
-}
-

=== modified file 'storage/innobase/trx/trx0rec.c'
--- a/storage/innobase/trx/trx0rec.c	revid:vasil.dimov@stripped10428044314-jcn6h419ie3jk857
+++ b/storage/innobase/trx/trx0rec.c	revid:marko.makela@strippeddnwldg97dl34a
@@ -1406,8 +1406,7 @@ that the caller has a latch on the index
 and an s-latch on the purge_view. This guarantees that the stack of versions
 is locked all the way down to the purge_view.
 @return DB_SUCCESS, or DB_MISSING_HISTORY if the previous version is
-earlier than purge_view, which means that it may have been removed,
-DB_ERROR if corrupted record */
+earlier than purge_view, which means that it may have been removed */
 UNIV_INTERN
 ulint
 trx_undo_prev_version_build(
@@ -1451,20 +1450,7 @@ trx_undo_prev_version_build(
 	      || mtr_memo_contains_page(index_mtr, index_rec,
 					MTR_MEMO_PAGE_X_FIX));
 	ut_ad(rec_offs_validate(rec, index, offsets));
-
-	if (!dict_index_is_clust(index)) {
-		fprintf(stderr, "InnoDB: Error: trying to access"
-			" update undo rec for non-clustered index %s\n"
-			"InnoDB: Submit a detailed bug report to"
-			" http://bugs.mysql.com\n"
-			"InnoDB: index record ", index->name);
-		rec_print(stderr, index_rec, index);
-		fputs("\n"
-		      "InnoDB: record version ", stderr);
-		rec_print_new(stderr, rec, offsets);
-		putc('\n', stderr);
-		return(DB_ERROR);
-	}
+	ut_a(dict_index_is_clust(index));
 
 	roll_ptr = row_get_rec_roll_ptr(rec, index, offsets);
 	old_roll_ptr = roll_ptr;
@@ -1484,7 +1470,9 @@ trx_undo_prev_version_build(
 
 	if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
 		/* The undo record may already have been purged.
-		This should never happen in InnoDB. */
+		This should never happen for user transactions, but
+		it can happen in purge. */
+		ut_ad(err == DB_MISSING_HISTORY);
 
 		return(err);
 	}
@@ -1522,54 +1510,8 @@ trx_undo_prev_version_build(
 	ptr = trx_undo_update_rec_get_update(ptr, index, type, trx_id,
 					     roll_ptr, info_bits,
 					     NULL, heap, &update);
-
-	if (UNIV_UNLIKELY(table_id != index->table->id)) {
-		ptr = NULL;
-
-		fprintf(stderr,
-			"InnoDB: Error: trying to access update undo rec"
-			" for table %s\n"
-			"InnoDB: but the table id in the"
-			" undo record is wrong\n"
-			"InnoDB: Submit a detailed bug report"
-			" to http://bugs.mysql.com\n"
-			"InnoDB: Run also CHECK TABLE %s\n",
-			index->table_name, index->table_name);
-	}
-
-	if (ptr == NULL) {
-		/* The record was corrupted, return an error; these printfs
-		should catch an elusive bug in row_vers_old_has_index_entry */
-
-		fprintf(stderr,
-			"InnoDB: table %s, index %s, n_uniq %lu\n"
-			"InnoDB: undo rec address %p, type %lu cmpl_info %lu\n"
-			"InnoDB: undo rec table id %llu,"
-			" index table id %llu\n"
-			"InnoDB: dump of 150 bytes in undo rec: ",
-			index->table_name, index->name,
-			(ulong) dict_index_get_n_unique(index),
-			undo_rec, (ulong) type, (ulong) cmpl_info,
-			(ullint) table_id,
-			(ullint) index->table->id);
-		ut_print_buf(stderr, undo_rec, 150);
-		fputs("\n"
-		      "InnoDB: index record ", stderr);
-		rec_print(stderr, index_rec, index);
-		fputs("\n"
-		      "InnoDB: record version ", stderr);
-		rec_print_new(stderr, rec, offsets);
-		fprintf(stderr, "\n"
-			"InnoDB: Record trx id " TRX_ID_FMT
-			", update rec trx id " TRX_ID_FMT "\n"
-			"InnoDB: Roll ptr in rec " TRX_ID_FMT
-			", in update rec" TRX_ID_FMT "\n",
-			(ullint) rec_trx_id, (ullint) trx_id,
-			(ullint) old_roll_ptr, (ullint) roll_ptr);
-
-		trx_purge_sys_print();
-		return(DB_ERROR);
-	}
+	ut_a(table_id == index->table->id);
+	ut_a(ptr);
 
 	if (row_upd_changes_field_size_or_external(index, offsets, update)) {
 		ulint	n_ext;

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20110428073349-hjvdnwldg97dl34a.bundle
Thread
bzr push into mysql-trunk-innodb branch (marko.makela:3609 to 3611) marko.makela28 Apr