[mythtv-users] backend storage performance needs?

Simon Hobson linux at thehobsons.co.uk
Wed May 20 19:17:21 UTC 2020


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 :-(

Simon



More information about the mythtv-users mailing list