Bug #67834 Incorrect description of FLUSH ENGINE LOGS in the manual
Submitted: 7 Dec 2012 7:36 Modified: 10 Apr 2013 1:59
Reporter: Alexey Kopytov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.5, 5.6 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[7 Dec 2012 7:36] Alexey Kopytov
Description:
The manual says the following in FLUSH ENGINE LOGS:

"ENGINE closes and reopens any flushable logs for installed storage engines. Currently, this causes InnoDB to flush its logs to disk and perform a checkpoint."

However, from code analysis it looks like the only thing it does for InnoDB is log_buffer_flush_to_disk(), i.e. no checkpoint is performed. I looked at both 5.5 and 5.6 code.

How to repeat:
Examine innobase_flush_logs().
[28 Dec 2012 18:22] Valeriy Kravchuk
Let me quote the code of 5.5.29 to make this more clear (if anybody is in doubts...):

/****************************************************************//**
Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes
the logs, and the name of this function should be innobase_checkpoint.
@return TRUE if error */
static
bool
innobase_flush_logs(
/*================*/
        handlerton*     hton)   /*!< in/out: InnoDB handlerton */
{
        bool    result = 0;

        DBUG_ENTER("innobase_flush_logs");
        DBUG_ASSERT(hton == innodb_hton_ptr);

        log_buffer_flush_to_disk();

        DBUG_RETURN(result);
}

...

/****************************************************************//**
Does a syncronous flush of the log buffer to disk. */
UNIV_INTERN
void
log_buffer_flush_to_disk(void)
/*==========================*/
{
        ib_uint64_t     lsn;

        mutex_enter(&(log_sys->mutex));

        lsn = log_sys->lsn;

        mutex_exit(&(log_sys->mutex));

        log_write_up_to(lsn, LOG_WAIT_ALL_GROUPS, TRUE);
}

...

/******************************************************//**
This function is called, e.g., when a transaction wants to commit. It checks
that the log has been written to the log file up to the last log entry written
by the transaction. If there is a flush running, it waits and checks if the
flush flushed enough. If not, starts a new flush. */
UNIV_INTERN
void
log_write_up_to(

...

I can continue, but looks like commit does not happen, it's not log_write_up_to() function's job to commit, isn't it?

So, let me ask, why this is not verified yet (as it is assigned for a long time)?
[10 Apr 2013 1:59] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.