'How could binlog of mysql and redo log of innodb stay consistent?

I am reading the internals of MySQL. And I have a question about the 2 logs of MySQL: redo log and binlog.

If one transaction commit triggers 2 kinds of logs, and one log is in MySQL level and the other is in the engine level, how could MySQL guarantee that 2 logs are consistent and logged together?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source