Method and system for reconstructing data serially arranged on a magnetic tape track

A RAID or RAIT type data storage array such as a single tape RAIT includes storage elements storing data blocks and a parity block based on the data blocks. The array reads the data blocks sequentially from respective storage devices. The array determines if any of the data blocks are bad as the data blocks are being read. The array accumulates the parity of good data blocks as the data blocks are being read. A bad data block is reconstructed from the accumulated parity of the good data blocks and the parity block.

TECHNICAL FIELD

The present invention relates generally to redundant array of inexpensive disks (RAID) methods and systems and, more particularly, to a data storage array method and system which accumulate a running parity of data blocks as the data blocks are read sequentially from respective storage elements such that the data blocks prior to a bad data block do not have to be reread for obtaining the parity information needed to complete the reconstruction of the bad data block.

BACKGROUND ART

A data storage array is a collection of storage elements that are accessible by a host computer as a single storage unit. The individual storage elements can be any type, or a combination of types, of storage devices such as, hard disk drives, semiconductor memory, optical disks, magnetic tape drives, and the like. The individual storage elements may also be a track in a single magnetic tape.

A data storage array includes a collection of storage elements and a controller. The controller controls the operation of the storage elements and presents them as a single storage unit to a host computer. The host computer typically executes an operating system and application programs. A virtual storage element is an abstract entity realized by the controller and the data storage elements. A virtual storage element is functionally identical to a single physical storage element from the standpoint of the host computer.

One such data storage arrays is a redundant array of independent disks (RAID) or tapes (RAIT). RAID comes in various operating levels which range from RAID level 0 (RAID-0) to RAID level 6 (RAID-6). Additionally, there are multiple combinations of the various RAID levels that form hybrid RAID levels such as RAID-5+, RAID-6+, RAID-10, RAID-53 and so on. Each RAID level represents a different form of data management and data storage within the RAID disk array.

In a RAID-4 array, data is generally mapped to the various physical storage elements in data “stripes” across the storage elements and vertically in a “block” within a single storage element. To facilitate data storage, a serial data stream is partitioned into data blocks. Each data block is stored on a different storage element as the data blocks are striped across the storage elements. Once all the storage elements in a data stripe have been given data blocks, the storage process returns to the first storage element in the data stripe, and stripes data blocks across all the storage elements again.

In a RAID-4 array, data consistency and redundancy is assured using parity data that is striped to one of the storage elements. Specifically, a RAID-4 array contains N−1 data storage elements and a parity storage element. Each data stripe contains N−1 data blocks and one parity block. N−1 data blocks are striped to respective N−1 data storage elements and a parity block is striped to the parity storage element. The process then continues for the next data stripe.

RAID-4 parity is generated using an exclusive OR (XOR) function. In general, parity data is generated by taking an XOR function of the data blocks within a given data stripe. Using the parity information, the contents of any block on any single one of the storage elements in the array can be regenerated from the contents of the corresponding blocks on the remaining storage elements in the array. Consequently, if the XOR of all corresponding blocks in the data stripe, except one is computed, the result is the remaining block. Thus, if data storage element one in the storage element array should fail, for example, the data block it contains can still be delivered to applications by reading corresponding blocks (data and parity) from all the surviving storage elements and computing the XOR of their contents. As such, the RAID-4 array is said to be fault tolerant, i.e., the loss of one storage element in the array does not impact data availability.

In a data storage array, the controller accumulates parity as the data blocks are sequentially written from the host computer to the storage elements. When all of the data blocks in a data stripe have been written to respective data storage elements, the controller writes the parity block to the parity storage element. The controller then reinitializes and starts accumulating parity again for the next data stripe to be written to the storage elements. This continues until all of the data blocks have been written to the storage elements.

