On 1/31/11 7:42 PM -0800 Frank Cusack wrote:
On 1/31/11 9:27 PM -0600 Stan Hoeppner wrote:
Frank Cusack put forth on 1/31/2011 3:13 PM:
On 1/30/11 5:07 PM -0600 Stan Hoeppner wrote:
To be clear, for any subscribers who haven't followed all of the various filesystem and data security threads, with any modern *nix system, you WILL lose data when power fails.
No, you won't, at least not necessarily.
I know I'm replying with just about the same content multiple times but there are multiple messages where you are spreading this misinformation.
It is possible to configure a file system to not suffer from data loss on power loss, and for mail stores that is generally the desired behavior.
Maybe not every time, but it should surely motivate OPs to look at their power continuity solution(s).
Even using fsync et al, you can still lose data with power loss. It all depends on what is in flight where, on which bus or cable, and whether the pulses made it to the platters. fsync is a best effort. It can't guarantee all the hardware was able to play its part correctly before the electrons stopped flowing to the disk head actuator or spindle motor.
This is common sense. Anyone with the slightest knowledge of electricity and background in electronics, and working with computers for any amount of time, should realize this.
There is no 100% guarantee. This is one reason why the massive power backup industry exists. The other is obviously avoiding downtime.
Sigh. On that type of failure, fsync() doesn't return to the caller and the data is still elsewhere, queued for retransmission. Nothing is lost.
I should add, it is common these days to have disks that lie about data making it to the platter. Most disks are tunable that way (writeback cache) and some even horrendously come with that as the default. zfs accounts for this and DTRT in all cases.