[mythtv-users] backend storage performance needs?

Stephen Worthington stephen_agent at jsw.gen.nz
Thu May 21 03:11:37 UTC 2020


On Wed, 20 May 2020 20:17:21 +0100, you wrote:

>Stephen Worthington <stephen_agent at jsw.gen.nz> wrote:
>
>> You are thinking about a different cache.  The RAM cache on a hard
>> drive is not software controllable.  The firmware on the drive uses it
>> according to the drive's algorithms.  The cache you are thinking of is
>> a software one in the PC's RAM.  The hard drive cache is used for
>> things like an "elevator" algorithm.
>
>I was wondering about that - and the inherent reliability problems it introduces.
>
>> This is dramatically more efficient than a
>> first in first out queue, but does have the downside that a power
>> failure with lots of data left in the cache can cause a lot of damage.
>> But good drives can often manage to write everything in the cache to
>> disk in a reserved journal area between the time they lose power and
>> when they have to retract the heads to prevent them being damaged as
>> the platters spin down.
>
>There's a few ifs and maybes in that little bit of text.
>
>Logically, if the host tells the drive "write this and tell me when it's written" then I'd expect the data to be written to the platter before the drive signals that it's been written. If not, then it completely fubars anything the OS does - such as writing file data, FS data, and journal data, in a specific order to ensure data integrity no matter when the failure occurs. It's no good if the disk re-orders your writes !
>
>So I'd assumed that when an fsync was performed, that would to all effects override (or at least significantly reduce the effectiveness of) the drives re-ordering as it's been told to flush those blocks "now".
>
>Even assuming everything works all hunky dory - I would not trust my data integrity to "some drives will manage to save the cache some of the time" which is what "good drives can often manage to write everything in the cache to disk in a reserved journal area between the time they lose power and" effectively says. I understand what you are saying, but really a drive should not be caching anything it cannot guarantee to save no matter how sudden or otherwise the power loss may be. Anything else is just pulling the pin on your data loss grenade and hoping the drive keeps a good hold of it !
>
>But as it's been a while since I used to follow the in depth technical stuff in this area, I could be spouting rubbish :-(

And I was deliberately using weasel words as I have not been following
drive technology well enough to know for sure that drives will
guarantee being able to write their cache to journal space before
losing the power to do that.  But that certainly seems to be what they
are aiming for.  And I do not know at all whether drives receive and
act on fsync, or whether they choose to ignore that signal and keep on
doing their own caching.  Or maybe they have an option you can set to
tell them which way to do things.  Enterprise drives are more
configurable than desktop drives.

>Simon


More information about the mythtv-users mailing list