MCPcopy Create free account
hub / github.com/MariaDB/server / wait_after_commit

Method wait_after_commit

sql/semisync_master.cc:759–792  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757}
758
759int Repl_semi_sync_master::wait_after_commit(THD* thd, bool all)
760{
761 if (!get_master_enabled())
762 return 0;
763
764 int ret= 0;
765 const char *log_file;
766 my_off_t log_pos;
767
768 bool is_real_trans=
769 (all || thd->transaction->all.ha_list == 0);
770 /*
771 The coordinates are propagated to this point having been computed
772 in report_binlog_update
773 */
774 Trans_binlog_info *log_info= thd->semisync_info;
775 log_file= log_info && log_info->log_file[0] ? log_info->log_file : 0;
776 log_pos= log_info ? log_info->log_pos : 0;
777
778 DBUG_ASSERT(!log_file || dirname_length(log_file) == 0);
779
780 if (is_real_trans &&
781 log_pos &&
782 wait_point() == SEMI_SYNC_MASTER_WAIT_POINT_AFTER_STORAGE_COMMIT)
783 ret= commit_trx(log_file, log_pos);
784
785 if (is_real_trans && log_info)
786 {
787 log_info->log_file[0]= 0;
788 log_info->log_pos= 0;
789 }
790
791 return ret;
792}
793
794int Repl_semi_sync_master::wait_after_rollback(THD *thd, bool all)
795{

Callers 3

ha_commit_transFunction · 0.80
trans_commitFunction · 0.80
trans_commit_stmtFunction · 0.80

Calls 1

dirname_lengthFunction · 0.85

Tested by

no test coverage detected