diff options
Diffstat (limited to 'sql/log.h')
-rw-r--r-- | sql/log.h | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/sql/log.h b/sql/log.h index b3b598e08ea..8ba39614825 100644 --- a/sql/log.h +++ b/sql/log.h @@ -18,7 +18,6 @@ #define LOG_H #include "handler.h" /* my_xid */ -#include "wsrep.h" #include "wsrep_mysqld.h" #include "rpl_constants.h" @@ -249,10 +248,6 @@ extern TC_LOG_DUMMY tc_log_dummy; class Relay_log_info; -#ifdef HAVE_PSI_INTERFACE -extern PSI_mutex_key key_LOG_INFO_lock; -#endif - /* Note that we destroy the lock mutex in the desctructor here. This means that object instances cannot be destroyed/go out of scope, @@ -264,19 +259,11 @@ typedef struct st_log_info my_off_t index_file_offset, index_file_start_offset; my_off_t pos; bool fatal; // if the purge happens to give us a negative offset - mysql_mutex_t lock; st_log_info() : index_file_offset(0), index_file_start_offset(0), pos(0), fatal(0) { DBUG_ENTER("LOG_INFO"); log_file_name[0] = '\0'; - mysql_mutex_init(key_LOG_INFO_lock, &lock, MY_MUTEX_INIT_FAST); - DBUG_VOID_RETURN; - } - ~st_log_info() - { - DBUG_ENTER("~LOG_INFO"); - mysql_mutex_destroy(&lock); DBUG_VOID_RETURN; } } LOG_INFO; @@ -307,6 +294,7 @@ class MYSQL_LOG { public: MYSQL_LOG(); + virtual ~MYSQL_LOG() {} void init_pthread_objects(); void cleanup(); bool open( @@ -329,8 +317,8 @@ public: const char *generate_name(const char *log_name, const char *suffix, bool strip_ext, char *buff); - int generate_new_name(char *new_name, const char *log_name, - ulong next_log_number); + virtual int generate_new_name(char *new_name, const char *log_name, + ulong next_log_number); protected: /* LOCK_log is inited by init_pthread_objects() */ mysql_mutex_t LOCK_log; @@ -517,6 +505,11 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG GLOBAL MAX_BINLOG_SIZE|MAX_RELAY_LOG_SIZE) from sys_vars.cc */ ulong max_size; + /* + Number generated by last call of find_uniq_filename(). Corresponds + closely with current_binlog_id + */ + ulong last_used_log_number; // current file sequence number for load data infile binary logging uint file_id; uint open_count; // For replication @@ -563,7 +556,7 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG LOCK_log. */ int new_file_without_locking(); - int new_file_impl(bool need_lock); + int new_file_impl(); void do_checkpoint_request(ulong binlog_id); void purge(); int write_transaction_or_stmt(group_commit_entry *entry, uint64 commit_id); @@ -707,6 +700,8 @@ public: int open(const char *opt_name); void close(); + virtual int generate_new_name(char *new_name, const char *log_name, + ulong next_log_number); int log_and_order(THD *thd, my_xid xid, bool all, bool need_prepare_ordered, bool need_commit_ordered); int unlog(ulong cookie, my_xid xid); @@ -725,15 +720,13 @@ public: { bytes_written = 0; } - void harvest_bytes_written(ulonglong* counter) + void harvest_bytes_written(Atomic_counter<uint64> *counter) { #ifndef DBUG_OFF char buf1[22],buf2[22]; #endif DBUG_ENTER("harvest_bytes_written"); - - my_atomic_add64_explicit((volatile int64*)(counter), bytes_written, - MY_MEMORY_ORDER_RELAXED); + (*counter)+=bytes_written; DBUG_PRINT("info",("counter: %s bytes_written: %s", llstr(*counter,buf1), llstr(bytes_written,buf2))); bytes_written=0; @@ -1226,6 +1219,11 @@ static inline TC_LOG *get_tc_log_implementation() return &tc_log_mmap; } +#ifdef WITH_WSREP +IO_CACHE* wsrep_get_trans_cache(THD *); +void wsrep_thd_binlog_trx_reset(THD * thd); +void wsrep_thd_binlog_stmt_rollback(THD * thd); +#endif /* WITH_WSREP */ class Gtid_list_log_event; const char * |