MySQL Forums
Forum List  »  Replication

flush logs lock whole database
Posted by: zhouhuan zhou
Date: June 28, 2019 11:04PM

hello master, we meet a problem about MySQL flush logs;

when expired_log_days set 10, there is no write to database in next 5 days,

then suddenly fill up a binlog file, will trigger a flush logs command,

MySQL will flush 5 days binlogs one time,

if there is too many binlogs, whole database will lock for a long time.


I hope pelple kown this problem, and MySQL can solve it!


I test MySQL 5.6 and 5.7
find this souce code in logg.cc


bool LOGGER::flush_logs(THD *thd)
{
int rc= 0;

/*
Now we lock logger, as nobody should be able to use logging routines while
log tables are closed
*/
logger.lock_exclusive();

/* reopen log files */
file_log_handler->flush();

/* end of log flush */
logger.unlock();
return rc;
}

Options: ReplyQuote


Subject
Views
Written By
Posted
flush logs lock whole database
1249
June 28, 2019 11:04PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.