flush logs lock whole database
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;
}
Subject
Views
Written By
Posted
flush logs lock whole database
1580
June 28, 2019 11:04PM
442
June 28, 2019 11:20PM
382
July 08, 2019 02:23AM
355
July 08, 2019 02:24AM
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.