Video
Đăng bởi Quản trị viên OpenER ·
Tác giả giữ toàn bộ bản quyền (All Rights Reserved) — không phải giấy phép mở. Bạn vẫn xem và học miễn phí trên OpenER; muốn tái sử dụng cần xin phép tác giả.
[MUSIC PLAYING] PROFESSOR: Hello, and welcome back to our module on dependability.
So far, we have seen how we can add bit-level redundancy to avoid soft errors — errors caused by some transient defects like cosmic rays or disturbances in the environment.
Now, the question is, what do we do with permanent failures in hardware? Well, this mechanism may not protect us.
And using some kind of an error correction to protect from transient errors has a very high overhead.
We generally use spare parts, to say, in our hardware that can take over from the failed part.
This happens in memory chips, as well, but it is deep inside the actually design of the memory chip, so it's not adequate for this class.
But there is a really good example out there in the form of disk drives. So disk drives, traditionally, hard disk drives are mechanical devices, and they do tend to fail.
We have seen that disk drives have some failure rate of a percent or two per year nowadays. There may be valuable data stored on these drives.
Generally, there are backups. But there is a fairly high cost of bringing back the backup to restore the operation after a drive fails.
So generally, there is a great idea developed at Berkeley by Randy Katz and Dave Patterson in trying to provide redundancy that is going to help with failing disks.
It is called the RAID, which stands for Redundant Arrays of Inexpensive Disks. This inexpensive is in there — fits well. It applies to any disk, whether it's expensive or not.
The idea was actually deployed as an alternative to really expensive, high-reliability disks that can be replaced with an array of relatively cheap, off-the-shelf disks.
So our data, then, will not be stored in just one disk. It'll be stored across multiple disks.
And one of the things, one of the concepts that are typically used in storage arrays is that the files are striped across multiple disks. What does that mean?
So if you have a big file, instead of writing everything to one disk, we are going to break it up into chunks and write it as a stripe across multiple disks.
Remember, disks are slow. So if we can just write pieces of files to multiple disks in parallel, we can speed up our operation.
So redundancy here can be used to speed up the disk operation, but it is also there to prevent from the slowdown, so disruption in service, and if there is a failure.
So it improves our reliability.
So the disk will still fail, and the contents of the user files are still going to be reconstructed from the remaining disks in the array. Of course, there is an overhead.
We are not using all the disks to store different users' data. We are using some of the disks as a source of redundancy.
So let's take a lo at a few traditional ways how this concept of RAID — of Redundant Array of Inexpensive Disks — have been used.
There are different levels of RAID. RAID 0 doesn't provide any redundancy. We're not going to talk about that. It is there just to speed up by providing striping.
RAID 1 is the first form of the redundant disk array. So essentially, what we have there is that we keep two groups of disks.
As many as we have primary disks, that's how many backups we have.
These are called recovery groups, and essentially each of a disk in the simplest case, we will just have one disk here and one in the other group will be mirroring the data from one disk to another.
We simply have two copies of our data, and that provides redundancy.
There are no real speed trade-offs or advantage or disadvantages here.
I mean, there are some slight trade-offs that happen when these disks are not equal — when 1 or one of them or some of them are slower than the others, well, they may be limiting the speed.
But we don't really need to dive into that for now. The point here is that these RAID 1 arrays are expensive.
We have 100% overhead. For every disk that we need, we provide one additional disk as a backup.
But we have seen that we really don't need to do that in DRAM error correction codes.
So can we use the same or a similar concept to provide redundancy in disks? So of course, we do. That's the concept of RAID 3 where we add the parity.
So here is how it goes. We can have a few disks, and then we would add a parity disk to that. Our data is going to be stored in these disks.
And you can envision it, for now, as single bit data, although this would be parity in the form of words in RAID 3. And we are going to stripe our file across multiple disks.
So we are going to save our data, and — if we are striping as a single bit, it's more closer to a RAID 2 level, but in RAID 3, we can imagine that these bits are just representatives of words.
And then, we will be providing parity in a separate disk. This parity, here, is computed in the same way how we have done in the past.
If we have an even number of bits in the word, then the parity bit is 0. Just basically maintains even parity there.
So if a disk fails, then the parity is going to replace it.
But remember, in DRAM, we couldn't actually do that. Our parity did not provide enough information to know where the error came from.
Well, we here actually know where the error came from. We know that the disk failed.
We would have this additional information that one of the disks has failed, and we know which disk has failed. So these parity bits are there to recover the information that is missing.
So by knowing that this bit is 0, this bit is 1, and this one is 0, we'll know that the missing bit is also 0. All right so that was RAID 3.
RAID 4 is a variant of that. It just provides higher input to output rate. So here is how it looks like.
So this is how we can view an array of five disks. So there are four disks that hold user data, and the fifth disk holds parity.
We can see that these are perhaps in increasing logical disk addresses. So these are different sectors in the disk.
So you can view it as insides of the five disks that are spinning. Now, RAID 4 supports higher rate IO.
And what does that mean? For example, you would like to do read the small files from disk 0 and disk 5, so the file basically fits in one disk.
So we can essentially read them concurrently from disks 0 and 5 at the same time.
And for a large disk, for a large write, we can speed it up by striping across all of the disks.
Okay, it does have one of the challenges of RAID 4 is the fact that all the parity resides on one disk.
So if you're trying to write a bunch of small files, that's going to be the bottleneck. Let's take a quick look at that. So here is our inspiration for RAID 5.
If we are writing two small files, D0 and D5, we have to generate parity for each.
Those two writes are going to happen concurrently. And now the question is, how do we generate the parity?
In order to generate the parity, we'll need to know all the other data that forms that very disk. So we'll need to read all the other disks.
So possibly we can go ahead and read them and then repopulate the parity.
Or the other way, which is usually what is actually being done in RAID controllers — our parity disk has the old sum, so we can perhaps just recalculate — read that parity, update it with this data, and write it back.
It's a straight linear algebra, there.
In either case, the bottleneck here for RAID 5 is that all the parity is being written to this disk.
So we need to perhaps read the parity data, update it, and write it back and do that for multiple files concurrently. So generally, that disk is going to be the bottleneck.
Then comes the motivation for RAID 5. RAID 5 is a way to improve the throughput and maintain the parity.
And the way how it is being done is by simply distributing parity across interleaving parity across the entire array. So the parity is not going to be just on our fifth drive.
It is going to be spread over all of the drives. So if we are writing to disks D0 and D5, over here, would be writing on these two separate disks.
And we can do that concurrently. And since their parity checks are associated with disks 3 and 4, we can do that. We can proceed with that concurrently, as well.
Okay, that's essentially RAID in a nutshell. There are different other types of RAID that generally employ a couple more — a few extra disks.
But you are not going to cover them in this course. So in conclusion, we have seen, how does redundancy improve our dependability?
We can use that by using spatial redundancy, by employing extra hardware — extra hardware in the form of extra bits, extra checks — or by using temporal redundancy, by repeating the operation
if it fails the first time. We have seen definitions of reliability and availability, and we have seen a specific example how we use parity for single-error detection.
And then we have seen how we can employ hamming codes with a distance of 3 to perform single-error correction and, with an additional bit, perform double-error detection.
And then we have seen that RAID arrays are the way to handle failing disk drives. It's an example.
How does extra hardware, extra disks, redundancy improve the availability of a system? If the disk drive fails, our system does not crash.
And its performance actually is — the system's performance is improved. It is not be degraded by using multiple drives. You have seen that there are different RAID levels.
That are more of them out there in practice, but we got a reasonable, good understanding of how they work. Anyway, that's it.
This is all we're going to cover with respect to dependability, and that wraps up this module. See you later.
Đăng nhập để đánh giá học liệu này.
Đăng nhập để bình luận — chưa ai bình luận về học liệu này.
Không có khóa học liên quan.