summaryrefslogtreecommitdiff
path: root/sql/log.h
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@oracle.com>2011-03-01 17:39:28 +0100
committerMarc Alff <marc.alff@oracle.com>2011-03-01 17:39:28 +0100
commit5ee90018446bcb10c4a85f03eee968f99de4fa97 (patch)
tree65bbccb37aeddd07d7c8fafb985b0e746957847f /sql/log.h
parent69b82937591f6e5cf30ec75d1ba7caf0cb69ead4 (diff)
downloadmariadb-git-5ee90018446bcb10c4a85f03eee968f99de4fa97.tar.gz
Bug#11766528 PERFORMANCE_SCHEMA TRACKS BOTH BINARY AND RELAY LOGS IN THE SAME EVENTS
Before this fix, all the performance schema instrumentation for both the binary log and the relay log would use the following instruments: - wait/io/file/sql/binlog - wait/io/file/sql/binlog_index - wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index - wait/synch/cond/sql/MYSQL_BIN_LOG::update_cond This instrumentation is too general and can be more specific. With this fix, the binlog instrumentation is identical, and the relay log instrumentation is changed to: - wait/io/file/sql/relaylog - wait/io/file/sql/relaylog_index - wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index - wait/synch/cond/sql/MYSQL_RELAY_LOG::update_cond With this change, the performance instrumentation for the binary log and the relay log, which share the same structure but have different uses, is more detailed. This is especially important for hosts in the middle of a replication chain, that are both masters (binlog) and slaves (relaylog).
Diffstat (limited to 'sql/log.h')
-rw-r--r--sql/log.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/sql/log.h b/sql/log.h
index 05f8a4ce286..7f7d1a1cf3a 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -274,6 +274,16 @@ private:
class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
{
private:
+#ifdef HAVE_PSI_INTERFACE
+ /** The instrumentation key to use for @ LOCK_index. */
+ PSI_mutex_key m_key_LOCK_index;
+ /** The instrumentation key to use for @ update_cond. */
+ PSI_cond_key m_key_update_cond;
+ /** The instrumentation key to use for opening the log file. */
+ PSI_file_key m_key_file_log;
+ /** The instrumentation key to use for opening the log index file. */
+ PSI_file_key m_key_file_log_index;
+#endif
/* LOCK_log and LOCK_index are inited by init_pthread_objects() */
mysql_mutex_t LOCK_index;
mysql_mutex_t LOCK_prep_xids;
@@ -362,6 +372,19 @@ public:
on exit() - but only during the correct shutdown process
*/
+#ifdef HAVE_PSI_INTERFACE
+ void set_psi_keys(PSI_mutex_key key_LOCK_index,
+ PSI_cond_key key_update_cond,
+ PSI_file_key key_file_log,
+ PSI_file_key key_file_log_index)
+ {
+ m_key_LOCK_index= key_LOCK_index;
+ m_key_update_cond= key_update_cond;
+ m_key_file_log= key_file_log;
+ m_key_file_log_index= key_file_log_index;
+ }
+#endif
+
int open(const char *opt_name);
void close();
int log_xid(THD *thd, my_xid xid);