mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#37148 Most callers of mysql_bin_log.write ignore the return result
This is the non-ndb part of the patch. The return value of mysql_bin_log.write was ignored by most callers, which may lead to inconsistent on master and slave if the transaction was committed while the binlog was not correctly written. If my_error() is call in mysql_bin_log.write, this could also lead to assertion issue if my_ok() or my_error() is called after. This fixed the problem by let the caller to check and handle the return value of mysql_bin_log.write. This patch only adresses the simple cases.
This commit is contained in:
@ -1219,8 +1219,8 @@ int reset_slave(THD *thd, Master_info* mi)
|
||||
MY_STAT stat_area;
|
||||
char fname[FN_REFLEN];
|
||||
int thread_mask= 0, error= 0;
|
||||
uint sql_errno=0;
|
||||
const char* errmsg=0;
|
||||
uint sql_errno=ER_UNKNOWN_ERROR;
|
||||
const char* errmsg= "Unknown error occured while reseting slave";
|
||||
DBUG_ENTER("reset_slave");
|
||||
|
||||
lock_slave_threads(mi);
|
||||
@ -1960,7 +1960,8 @@ err:
|
||||
replication events along LOAD DATA processing.
|
||||
|
||||
@param file pointer to io-cache
|
||||
@return 0
|
||||
@retval 0 success
|
||||
@retval 1 failure
|
||||
*/
|
||||
int log_loaded_block(IO_CACHE* file)
|
||||
{
|
||||
@ -1987,7 +1988,8 @@ int log_loaded_block(IO_CACHE* file)
|
||||
Append_block_log_event a(lf_info->thd, lf_info->thd->db, buffer,
|
||||
min(block_len, max_event_size),
|
||||
lf_info->log_delayed);
|
||||
mysql_bin_log.write(&a);
|
||||
if (mysql_bin_log.write(&a))
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1995,7 +1997,8 @@ int log_loaded_block(IO_CACHE* file)
|
||||
buffer,
|
||||
min(block_len, max_event_size),
|
||||
lf_info->log_delayed);
|
||||
mysql_bin_log.write(&b);
|
||||
if (mysql_bin_log.write(&b))
|
||||
DBUG_RETURN(1);
|
||||
lf_info->wrote_create_file= 1;
|
||||
DBUG_SYNC_POINT("debug_lock.created_file_event",10);
|
||||
}
|
||||
|
Reference in New Issue
Block a user