From 7322e38827ce50f86e3facbb63d9c77e744da6df Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 7 Nov 2010 22:37:43 +0100 Subject: MWL#136: Cross-engine consistency for START TRANSACTION WITH CONSISTENT SNAPSHOT Make the binlog handlerton participate in START TRANSACTION WITH CONSISTENT SNAPSHOT, recording the binlog position corresponding to the snapshot taken in other MVCC storage engines. Expose this consistent binlog position as the new status variables binlog_trx_file and binlog_trx_position. This enables to get a fully non-locking snapshot of the database (including binlog position for slave provisioning), avoiding the need for FLUSH TABLES WITH READ LOCK. Modify mysqldump to detect if the server supports this new feature, and if so, avoid FLUSH TABLES WITH READ LOCK for --single-transaction --master-data snapshot backups. --- sql/log.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sql/log.h') diff --git a/sql/log.h b/sql/log.h index fcc9d5a711b..e2266114e81 100644 --- a/sql/log.h +++ b/sql/log.h @@ -406,6 +406,12 @@ public: */ Format_description_log_event *description_event_for_exec, *description_event_for_queue; + /* + Binlog position of last commit (or non-transactional write) to the binlog. + Access to this is protected by LOCK_commit_ordered. + */ + char last_commit_pos_file[FN_REFLEN]; + my_off_t last_commit_pos_offset; MYSQL_BIN_LOG(); /* @@ -521,7 +527,7 @@ public: inline void unlock_index() { pthread_mutex_unlock(&LOCK_index);} inline IO_CACHE *get_index_file() { return &index_file;} inline uint32 get_open_count() { return open_count; } - void set_status_variables(); + void set_status_variables(THD *thd); }; class Log_event_handler -- cgit v1.2.1