[CS61C FA20] Lecture 38.6 - Dependability- Parity, ECC, RAID: Redundancy with RAID — Transcript
Full transcript
- 0:04[Music]
- 0:09hello and welcome back to our module on
- 0:12dependability
- 0:14so far we have seen how we can add
- 0:18bit level redundancy to
- 0:21avoid soft errors errors caused by
- 0:24some transient effects like cosmic rays
- 0:28or disturbances in the environment
- 0:34now the question is what do we do when
- 0:36with permanent failures
- 0:38in hardware well
- 0:42this mechanism may not protect us and
- 0:45using some kind of an
- 0:46error correction to protect from
- 0:48transient errors has a very high
- 0:50overhead we generally use spare parts
- 0:54um to say in
- 0:57our hardware that can
- 1:00take over from the failed part
- 1:04this happens in memory chips as well but
- 1:06it is deep inside
- 1:08the actually design of the memory
- 1:12chip so it's not adequate quite for this
- 1:14class but there is a really good example
- 1:16out there
- 1:17in a form of disk drives so
- 1:20this drives traditionally hard disk
- 1:23drives are mechanical devices
- 1:25and they do tend to fail we have seen
- 1:27that this drives
- 1:28have some failure rate of percent or two
- 1:32per year uh nowadays
- 1:36there may be valuable latest data stored
- 1:38on these drives
- 1:41generally there are backups but there is
- 1:44a
- 1:45fairly high cost of bringing back
- 1:48the backup from to restore the operation
- 1:53after a drive fails
- 1:56so generally there is a great idea
- 1:58developed at berkeley
- 2:00by randy katz and dave patterson
- 2:04in trying to provide
- 2:08redundancy that is going to help with
- 2:10failing disks
- 2:12it is called the raid which stands for
- 2:14redundant arrays
- 2:16of inexpensive disks this is
- 2:19inexpensive is in there fits well
- 2:23it applies to any disk whether it's
- 2:25expensive or not
- 2:30the idea was actually deployed
- 2:33as an alternative to really expensive
- 2:36you know highly reliability disks
- 2:38that can be replaced with an array of
- 2:40relatively
- 2:41cheap off-the-shelf disks
- 2:44so uh our data then will not be stored
- 2:48in just one disk it'll
- 2:49be stored across multiple disks and
- 2:53um one of the things or one of the
- 2:56concepts that are typically used in
- 2:58in storage arrays is that the files are
- 3:00striped across
- 3:01multiple disks what does that mean so if
- 3:03you have a big file
- 3:05instead of writing everything to one
- 3:06disk we're going to break it up into
- 3:09chunks and write it as a stripe across
- 3:11multiple
- 3:12disks remember disks are slow so
- 3:15if we can just write pieces of files to
- 3:18multiple disks in
- 3:20parallel we can speed up our operation
- 3:24so redundancy here can be used
- 3:27to speed up the disk operation but it is
- 3:30also there to prevent
- 3:32from the slowdowns
- 3:36disruptions in service if there is a
- 3:39failure
- 3:40so it improves our availability
- 3:44so the disk will still fail and the
- 3:47contents
- 3:48of the user files are still going to be
- 3:51reconstructed
- 3:52from the remaining disks in the array
- 3:55of course there is an overhead we are
- 3:57not using all the disks to store
- 4:00different users data we are using some
- 4:03of the disks
- 4:04as a source of redundancy so let's like
- 4:08take a look
- 4:09at a few traditional ways how this
- 4:12concept of raid
- 4:14of redundant array of inexpensive disks
- 4:17have been used
- 4:20there are different levels of raid raid
- 4:220 doesn't provide any redundancy we're
- 4:24not going
- 4:25not going to talk about that it is there
- 4:27just to speed up
- 4:28by providing striping
- 4:32raid 1 is the first form of the
- 4:34redundant
- 4:35dist array so essentially what we have
- 4:38there
- 4:39is that we keep
- 4:43two groups of disks as
- 4:46many as we have primary disks that's how
- 4:49many
- 4:51backups we have these are called
- 4:53recovery groups and essentially
- 4:55each of a disk in the simplest case we
- 4:58will just have one disk here
- 5:00and one in the other group we will be
- 5:03mirroring the data
- 5:04from one disk to another
- 5:08simply we have two copies of our data
- 5:11and that provides redundancy
- 5:16um there are no
- 5:19real speed tradeoffs or advantage or
- 5:22disadvantages here
- 5:24it i mean there are some slight um
- 5:26trade-offs that happen
- 5:28when these this are not equal when other
- 5:31one of them
- 5:32or some of them are slower than the
- 5:33others well they may be limiting the
- 5:35speed
- 5:36um and um
- 5:40but we don't really need to dive into
- 5:42that for now
- 5:44the the point here is that
- 5:47the these raid
- 5:501 arrays are expensive we have 100
- 5:54overhead for every disk that we need we
- 5:57provide
- 5:57one additional disk as a backup but
- 6:01we have seen that we really don't need
- 6:02to do that in
- 6:05in dram error correction codes so can we
- 6:09use the same
- 6:10or a similar concept to provide
- 6:12redundancy
- 6:13in disks so of course we do
- 6:16uh that's the concept of ray 3 where we
- 6:19add
- 6:20the parity so here is how it goes
- 6:24we can have a few disks and then we
- 6:27would add a parity disk to that
- 6:30our data is going to be stored in these
- 6:32disks
- 6:34and you can envision it for now as
- 6:37you know single bit data although this
- 6:39this would be pair it in the form of
- 6:42words in ray 3 and
- 6:45we are going to stripe our file across
- 6:48multiple disks
- 6:51so we are going to save our date and if
- 6:54we are stripping as a single bits
- 6:56it's more closer to like a raid 2 level
- 6:59but in raid 3 we can
- 7:00imagine that these are these bits are
- 7:02just representatives of words
- 7:04and then we'll be providing parity in
- 7:07a separate disk this parity
- 7:11here is computed in the same way how we
- 7:14have done
- 7:14uh in the past if we have
- 7:17an even number of bits in the world
- 7:21then the parity bit is zero just
- 7:24basically
- 7:25maintains even parity there so
- 7:30if a disk fails then
- 7:33the parity is going to replace it
- 7:38but we remember in in dram we
- 7:42couldn't actually do that our parity did
- 7:45not provide
- 7:46enough information to know where the
- 7:49error came from well
- 7:50we here actually know what uh where the
- 7:52error came from
- 7:54um we'd know that the disk failed we
- 7:56would have this
- 7:57additional information that one of the
- 7:59disk has failed and we know which disk
- 8:01has failed so these parity bits
- 8:05are there to recover the information
- 8:08that is missing
- 8:09so by knowing that this bit is zero this
- 8:12bit is one
- 8:13and this one is zero we'll know that the
- 8:14missing bit is also zero
- 8:18all right so that was raid three raid
- 8:21four is a variant of that um
- 8:24it just provides higher input output
- 8:28rate
- 8:30so here is uh how it looks like so
- 8:34this is how we can view an array of five
- 8:36disks so there are
- 8:37four disks that hold user data and the
- 8:40fifth
- 8:41disk holds parity and you can see
- 8:44that these these are perhaps increasing
- 8:48uh logical disk addresses so these are
- 8:50different
- 8:51um sectors um in the disk
- 8:55so um you can view it as insides of the
- 8:58five
- 8:59disks that are spinning
- 9:02now um raid 4 supports
- 9:07higher rate i o and what does that mean
- 9:10for example you would like to
- 9:11do a read of small files from disks 0
- 9:15and this 5 so
- 9:16you know the file basically fits in one
- 9:19disk so
- 9:20we can essentially read them
- 9:21concurrently from
- 9:23disks 0 and 5 at the same time
- 9:29and for a large
- 9:32disk for a large write we can speed it
- 9:36up
- 9:36by striping across all of the disks
- 9:41okay it does
- 9:45have one of the the the challenges
- 9:49of raid 4 is the fact
- 9:52that all the parity resides on one disk
- 9:56so if you're trying to write a bunch of
- 9:58small files
- 10:00that's going to be the bottleneck let's
- 10:01take a quick look at that
- 10:03so here is our inspiration for raid5 if
- 10:06we are writing
- 10:08two small files d0 and d5
- 10:11we have to generate parity for each
- 10:17those two rights are going to
- 10:21happen concurrently
- 10:25and now the question is how do we
- 10:27generate the parity
- 10:29um in order to generate the parity we'll
- 10:32need
- 10:33to know all the other data that forms
- 10:36that parity so we'll need to read all
- 10:38the other disks so
- 10:39possibly we can go ahead and read them
- 10:42and
- 10:43then repopulate the parity or the other
- 10:45way which is usually what is actually
- 10:46being done
- 10:47uh in in raid controllers um
- 10:50our parity disk has the old sum so we
- 10:54can
- 10:54perhaps just recalculate your read that
- 10:57parity
- 10:58updated with this data and write it back
- 11:02it's a straight linear algebra there
- 11:07in either case the bottleneck here for
- 11:10eight five
- 11:11is that all the parity is being written
- 11:15to this disk so we need to perhaps
- 11:19read the parity data update it
- 11:22and write it back and do that for
- 11:23multiple files concurrently so generally
- 11:26that disk is going to be
- 11:28the bottleneck
- 11:33then comes
- 11:36the motivation for raid 5. raid 5
- 11:39is a way to improve the trumpet and
- 11:42maintain the parity and the way how
- 11:44it is being done is by simply
- 11:47distributing parity across
- 11:49interleaving parity across the entire
- 11:51array
- 11:52so not the parity is not going to be
- 11:55just on
- 11:56our fifth drive it is going to be spread
- 11:58over all
- 11:59of the drives so if we are writing
- 12:02to this d0 and d5
- 12:06over here would be writing on these two
- 12:09separate disks and we can do that
- 12:10concurrently
- 12:12and since their parity checks are
- 12:14associated with disks three and four
- 12:17we can do that we can proceed with that
- 12:20concurrently as well
- 12:23okay that's essentially
- 12:27um raid in a nutshell there are
- 12:28different other types of raid that
- 12:31generally employ a couple of more a few
- 12:34extra desks
- 12:36but we are not going to cover them in
- 12:38this course
- 12:41so in conclusion we have seen how
- 12:44does redundancy improve our
- 12:47dependability
- 12:49we can use that by using spatial
- 12:52redundancy by
- 12:53employing extra hardware extra hardware
- 12:56in the form of extra bits
- 12:57extra checks
- 13:01or by using temporal uh
- 13:07redundancy by repeating the operation if
- 13:10it fails the first time
- 13:12we have seen the definitions of
- 13:13reliability and availability
- 13:15and we have seen a specific example how
- 13:18we use
- 13:20parity for single error detection and
- 13:23then we have seen how we can employ
- 13:25hamming codes with a distance of 3 to
- 13:30perform singular correction and
- 13:36with an additional bit perform uh
- 13:39double error detection and then we have
- 13:43seen
- 13:43that raid arrays are the way uh
- 13:47to handle failing disk drives
- 13:51it's an example how does extra hardware
- 13:55extra disks redundancy
- 13:58improve the availability of a system if
- 14:01the disk drive fails
- 14:03our system does not crash and its
- 14:05performance actually
- 14:07is the system's performance is improved
- 14:09it is not
- 14:10degraded by using multiple
- 14:13drives you have seen that there are
- 14:15different trade levels
- 14:17there are more of them out there in
- 14:18practice but
- 14:20we get a reasonable good understanding
- 14:23of
- 14:24how they work anyway that's it
- 14:27this is all what you wanted to cover
- 14:29with respect
- 14:31to dependability and that wraps up this
- 14:34module
- 14:36see you later
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 38.6 - Dependability- Parity, ECC, RAID: Redundancy with RAID by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,843 words across 339 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.