[erlang-questions] mnesia sync_transactions not fsynced?

Matthew Sackman matthew@REDACTED
Thu Oct 27 14:30:00 CEST 2011


On Thu, Oct 27, 2011 at 02:17:07PM +0200, Håkan Mattsson wrote:
> A call to disk_log:sync would increase the probability for the committed data to
> be stored on durable media, but there is no guarantee. The data may still be
> lost in case of a hard reboot or a power failure. Write caches are evil in this
> regard.

Yes, but you can turn off disk write caches with other tools. People who
actually care about the data getting to disk when it's claimed it's been
written to disk are very likely to understand the performance
implications of that. Mnesia currently prevents any such configuration.
Ideally, there should be a mechanism whereby mnesia could be configured,
maybe even on a txn-by-txn case as to whether you really want it to hit
disk.

Just out of interest, given this behaviour, what is the point of
mnesia:sync_transation, as it does not actually sync to disk? In rabbit
we use it so to guarantee that dirty_reads on other nodes are guaranteed
to observe the new values after the sync_transaction returns, but is
this the only purpose?


Matthew



More information about the erlang-questions mailing list