During normal reading operation, the controller sequentially passes the data blocks to the host computer from the storage elements and discards the parity blocks. If a read error occurs such that a data block is unreadable, the controller returns to the storage element having the first data block in the data stripe and then sequentially rereads the data blocks prior to the bad data block. The controller accumulates parity for the reread data blocks. The controller then skips the bad data block and continues sequentially reading the remaining data blocks and the parity block in the data stripe. The controller then reconstructs the bad data block from three factors. These factors are the parity of the data blocks prior to the bad data block, the data blocks after the bad data block, and the parity block.

A problem with rereading the data blocks prior to the bad data block for reconstructing the bad data block is that this operation is time consuming. What is needed is a data storage array method and system for accumulating the parity of data blocks during sequential reading. Thus, it would not be necessary to reread the data blocks prior to a bad data block as the controller would already have the information (parity of the data blocks already read) needed to complete the reconstruction of the bad data block.

SUMMARY OF THE INVENTION

Accordingly, it is an object of the present invention to provide a data storage array method and system which accumulate parity of blocks as the blocks are sequentially read from respective storage elements such that the blocks prior to a bad data block do not have to be reread for obtaining the parity information needed to complete the reconstruction of the bad data block.

It is another object of the present invention to provide a data storage array method and system in which a controller accumulates a running parity of blocks as the blocks are sequentially read from magnetic tape to obtain the parity information needed to complete the reconstruction of a bad data block.

It is a further object of the present invention to provide a data storage array method and system which accumulate parity of data blocks as the data blocks are sequentially read from respective storage elements such that the data blocks prior to a bad data block do not have to be reread for obtaining the parity information needed to complete the reconstruction of the bad data block.

In carrying out the above objects and other objects, the present invention provides a method for reading data blocks in a data storage array having data storage elements and a parity storage element. Each of the data storage elements store a respective data block and the parity storage element stores a parity block. The parity block is based on the data blocks. The method includes reading blocks sequentially from respective storage elements. Any bad data blocks are determined as the data blocks are being read. Parity of the good data blocks is then accumulated as the data blocks are being read. The parity block is then read from the parity storage element. A bad data block is then reconstructed from the accumulated parity of the data blocks and the parity block.

In carrying out the above objects and other objects, the present invention provides another method for reading data blocks. This method includes reading data blocks sequentially from respective data storage elements. Any bad data blocks are determined as the data blocks are being read. Parity of the good data blocks is then accumulated as the data blocks are being read. The parity block is then read from the parity storage element. A bad data block is then reconstructed from the accumulated parity of the good data blocks and the parity block.

Preferably, accumulating parity of the data blocks includes exclusive ORing the parity of the good data blocks read prior to the current good data block being read with the current good data block being read. Reconstructing a bad data block includes exclusive ORing the parity of the good data blocks with the parity block. The method preferably further includes storing the good data blocks read after the bad data block until the bad data block is reconstructed to preserve ordering of the data blocks during reading.

In carrying out the above objects and other objects, the present invention further provides a data storage array for reading data blocks. The system includes data storage elements each storing a respective data block and a parity storage element storing a parity block based on the data blocks. A controller sequentially reads data blocks and the parity block from respective storage elements. The controller determines if any of the data blocks are bad as the data blocks are being read. A parity accumulator accumulates parity of the good data blocks as the controller reads the data blocks until the controller determines one of the data blocks to be bad. The controller reconstructs a bad data block from the accumulated parity of the good data blocks and the parity block. The storage elements are preferably either magnetic tape drives, magnetic disk drives, or a single track of a magnetic tape.

The advantages accruing to the present invention are numerous. For instance, the present invention allows higher speed operation in the event of read errors. Additional buffer bandwidth is not required as determining the accumulated or partial parity of the blocks is the same information that is performed during writing.

The above objects and other objects, features, and advantages of the present invention are readily apparent from the following detailed description of the best mode for carrying out the present invention when taken in connection with the accompanying drawings.

BEST MODES FOR CARRYING OUT THE INVENTION

Referring now toFIG. 1, a data storage array system10containing a host computer12and a plurality of individual storage elements14a,14b,14c, and14dis shown. Host computer12executes, on one or more processors, an operating system as well as various applications that periodically read and write information from and to the storage elements. For simplicity, the combination of the operating system and applications shall be referred to as the operating environment. The operating environment accesses various ones of the storage elements as if the individual storage elements functioned as a single, large storage element.

