Index: storage/innobase/log/log0log.cc =================================================================== --- storage/innobase/log/log0log.cc (revision 5767) +++ storage/innobase/log/log0log.cc (working copy) @@ -1235,6 +1235,9 @@ log_sys->current_flush_lsn = log_sys->lsn; MONITOR_INC(MONITOR_PENDING_LOG_FLUSH); os_event_reset(log_sys->flush_event); + + if (log_sys->buf_free == log_sys->buf_next_to_write) + goto flush_op; } group = UT_LIST_GET_FIRST(log_sys->log_groups); @@ -1242,6 +1245,8 @@ start_offset = log_sys->buf_next_to_write; end_offset = log_sys->buf_free; + ut_ad(start_offset != end_offset); + area_start = ut_calc_align_down(start_offset, OS_FILE_LOG_BLOCK_SIZE); area_end = ut_calc_align(end_offset, OS_FILE_LOG_BLOCK_SIZE); @@ -1252,8 +1257,6 @@ log_sys->buf + area_end - OS_FILE_LOG_BLOCK_SIZE, log_sys->next_checkpoint_no); - group = UT_LIST_GET_FIRST(log_sys->log_groups); - /* Calculate pad_size if needed. */ pad_size = 0; if (write_ahead_size > OS_FILE_LOG_BLOCK_SIZE) { @@ -1300,6 +1303,8 @@ log_sys_write_completion(); +flush_op: + ut_ad(lsn <= log_sys->write_lsn); if (srv_unix_file_flush_method == SRV_UNIX_O_DSYNC) { /* O_DSYNC means the OS did not buffer the log file at all: so we have also flushed to disk what we have written */