Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary logs has been overwritten in storage after switchover #1636

Open
catalogoanatom opened this issue Feb 2, 2024 · 1 comment
Open
Labels
mysql MySQL issue

Comments

@catalogoanatom
Copy link

MySQL

Binary logs has been overwritten in storage after switchover

After switchover (swap master and replica) binary logs overwritting binlogs in storage

Please provide steps to reproduce

We have master and replica. wal-g binlog-push binlog script works on the master.
So we have base backups and some binary logs set, for ex:

binlog-00001
binlog-00002
binlog-00003
binlog-00004
binlog-00005
binlog-00006

At this time we are doing switchover. New master (old replica) has only one binary log file:

binlog-00001

After first wal-g push it will overwrite binlog-00001 and all old binary logs in storage

How we can resolve this issue, to have continuous chain of binary logs for PITR from base backup?

@ostinru
Copy link
Contributor

ostinru commented Feb 2, 2024

Hi @catalogoanatom ! I don't have configured MySQL nearby. But I used to use '%hostname%-bin-00001' file names. This will prevent binlog overrides. It seems that it is enough to set log_bin_basename to empty string.

https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html#sysvar_log_bin_basename

@ostinru ostinru added the mysql MySQL issue label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mysql MySQL issue
Projects
None yet
Development

No branches or pull requests

2 participants