Typically, the storage elements are inexpensive hard disk drives arranged in an array. Various other forms of data storage elements may be substituted for, or combined with, the disks. Such other forms of storage elements include, but are not limited to, optical drives, ZIP drives, floppy disk drives, semiconductor memory devices, magnetic tape drives, or any other form of random access memory. Although any of these other forms of storage elements may be used with the present invention, the following discussion refers to a single track of a single magnetic tape, i.e., single tape RAIT.

When using a single magnetic tape, the operating environment treats the single track14of the magnetic tape (shown inFIG. 3) commonly referred to as a virtual tape16. The data blocks are represented to host computer12as being stored in virtual tape16in serial fashion. Thus, the operating environment requests data from virtual tape16using a convenient single address. A controller18ensures that the address into virtual tape16is mapped to an address within the single track of the magnetic tape. Controller18can also reside within host computer12.

In a redundant array of independent storage devices, such as disks or tapes, the physical storage units14a,14b,14c, and14d, known as members, are accessed via controller18. Data blocks are distributed, or striped, serially amongst members14a,14b,14c, and14d. To achieve fault tolerance, the data blocks are arranged into redundancy groups where the data blocks within a data stripe are self consistent with the other data blocks in the data stripe. One technique for making the data stripe redundant is to use a parity block based on the data blocks. As such, the redundancy information is a parity block in which the data blocks in the data stripe are XOR (exclusive OR) consistent.

FIG. 2depicts a conventional data striping format for a RAID-4 storage element array. Under the RAID-4 standard, data blocks appearing in virtual track16are striped across the members1–3. A parity block based on the data blocks is striped to member4. Under RAID-4, the parity block is stored in a dedicated parity storage member. However, the parity block may be stored in a diagonal manner across the members as done under RAID-5. The pattern of storage is not important as long as the parity block locations are mappable. Consequently, controller18knows where the parity blocks are stored such that the parity blocks can be easily identified.

Use of parity blocks to form consistent data stripes is well-known in the art and a description regarding the use of parity information in a RAIT-4 storage array system will clarify operation of the present invention. Parity blocks are generated by using an exclusive OR (XOR) function upon a series of data blocks located within a given data stripe20. For example, inFIG. 2, parity block #1is formed by applying the XOR function to data block #1through data block #3(e.g., data block #1⊕ data block #2⊕ data block #3=parity block #1). Similarly, in data stripe22, data block #4⊕ data block #5⊕ data block #6=parity block #2and so on. Thus, each data stripe is XOR consistent.

If one of the members ceased to function, the information contained in the remaining members is used to reconstruct the data block on the damaged member. For example, if member2were damaged, data block #2in data stripe20would be unreadable. However, data block #2=data block #1⊕ data block #3⊕ parity block #1. Thus, the array is fault tolerant, i.e., if one member is damaged at a given time the system is still operational without any loss of data.

Referring now toFIGS. 3–4, with continual reference toFIGS. 1–2, the data storage array method and system of the present invention will be described. Data storage array system30includes a host computer12, a single magnetic tape storage element14, and a controller18. Controller18is operable to serially write data blocks and parity blocks from host computer12onto a track of magnetic tape14. Controller18is also operable to sequentially read data blocks and parity blocks from a track of magnetic tape14for host computer12.

Controller18includes a buffer32and a parity accumulator34. Parity accumulator34accumulates parity as controller18sequentially writes the data blocks from host computer12to magnetic tape14via buffer32. After =controller18sequentially writes all of the data blocks in a data stripe to magnetic tape14, the controller writes the parity block from parity accumulator34to the magnetic tape. Parity accumulator then reinitializes and starts accumulating parity again for the next data stripe to be written to magnetic tape14. This continues until controller18has written all of the data blocks to the single track of magnetic tape14.

