List:Commits« Previous MessageNext Message »
From:Marc Alff Date:August 12 2010 10:57am
Subject:bzr push into mysql-next-mr-bugfixing branch (marc.alff:3203 to 3205)
View as plain text  
 3205 Marc Alff	2010-08-12 [merge]
      Merge mysql-trunk-bugfixing --> mysql-next-mr-bugfixing

    modified:
      sql/sql_parse.cc
 3204 Marc Alff	2010-08-12 [merge]
      Merge mysql-trunk-bugfixing --> mysql-next-mr-bugfixing

    modified:
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_events_waits.cc
      storage/perfschema/pfs_events_waits.h
      storage/perfschema/table_events_waits.cc
 3203 Dao-Gang.Qu@stripped	2010-08-12 [merge]
      Auto merge

    added:
      mysql-test/suite/rpl/r/rpl_change_master_dbug.result
      mysql-test/suite/rpl/r/rpl_show_errors.result
      mysql-test/suite/rpl/t/rpl_change_master_dbug.test
      mysql-test/suite/rpl/t/rpl_show_errors.test
    modified:
      mysql-test/extra/rpl_tests/rpl_conflicts.test
      mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
      mysql-test/extra/rpl_tests/rpl_stop_middle_group.test
      mysql-test/include/wait_for_slave_io_error.inc
      mysql-test/include/wait_for_slave_sql_error.inc
      mysql-test/suite/rpl/r/rpl_change_master.result
      mysql-test/suite/rpl/t/rpl_binlog_corruption.test
      mysql-test/suite/rpl/t/rpl_change_master.test
      mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
      mysql-test/suite/rpl/t/rpl_packet.test
      mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
      mysql-test/suite/rpl/t/rpl_server_id1.test
      sql/lex.h
      sql/rpl_mi.cc
      sql/rpl_mi.h
      sql/rpl_reporting.cc
      sql/rpl_reporting.h
      sql/rpl_slave.cc
      sql/rpl_slave.h
      sql/sql_lex.h
      sql/sql_yacc.yy
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2010-08-12 00:26:10 +0000
+++ b/sql/sql_parse.cc	2010-08-12 10:56:05 +0000
@@ -501,7 +501,6 @@ static void handle_bootstrap_impl(THD *t
   char *query;
   int length;
   int rc;
-  const char* found_semicolon= NULL;
 
   DBUG_ENTER("handle_bootstrap");
 

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2010-07-23 17:08:41 +0000
+++ b/storage/perfschema/pfs.cc	2010-08-12 10:21:22 +0000
@@ -1171,7 +1171,6 @@ get_thread_mutex_locker_v1(PSI_mutex_loc
     pfs_locker->m_waits_current.m_nesting_event_id=
       parent_locker->m_waits_current.m_event_id;
   }
-  pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS;
 
   pfs_locker->m_target.m_mutex= pfs_mutex;
   pfs_locker->m_waits_current.m_thread= pfs_thread;
@@ -1225,7 +1224,6 @@ get_thread_rwlock_locker_v1(PSI_rwlock_l
     pfs_locker->m_waits_current.m_nesting_event_id=
       parent_locker->m_waits_current.m_event_id;
   }
-  pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS;
 
   pfs_locker->m_target.m_rwlock= pfs_rwlock;
   pfs_locker->m_waits_current.m_thread= pfs_thread;
@@ -1292,7 +1290,6 @@ get_thread_cond_locker_v1(PSI_cond_locke
     pfs_locker->m_waits_current.m_nesting_event_id=
       parent_locker->m_waits_current.m_event_id;
   }
-  pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS;
 
   pfs_locker->m_target.m_cond= pfs_cond;
   pfs_locker->m_waits_current.m_thread= pfs_thread;
@@ -1359,7 +1356,6 @@ get_thread_table_locker_v1(PSI_table_loc
     pfs_locker->m_waits_current.m_nesting_event_id=
       parent_locker->m_waits_current.m_event_id;
   }
-  pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS;
 
   pfs_locker->m_target.m_table= pfs_table;
   pfs_locker->m_waits_current.m_thread= pfs_thread;
@@ -1423,7 +1419,6 @@ get_thread_file_name_locker_v1(PSI_file_
     pfs_locker->m_waits_current.m_nesting_event_id=
       parent_locker->m_waits_current.m_event_id;
   }
-  pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS;
 
   pfs_locker->m_target.m_file= pfs_file;
   pfs_locker->m_waits_current.m_thread= pfs_thread;
@@ -1483,7 +1478,6 @@ get_thread_file_stream_locker_v1(PSI_fil
     pfs_locker->m_waits_current.m_nesting_event_id=
       parent_locker->m_waits_current.m_event_id;
   }
-  pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS;
 
   pfs_locker->m_target.m_file= pfs_file;
   pfs_locker->m_waits_current.m_thread= pfs_thread;
@@ -1560,7 +1554,6 @@ get_thread_file_descriptor_locker_v1(PSI
         pfs_locker->m_waits_current.m_nesting_event_id=
           parent_locker->m_waits_current.m_event_id;
       }
-      pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS;
 
       pfs_locker->m_target.m_file= pfs_file;
       pfs_locker->m_waits_current.m_thread= pfs_thread;

=== modified file 'storage/perfschema/pfs_events_waits.cc'
--- a/storage/perfschema/pfs_events_waits.cc	2010-07-23 20:59:42 +0000
+++ b/storage/perfschema/pfs_events_waits.cc	2010-08-12 10:21:22 +0000
@@ -80,25 +80,10 @@ void cleanup_events_waits_history_long(v
   events_waits_history_long_array= NULL;
 }
 
-static void copy_events_waits(PFS_events_waits *dest,
-                              const PFS_events_waits *source)
+static inline void copy_events_waits(PFS_events_waits *dest,
+                                     const PFS_events_waits *source)
 {
-  /* m_wait_class must be the first member of PFS_events_waits. */
-  compile_time_assert(offsetof(PFS_events_waits, m_wait_class) == 0);
-
-  char* dest_body= (reinterpret_cast<char*> (dest)) + sizeof(events_waits_class);
-  const char* source_body= (reinterpret_cast<const char*> (source))
-    + sizeof(events_waits_class);
-
-  /* See comments in table_events_waits_common::make_row(). */
-
-  /* Signal readers they are about to read garbage ... */
-  dest->m_wait_class= NO_WAIT_CLASS;
-  /* ... that this can generate. */
-  memcpy(dest_body, source_body,
-         sizeof(PFS_events_waits) - sizeof(events_waits_class));
-  /* Signal readers the record is now clean again. */
-  dest->m_wait_class= source->m_wait_class;
+  memcpy(dest, source, sizeof(PFS_events_waits));
 }
 
 /**
@@ -116,9 +101,7 @@ void insert_events_waits_history(PFS_thr
     causing a potential race condition.
     We are not testing for this and insert a possibly empty record,
     to make this thread (the writer) faster.
-    This is ok, the truncated data will have
-    wait->m_wait_class == NO_WAIT_CLASS,
-    which readers of m_waits_history will filter out.
+    This is ok, the readers of m_waits_history will filter this out.
   */
   copy_events_waits(&thread->m_waits_history[index], wait);
 

=== modified file 'storage/perfschema/pfs_events_waits.h'
--- a/storage/perfschema/pfs_events_waits.h	2010-07-23 17:08:41 +0000
+++ b/storage/perfschema/pfs_events_waits.h	2010-08-12 10:21:22 +0000
@@ -97,7 +97,7 @@ struct PFS_events_waits
     - TRUNCATE EVENTS_WAITS_HISTORY
     - TRUNCATE EVENTS_WAITS_HISTORY_LONG
   */
-  volatile events_waits_class m_wait_class;
+  events_waits_class m_wait_class;
   /** Executing thread. */
   PFS_thread *m_thread;
   /** Instrument metadata. */

=== modified file 'storage/perfschema/table_events_waits.cc'
--- a/storage/perfschema/table_events_waits.cc	2010-07-23 17:08:41 +0000
+++ b/storage/perfschema/table_events_waits.cc	2010-08-12 10:21:22 +0000
@@ -217,16 +217,8 @@ void table_events_waits_common::make_row
     or 8 atomics per recorded event.
     The problem is that we record a *lot* of events ...
 
-    Instead, a *dirty* marking is done using m_wait_class.
-    Using m_wait_class alone does not guarantee anything, it just filters
-    out most of the bad data.
-    This is acceptable because this code is garbage-proof,
-    and won't crash on bad data, only display it,
-    very rarely (which is accepted).
-
-    If a bad record is displayed, it's a very transient failure:
-    the next select * from EVENTS_WAITS_CURRENT/_HISTORY/_HISTORY_LONG will
-    show clean data again.
+    This code is prepared to accept *dirty* records,
+    and sanitizes all the data before returning a row.
   */
 
   m_row.m_thread_internal_id= safe_thread->m_thread_internal_id;


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100812105605-tub7iit04d7wabva.bundle
Thread
bzr push into mysql-next-mr-bugfixing branch (marc.alff:3203 to 3205) Marc Alff12 Aug