Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ZFS pool with ssd cache and power-loss recovery
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
zzaappp
Apprentice
Apprentice


Joined: 06 Jun 2003
Posts: 176

PostPosted: Wed Sep 05, 2012 11:25 pm    Post subject: ZFS pool with ssd cache and power-loss recovery Reply with quote

ZFS looks promising. I can stripe a couple of hard disks in a pool, then add an SSD to the pool as the buffer. This makes i/o pretty fast.

Then I started thinking about it.

Supposing I lose power before the SSD has finished committing to the HD's in the pool. What happens when power returns? Is ZFS smart enough to update the HD's from whats left in the SSD cache? Or will it ignore the contents of the SSD's and (more or less) lose the stuff that didn't get committed?

-z
Back to top
View user's profile Send private message
hazza
n00b
n00b


Joined: 30 Dec 2002
Posts: 68
Location: Burton on Trent

PostPosted: Thu Nov 01, 2012 10:47 am    Post subject: Re: ZFS pool with ssd cache and power-loss recovery Reply with quote

zzaappp wrote:
Supposing I lose power before the SSD has finished committing to the HD's in the pool. What happens when power returns?


Any journaled data that has made it into flash will be replayed correctly to the mechanical discs on a system restart.

From testing I've done, there's one scenario in which I lose data when running with an SSD cache disk and sync=standard, and that's when an SSD doesn't honour commits. In theory, if you have a battery-backed SSD, it can safely do so, but if the power outage exceeds the battery life (unlikely) or it's a non-battery-backed SSD that simply ignores commits (unbelievably, some firmware revisions of certain drives can do this!), if there's data in the SSD's DRAM buffer that hasn't been flushed to flash, that's when you get data loss as it's simply not there to be replayed upon restart.

If you're running dual power supplies with at least one of them UPS backed and the filesystem running sync=standard, it's highly unlikely that you'd get a utility power failure, a UPS failure and either a dishonoured commit or SSD supercap failure in the milliseconds-long window where there is unflushed data in SSD cache DRAM.

Hope that helps,
Harry
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum