Hi Monty, Michael Widenius <michael.widenius@gmail.com> writes:
Two suggestions to make it easier for the DBAs to know how to handle this:
1. How about emitting a note or warning in the error log, if purge from --log-expire-days=N gets delayed for more than 2*N because no slaves are connected and --slave-connections-needed-for-purge=1 ?
Unfortunately I do not think many persons are reading the logs. I hope that having this in release logs (under behavior changes) will be enough for people to notice this change. If not, I will add the warning.
Ok.
Is this needed? If so, would it be better to put this in a general my.cnf for the entire binlog_encryption suite, like you did for mysql-test/suite/binlog/my.cnf ? So that a similar .opt will not need to be added manually for each new binlog_encryption test that will need it.
In binlog tests there are a LOT of tests that checks binlog files. So there it is needed. In binlog_encryption it was only this single test that checked binlog rotation. As this is only one test, better to just disable the option in that one test.
Ok, that's fine, not a big thing.
I think you will need --source include/wait_for_binlog_checkpoint.inc after each of these FLUSH LOGS. Otherwise random delay of binlog checkpoint could cause the binlog_disk_use value to fluctuate and get rare random test failures.
Anyway, this is academic as the test is using MyISAM tables and there can not be any random checkpoints initiated by the storage engine.
Right, I missed that. I guess comes from fixing so many parallel replication test cases, starting to forget that not everything is InnoDB ;-).
Here is what happens.
<snip>
In other words, as part of rotate, the purge of the binary logs will be after the next write.
Thanks for the explanation. Good to know why this happens. The behaviour is fine, and normally it's not relevant, since --max-binlog-total-size will be much larger than a single binlog file.
Wonder how to do that easily. We have 'show binary logs', but how to sum a column over all rows?
For now, I have replaced the last show_binary_logs.inc with 'show binary logs', which allow us to get the binary logs in the output, which makes it trivial to check that binlog_disk_use is correct.
I was thinking of a small --perl section that did a stat() on each binlog file. But I think your way is fine as well.
Maybe this if (is_relay_log || !binlog_space_limit) could be an assert?
Should be fixed when we introduce MYSQL_RELAY_LOG.
Agree. - Kristian.