Status: Closed (View Workflow)
In GTID mode, we should not update the master.info file after every
Such update is pointless (we will delete the relay logs in any case at next
slave start), and decreases performance. But the more serious issue is that if
we crash during such update, we might end up with a partially written, and
thus corrupt, state. This could in the worst case prevent slave restart
(eg. if using_gtid flag got cleared), and thus breaks crash-safe slave promises.
In addition, when we do write master.info, it could happen that the file gets
shorter. In this case we need to make sure we do not leave old junk at the end
of the file. Probably best is to just leave an end marker, beyond which no more
data is valid.