Consider a scenario, where you have a MySQL master and slave server in replication. As we know, binary log enabled on the master and the slave reads from the binary log of the master. From MySQL documentation I understand that, only the fully committed transaction will be written to binary log, so there is no chance of missing any transaction in replication (if everything works well). So my assumption is that, once the transaction is completed and written to tablespace, it will be written to binary log.
My doubt is whether the write operation of the binary log is concurrent or sequential? It means, for example, before writing to binary log and after written to tablespace, if the server shuts down or crashed, what happen to the transactions which happened in mean time?
Also, I am using mysqlbinlog
utility and set with stop-never
parameter. I need to know, when stop-never
enabled the binary log will be in sync on the destination server (I tested it with flush logs - it creates new log on destination too),
- How the copying of binary log works?
- Is it first writes to master binary log and copied to destination log?
- Is it writing on both the source and destination binary log simultaneously?
- What will be impact of MySQL performance and disk IO performance?
If I misunderstood the concept, kindly correct me. Thanks in advance.