During reading, controller18serially passes the data blocks to host computer12from magnetic tape14via buffer32. Controller18discards the parity block belonging to a data stripe after sequentially passing all of the data blocks in the data stripe to host computer12. Controller18sequentially reads the data blocks and determines if any one of the data blocks are bad before passing the data blocks to host computer12. If the data block is good, controller18passes the good data block to host computer12. If the data block is bad, controller18reconstructs the bad data block to make it a good data block before passing it and any other good data blocks to host computer12.

The procedure for reconstructing a bad data block into a good data block in accordance with the present invention will now be explained in greater detail. While controller18reads a data block, parity accumulator34accumulates the parity of the data blocks up to and including the current data block being read. For instance, if controller18has read data block #1and is now reading data block #2, parity accumulator34accumulates the parity of data blocks #1and #2(e.g., accumulated parity=data block #1⊕ data block #2). Similarly, if controller18is reading data block #4, the first data block in data stipe22, and has not read any other data blocks in data stripe22, then parity accumulator34accumulates the parity of data block #4(e.g., accumulated parity=data block #4). The accumulated parity is the partial parity of all of the blocks in a data stripe, i.e., the parity of the blocks in a data stripe that have been read.

When controller18determines that a data block is unreadable or bad, the controller skips the bad data block and continues sequentially reading the remaining data blocks and the parity block in the data stripe. Controller18then reconstructs the bad data block from two factors. The first factor is the accumulated parity of the good data blocks of the data stripe read by controller18. Parity accumulator34accumulates and maintains the accumulated parity of the good data blocks as the data blocks are being read. The second factor is the parity block of the data stripe.

For instance, if a data stripe being read has six data blocks and one parity block and if data block #3is bad, then controller18reconstructs data block #3in accordance with the following equation: data block #3=accumulated parity ⊕ parity block #1, where accumulated parity=data block #1⊕ data block #2⊕ data block #4⊕ data block #5⊕ data block #6.

Buffer32stores the good data blocks read by controller18after the bad data block. After controller18reconstructs the bad data block and passes it to host computer12, the controller directs buffer32to pass the stored good data blocks to host computer12in the order that they were read by the controller. This preserves data block ordering.

Referring now toFIG. 4, with continual reference toFIGS. 1–3, a flow chart40illustrating operation of the data storage array method and system of the present invention are shown. Flow chart40initially begins with controller18reading the data blocks sequentially from magnetic tape14as shown in box42. Controller18then determines if any of the data blocks are bad as the data blocks are being read as shown in box44. Parity accumulator34accumulates parity of the good data blocks as the data blocks are being read as shown in block46. Controller18then sends the good data blocks prior to a bad data block to host computer12as shown in box47.

Controller18then reads the parity block from magnetic tape14as shown in box48. Controller18then reconstructs a bad data block from the accumulated parity of the good data blocks and the parity block as shown in box50. Controller18then sends the reconstructed data block to host computer12as shown in box52and then sends the good data blocks after the reconstructed data block to host computer12as shown in box54.

Referring now toFIG. 5with reference toFIGS. 1–3, an alternative embodiment of the data storage array system in accordance with the present invention is shown. Data storage array system60differs from data storage array system30shown inFIG. 3in that separate and distinct storage elements62a,62b,62c, and62dhave been substituted for magnetic tape14. Storage elements62may be disk drives, tape drives, and the like. Storage elements62are connected in parallel to controller18for concurrent access with the controller. Controller18writes to and reads from storage elements in the same manner as described with reference to the track of magnetic tape14inFIG. 3.

Thus it is apparent that there has been provided, in accordance with the present invention, a data storage array method and system that fully satisfy the objects, aims, and advantages set forth above. While the present invention has been described in conjunction with specific embodiments thereof, it is evident that many alternatives, modifications, and variations will be apparent to those skilled in the art in light of the foregoing description. Accordingly, it is intended to embrace all such alternatives, modifications, and variations as fall within the spirit and broad scope of the appended claims.