1

We have a request to enable binlogs on an Aurora MySQL instance and to keep those logs around for a certain amount of time. To test, we enabled binlogging with binlog_format=ROW and set our retention time to 1 hour.

call mysql.rds_set_configuration('binlog retention hours', 1);

However, we are seeing inconsistent behavior when we reboot the instance. A new binlog gets created and the old one sometimes drops after only a couple of minutes. It was my understanding that setting the retention hours would keep the old file(s) around for an hour.

There is also the global config expire_logs_days=0, would that affect keeping the old file(s) around?

1 Answer 1

0

If writes to the RDS Instance had not occurred for over an hour, all binlogs whose timestamp is older than an hour must disappear after mysqld starts up in the RDS Instance.

If you want the binlogs to stay longer, raise the retention hours to 4 (or higher)

call mysql.rds_set_configuration('binlog retention hours', 4);

just before reboot.

Don't lower it right away after the reboot. Otherwise, those binlogs whose timestamp is older than an hour would disappear just the same.

1
  • Thanks, I think that makes sense - it's the timestamp of the last loggable event that determines when the old binlog(s) are released.
    – Nate H
    Commented Aug 18, 2021 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.