binlog.h   binlog.h 
skipping to change at line 251 skipping to change at line 251
PSI_mutex_key m_key_COND_done; PSI_mutex_key m_key_COND_done;
PSI_mutex_key m_key_LOCK_commit_queue; PSI_mutex_key m_key_LOCK_commit_queue;
PSI_mutex_key m_key_LOCK_done; PSI_mutex_key m_key_LOCK_done;
PSI_mutex_key m_key_LOCK_flush_queue; PSI_mutex_key m_key_LOCK_flush_queue;
PSI_mutex_key m_key_LOCK_sync_queue; PSI_mutex_key m_key_LOCK_sync_queue;
/** The instrumentation key to use for @ LOCK_commit. */ /** The instrumentation key to use for @ LOCK_commit. */
PSI_mutex_key m_key_LOCK_commit; PSI_mutex_key m_key_LOCK_commit;
/** The instrumentation key to use for @ LOCK_sync. */ /** The instrumentation key to use for @ LOCK_sync. */
PSI_mutex_key m_key_LOCK_sync; PSI_mutex_key m_key_LOCK_sync;
/** The instrumentation key to use for @ LOCK_xids. */
PSI_mutex_key m_key_LOCK_xids;
/** The instrumentation key to use for @ update_cond. */ /** The instrumentation key to use for @ update_cond. */
PSI_cond_key m_key_update_cond; PSI_cond_key m_key_update_cond;
/** The instrumentation key to use for @ prep_xids_cond. */ /** The instrumentation key to use for @ prep_xids_cond. */
PSI_cond_key m_key_prep_xids_cond; PSI_cond_key m_key_prep_xids_cond;
/** The instrumentation key to use for opening the log file. */ /** The instrumentation key to use for opening the log file. */
PSI_file_key m_key_file_log; PSI_file_key m_key_file_log;
/** The instrumentation key to use for opening the log index file. */ /** The instrumentation key to use for opening the log index file. */
PSI_file_key m_key_file_log_index; PSI_file_key m_key_file_log_index;
#endif #endif
/* POSIX thread objects are inited by init_pthread_objects() */ /* POSIX thread objects are inited by init_pthread_objects() */
mysql_mutex_t LOCK_index; mysql_mutex_t LOCK_index;
mysql_mutex_t LOCK_commit; mysql_mutex_t LOCK_commit;
mysql_mutex_t LOCK_sync; mysql_mutex_t LOCK_sync;
mysql_mutex_t LOCK_xids;
mysql_cond_t update_cond; mysql_cond_t update_cond;
ulonglong bytes_written; ulonglong bytes_written;
IO_CACHE index_file; IO_CACHE index_file;
char index_file_name[FN_REFLEN]; char index_file_name[FN_REFLEN];
/* /*
crash_safe_index_file is temp file used for guaranteeing crash_safe_index_file is temp file used for guaranteeing
index file crash safe when master server restarts. index file crash safe when master server restarts.
*/ */
IO_CACHE crash_safe_index_file; IO_CACHE crash_safe_index_file;
char crash_safe_index_file_name[FN_REFLEN]; char crash_safe_index_file_name[FN_REFLEN];
skipping to change at line 313 skipping to change at line 316
uint *sync_period_ptr; uint *sync_period_ptr;
uint sync_counter; uint sync_counter;
my_atomic_rwlock_t m_prep_xids_lock; my_atomic_rwlock_t m_prep_xids_lock;
mysql_cond_t m_prep_xids_cond; mysql_cond_t m_prep_xids_cond;
volatile int32 m_prep_xids; volatile int32 m_prep_xids;
/** /**
Increment the prepared XID counter. Increment the prepared XID counter.
*/ */
void inc_prep_xids() { void inc_prep_xids(THD *thd) {
DBUG_ENTER("MYSQL_BIN_LOG::inc_prep_xids"); DBUG_ENTER("MYSQL_BIN_LOG::inc_prep_xids");
my_atomic_rwlock_wrlock(&m_prep_xids_lock); my_atomic_rwlock_wrlock(&m_prep_xids_lock);
#ifndef DBUG_OFF #ifndef DBUG_OFF
int result= my_atomic_add32(&m_prep_xids, 1); int result= my_atomic_add32(&m_prep_xids, 1);
#else #else
(void) my_atomic_add32(&m_prep_xids, 1); (void) my_atomic_add32(&m_prep_xids, 1);
#endif #endif
DBUG_PRINT("debug", ("m_prep_xids: %d", result + 1)); DBUG_PRINT("debug", ("m_prep_xids: %d", result + 1));
my_atomic_rwlock_wrunlock(&m_prep_xids_lock); my_atomic_rwlock_wrunlock(&m_prep_xids_lock);
thd->transaction.flags.xid_written= true;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
/** /**
Decrement the prepared XID counter. Decrement the prepared XID counter.
Signal m_prep_xids_cond if the counter reaches zero. Signal m_prep_xids_cond if the counter reaches zero.
*/ */
void dec_prep_xids() { void dec_prep_xids(THD *thd) {
DBUG_ENTER("MYSQL_BIN_LOG::dec_prep_xids"); DBUG_ENTER("MYSQL_BIN_LOG::dec_prep_xids");
my_atomic_rwlock_wrlock(&m_prep_xids_lock); my_atomic_rwlock_wrlock(&m_prep_xids_lock);
int32 result= my_atomic_add32(&m_prep_xids, -1); int32 result= my_atomic_add32(&m_prep_xids, -1);
DBUG_PRINT("debug", ("m_prep_xids: %d", result - 1)); DBUG_PRINT("debug", ("m_prep_xids: %d", result - 1));
my_atomic_rwlock_wrunlock(&m_prep_xids_lock); my_atomic_rwlock_wrunlock(&m_prep_xids_lock);
thd->transaction.flags.xid_written= false;
/* If the old value was 1, it is zero now. */ /* If the old value was 1, it is zero now. */
if (result == 1) if (result == 1)
{
mysql_mutex_lock(&LOCK_xids);
mysql_cond_signal(&m_prep_xids_cond); mysql_cond_signal(&m_prep_xids_cond);
mysql_mutex_unlock(&LOCK_xids);
}
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
int32 get_prep_xids() { int32 get_prep_xids() {
my_atomic_rwlock_rdlock(&m_prep_xids_lock); my_atomic_rwlock_rdlock(&m_prep_xids_lock);
int32 result= my_atomic_load32(&m_prep_xids); int32 result= my_atomic_load32(&m_prep_xids);
my_atomic_rwlock_rdunlock(&m_prep_xids_lock); my_atomic_rwlock_rdunlock(&m_prep_xids_lock);
return result; return result;
} }
skipping to change at line 427 skipping to change at line 436
#ifdef HAVE_PSI_INTERFACE #ifdef HAVE_PSI_INTERFACE
void set_psi_keys(PSI_mutex_key key_LOCK_index, void set_psi_keys(PSI_mutex_key key_LOCK_index,
PSI_mutex_key key_LOCK_commit, PSI_mutex_key key_LOCK_commit,
PSI_mutex_key key_LOCK_commit_queue, PSI_mutex_key key_LOCK_commit_queue,
PSI_mutex_key key_LOCK_done, PSI_mutex_key key_LOCK_done,
PSI_mutex_key key_LOCK_flush_queue, PSI_mutex_key key_LOCK_flush_queue,
PSI_mutex_key key_LOCK_log, PSI_mutex_key key_LOCK_log,
PSI_mutex_key key_LOCK_sync, PSI_mutex_key key_LOCK_sync,
PSI_mutex_key key_LOCK_sync_queue, PSI_mutex_key key_LOCK_sync_queue,
PSI_mutex_key key_LOCK_xids,
PSI_cond_key key_COND_done, PSI_cond_key key_COND_done,
PSI_cond_key key_update_cond, PSI_cond_key key_update_cond,
PSI_cond_key key_prep_xids_cond, PSI_cond_key key_prep_xids_cond,
PSI_file_key key_file_log, PSI_file_key key_file_log,
PSI_file_key key_file_log_index) PSI_file_key key_file_log_index)
{ {
m_key_COND_done= key_COND_done; m_key_COND_done= key_COND_done;
m_key_LOCK_commit_queue= key_LOCK_commit_queue; m_key_LOCK_commit_queue= key_LOCK_commit_queue;
m_key_LOCK_done= key_LOCK_done; m_key_LOCK_done= key_LOCK_done;
m_key_LOCK_flush_queue= key_LOCK_flush_queue; m_key_LOCK_flush_queue= key_LOCK_flush_queue;
m_key_LOCK_sync_queue= key_LOCK_sync_queue; m_key_LOCK_sync_queue= key_LOCK_sync_queue;
m_key_LOCK_index= key_LOCK_index; m_key_LOCK_index= key_LOCK_index;
m_key_LOCK_log= key_LOCK_log; m_key_LOCK_log= key_LOCK_log;
m_key_LOCK_commit= key_LOCK_commit; m_key_LOCK_commit= key_LOCK_commit;
m_key_LOCK_sync= key_LOCK_sync; m_key_LOCK_sync= key_LOCK_sync;
m_key_LOCK_xids= key_LOCK_xids;
m_key_update_cond= key_update_cond; m_key_update_cond= key_update_cond;
m_key_prep_xids_cond= key_prep_xids_cond; m_key_prep_xids_cond= key_prep_xids_cond;
m_key_file_log= key_file_log; m_key_file_log= key_file_log;
m_key_file_log_index= key_file_log_index; m_key_file_log_index= key_file_log_index;
} }
#endif #endif
/** /**
Find the oldest binary log that contains any GTID that Find the oldest binary log that contains any GTID that
is not in the given gtid set. is not in the given gtid set.
skipping to change at line 497 skipping to change at line 508
Gtid_set* previous_gtid_set; Gtid_set* previous_gtid_set;
int open(const char *opt_name) { return open_binlog(opt_name); } int open(const char *opt_name) { return open_binlog(opt_name); }
bool change_stage(THD *thd, Stage_manager::StageID stage, bool change_stage(THD *thd, Stage_manager::StageID stage,
THD* queue, mysql_mutex_t *leave, THD* queue, mysql_mutex_t *leave,
mysql_mutex_t *enter); mysql_mutex_t *enter);
std::pair<int,my_off_t> flush_thread_caches(THD *thd); std::pair<int,my_off_t> flush_thread_caches(THD *thd);
int flush_cache_to_file(my_off_t *flush_end_pos); int flush_cache_to_file(my_off_t *flush_end_pos);
int finish_commit(THD *thd); int finish_commit(THD *thd);
std::pair<bool, bool> sync_binlog_file(bool force); std::pair<bool, bool> sync_binlog_file(bool force);
void process_commit_stage_queue(THD *thd, THD *queue, int flush_error); void process_commit_stage_queue(THD *thd, THD *queue);
void process_after_commit_stage_queue(THD *thd, THD *first);
int process_flush_stage_queue(my_off_t *total_bytes_var, bool *rotate_var , int process_flush_stage_queue(my_off_t *total_bytes_var, bool *rotate_var ,
THD **out_queue_var); THD **out_queue_var);
int ordered_commit(THD *thd, bool all, bool skip_commit = false); int ordered_commit(THD *thd, bool all, bool skip_commit = false);
public: public:
int open_binlog(const char *opt_name); int open_binlog(const char *opt_name);
void close(); void close();
enum_result commit(THD *thd, bool all); enum_result commit(THD *thd, bool all);
int rollback(THD *thd, bool all); int rollback(THD *thd, bool all);
int prepare(THD *thd, bool all); int prepare(THD *thd, bool all);
int recover(IO_CACHE *log, Format_description_log_event *fdle, int recover(IO_CACHE *log, Format_description_log_event *fdle,
skipping to change at line 620 skipping to change at line 632
@param[out] synced if not NULL, set to 1 if file is synchronized, othe rwise 0 @param[out] synced if not NULL, set to 1 if file is synchronized, othe rwise 0
@param[in] force if TRUE, ignores the 'sync_binlog' and synchronizes t he file. @param[in] force if TRUE, ignores the 'sync_binlog' and synchronizes t he file.
@retval 0 Success @retval 0 Success
@retval other Failure @retval other Failure
*/ */
bool flush_and_sync(const bool force= false); bool flush_and_sync(const bool force= false);
int purge_logs(const char *to_log, bool included, int purge_logs(const char *to_log, bool included,
bool need_lock_index, bool need_update_threads, bool need_lock_index, bool need_update_threads,
ulonglong *decrease_log_space); ulonglong *decrease_log_space, bool auto_purge);
int purge_logs_before_date(time_t purge_time); int purge_logs_before_date(time_t purge_time, bool auto_purge);
int purge_first_log(Relay_log_info* rli, bool included); int purge_first_log(Relay_log_info* rli, bool included);
int set_crash_safe_index_file_name(const char *base_file_name); int set_crash_safe_index_file_name(const char *base_file_name);
int open_crash_safe_index_file(); int open_crash_safe_index_file();
int close_crash_safe_index_file(); int close_crash_safe_index_file();
int add_log_to_index(uchar* log_file_name, int name_len, int add_log_to_index(uchar* log_file_name, int name_len,
bool need_lock_index); bool need_lock_index);
int move_crash_safe_index_file_to_index_file(bool need_lock_index); int move_crash_safe_index_file_to_index_file(bool need_lock_index);
int set_purge_index_file_name(const char *base_file_name); int set_purge_index_file_name(const char *base_file_name);
int open_purge_index_file(bool destroy); int open_purge_index_file(bool destroy);
bool is_inited_purge_index_file(); bool is_inited_purge_index_file();
 End of changes. 12 change blocks. 
5 lines changed or deleted 17 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/