The Linux kernel Adventures of the MD source code interpretation of the XV bitmap principle

Source: Internet
Author: User

The Linux kernel Adventures of the MD source code interpretation of the XV bitmap principle Reprint Please specify Source: Http://blog.csdn.net/liumangxiong
For people do not know Chenjinna, all over the lake also in vain. Do raid do not know bitmap, all is a formality. So bitmap is the figure, can be in the raid5 of the scene mixed with wind and wind? Say the earliest RAID5 is no bitmap this menke, suddenly one day run RAID5 system abnormal power down, the customer found abnormal power-down after the data will appear inconsistent information. Check to find RAID5 itself design has a flaw: RAID5 each write at least two disk, the writing process when the abnormal power-down will find a disk write completion and another disk is not written to complete, it will cause the stripe in an inconsistent state, and stripe inconsistency will cause the subsequent write problems. In the absence of bitmap, RAID5 in order to ensure stripe consistency, after the abnormal power-down to do a full-time synchronization. In the case of business flows, this synchronization is less than ten or twenty hours, many days or even one weeks. However, looking back, that is, because of a few bands of inconsistency and caused the overall synchronization, too much. In order to solve this problem, RAID5 introduced bitmap this menke, then how does this menke solve this problem? In fact, it is very simple, every time RAID5 write a record strip for the dirty, when the writing completed when the record strip for clean. In the abnormal power-down, the unfinished strip is set to dirty, after the system restarts only need to synchronize these dirty strips. See here we can not help but applaud, the original need a few days of resynchronization and now a few minutes to be able to fix, and the amount of code changed so little. But things are not as smooth as you might think, if you've heard of Joni Mitchell's <both Sides Now&gt, you'll know that every thing you do is look at the thing from Both side. In Chinese speaking, when the benefits of bitmap, what kind of cost to pay? Of course the optimal state is the cost is zero, but every programmer is too optimistic. First, bitmap needs to occupy a certain amount of disk space, which is of course nothing to the storage system. Second, in each write before you need to record the corresponding bitmap for dirty, more hateful is this write is synchronous, which will directly lead to RAID5 write performance of a sharp decline. So what's a better plan? My idea is another piece of faster storage to store bitmap, such as storing bitmap directly with SSDs. Of course, there are conditions can also be directly used to save bitmap memory, which involves the memory of the power-down protection. Well, no matter what method to save the Bitmap,bitmap principle and implementation will not change.
Reprint Please specify Source: Http://blog.csdn.net/liumangxiong

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.