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

    modified:
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_events_waits.cc
      storage/perfschema/pfs_events_waits.h
      storage/perfschema/table_events_waits.cc
 3196 Jonathan Perkin	2010-08-10 [merge]
      Merge to mysql-trunk-bugfixing

    modified:
      scripts/CMakeLists.txt
      scripts/mysql_config.sh
=== 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-20100812102122-ml52d2ffah1u9jn5.bundle
Thread
bzr push into mysql-trunk-bugfixing branch (marc.alff:3196 to 3197) Marc Alff12 Aug