CS 457/557, assignment 2
Due Friday, 26 January, 2018
RAID recovery
After a power failure, there is a recovery process that we shal study in
Chapter 17. During this process, any recently written block will need to be re-read, and probably modified. It can happen that
one such block was only half written, so neither the old nor new version
can be read.
Assuming there are 5 RAID disks, restore this block (the first 10 bits)
from the other 4:
1 1 1 1 1 0 0 0 0 0
1 1 0 0 1 1 0 0 1 0
1 0 1 0 1 0 1 0 1 1
1 1 1 0 0 0 1 1 0 1
new:
Record and Block layout
Similar to (but not)
Exercise
13.5.1 (p. 593), "dereferenced"
Suppose a fixed-length record has the following fields in this
order:
- A real of 8 bytes,
- A character string of length 17, [ char(17) or
varchar(16) ]
- A single byte, and
- an SQL date (stored as characters, for example 2018-01-26 ).
Each record also has a record header, consisting of two 4-byte
pointers and a character.
1. Calculate the record length
of such a record for these 2 situations regarding field alignment:
- Fields can start an any byte
- Fields must start at a byte that is a multiple of 4
2. How many records can we
fit in a block 16,384 bytes
long (16K bytes), for each field alignment (a. & b.),
where there is also a block header consisting of three
8-byte integers.
- Record length as in 1. a.
- Record length as in 1. b.
Submit on paper, or see How to submit in Assignment 1.
Lin Jensen. Back to course