Friday, September 9, 2016

mysql - Data consistency with RAID 5 and BBWC



I have a few questions about RAID 5, BBWC (Battery Backed Write Cache), filesystem (ext3) and optionally mysql.



I have a hypothesis and I ask community to validate or not this one:




  • The system is UP, applications works with database and use transactions

  • The RAID system is configured with RAID5, write caching and battery (BBWC)




With this solution, when OS receive write ACK, data are possibly in the RAID controller cache, and not in a persistent memory (my RAID drives disk).



If a power failure appears and data are in the RAID controller cache, the BBWC maintains data with the battery pack. Until then, everything is good.



But battery has a certain capacity, and it’s not infinite. If the power failure is longer than two or three days, the RAID cache is lost.



For me it’s a dramatic and likely scenario.



My questions are:





  • Can ext3 solve this problem? Probably not

  • Is it possible to corrupt mysql database?

  • Mysql transactions are lost? I think so



Hardware: HP DL380 G7



OS: Centos 5 with ext3



Answer



Yes, that is the limitation of a battery-backed write cache -- that if the battery runs out, your unwritten data is toast. It's why I prefer the newer NVRAM-based RAID controllers. Filesystems can't help you, because they think the data's been written -- at best they can provide a consistent view of the data, not ensure it's up-to-date.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...