
Kristian Nielsen via developers <developers@lists.mariadb.org> writes:
2. Integration with mariabackup. With the new binlog, mariabackup can backup the binlog together with the rest of the InnoDB data in a consistent way, something that I think is not possible currently?
An idea is to use the fact that binlog files are strictly append-only. Around the point where mariabackup decides the LSN where it stops copying the redo log that becomes the backup snapshot, we can determine the last binlog file that exists. We will check this just before and just after determining the LSN, and repeat if a new binlog file was created just at that point (which would otherwise leave doubt if the file was created before or after that LSN).
Then after the snapshot LSN is determined, we can just copy all the binlog files up to and including (but not after) the snapshot point. This way
I implemented a simpler version of this. There is no need to keep track of binlog creation around the point where the backup snapshot LSN is decided. Instead, I just check the start_lsn value in the header of each binlog file before copying them, and skip any that were created after the backup LSN. The code is in the branch knielsen_binlog_in_engine now, along with a couple test cases. - Kristian.