|
In the group chat, a group of friends said, MySQL Library main library production downtime, but consistent master data from the database, but the logs from the library than the main library, it is not understood!
After consultation found that the production of the main library database is not set sync_binlog = 1, but for sync_binlog = 0
Therefore, when writing data to the main library, the transaction has been submitted, but the data in the binlog cache, no write to the disk, and the data has been synchronized to the library, at the moment the main library down, binlog cache data loss, resulting from library logs than the main library.
Group of friends from the master after reconfiguration and sync_binlog set to 1
sync_binlog importance and significance:
sync_binlog = n, n times after each transaction commits, MySQL will conduct a fsync like disk synchronization instruction to the data binlog_cache the mandatory written to disk.
In MySQL, the default setting is sync_binlog = 0, that is, without any mandatory disks refresh command, this time the performance is the best, but the risk is greatest. Because once the system Crash, all binlog information will be lost in the binlog_cache. |
|
|
|