Newsletters older than 6 months may have links that are out of date. Please use the Search to check for updated links.
Is there any way to ensure, that when data is written, it is also really written to disk? I.e. I can sure data in memory and disk are in sync.
This is a question about usage of sync(). MySQL does all OS call pertaining to writting data to disk. The only thing missing is sync()-ing, which we do not do as it would make things very slow. Sync-ing may take long time. So, MySQL actually writes all data to OS, and it is a feature of "lazy writes" that some OS's exhibit that prohibits immediate writing to disk.
On Windows we have --flush-time option, which creates a separate thread which flushes everything to disk at the interval that is passed as the argument. This means MySQL is flushing data with some commands, plus when some other conditions are met. Value 0 means, that there is no separate thread, that is dealing with flushing.
So if you want to ensure, that data is really written from memory to disk, you need to check, how your OS in use handles the OS data writes.
Does it do the "lazy writes" or does it do immediate writes.