The present invention generally relates to a control of a writing of data from a host to a device, which is a logical or physical view by the host of a drive and a controller function of that drive. The present invention specifically relates to controlling an execution of a drive swap or a media swap based on a detected defect in the device or media mounted in the drive of the device.
In a tape subsystem, there exists a possibility of a device becoming defective prior to or during a write of data from a host to a media mounted in a drive of the device. Currently, when the device becomes defective, a process for write recovery of any data written to the drive is initiated by the host where the host is required to recover data buffered in the device. Several drawbacks to this write recovery process as initiated by the host is that the host can be slow at recovering any buffered data, the size of a buffer of the device may make it difficult for the host to allocate internal space to hold any recovered buffer data, and moving the media to a new device will not be effective if the media is defective. A challenge therefore for the storage industry is to resolve the drawbacks of a host initiated write recovery process.
One form of the present invention is a signal bearing medium tangibly embodying a program of machine-readable instructions executable by a processor to perform operations for controlling a writing of data from a host to a device including a media mounted in a first drive, and for controlling a swap of the first drive for a second drive in response to a detection of a defect in the device. The controlling of the swap of the first drive for the second drive includes recovering at least one of any first portion of the data buffered in the first drive and any second portion of the data recorded on the first media, and writing at least one of any recovered first portion of the data and any recovered second portion of the data to the second drive.
A second form of the present invention is a device controller employing a processor and a memory storing instructions operable with the processor. The instructions are executed for controlling a writing of data from a host to a device including a media mounted in a first drive, and for controlling a swap of the first drive for a second drive in response to a detection of a defect. The controlling of the swap of the first drive for the second drive includes recovering at least one of any first portion of the data buffered in the first drive and any second portion of the data recorded on the first media, and writing at least one of any recovered first portion of the data and any recovered second portion of the data to the second drive.
A third form of the present invention is a storage subsystem employing a plurality of drives, a plurality of media, and a device including a device controller operatively coupled to a first drive. The device controller controls a writing of data from a host to a media mounted in the first drive, and controls a swap of the first drive for a second drive in response to a detection of a defect in the device. The controlling of the swap of the first drive for the second drive includes recovering at least one of any first portion of the data buffered in the first drive and any second portion of the data recorded on the first media, and writing at least one of any recovered first portion of the data and any recovered second portion of the data to the second drive.
The forgoing forms and other forms, objects, and aspects as well as features and advantages of the present invention will become further apparent from the following detailed description of the various embodiments of the present invention, read in conjunction with the accompanying drawings. The detailed description and drawings are merely illustrative of the present invention, rather than limiting the scope of the present invention being defined by the appended claims and equivalents thereof.
Each tape system 30 further employs a primary pool (“PP”) and a spare pool (“SP”) of tape cartridges 35, and a library manager 36 for managing tape cartridges 35. Each device controller 31 employs a write module 32 structurally configured with hardware, software and/or firmware to implement a write control method of the present invention as represented by a flowchart 40 illustrated in
Referring to
If module 32(1) detects a device error during stage S44 prior to host 11(1) completing or aborting the writing of data to the device, then module 32(1) proceeds to a stage S46 of flowchart 40 to control an execution of drive swap involving a replacement of specified tape drive 34(1)(1) with another one of the tape drives 34(1). In one exemplary embodiment of stage S46, a policy is utilized to select the replacement tape drive 34(1) from either a free tape drive 34(1) also allocated to the device at the time of the write request from host 11(1) (if any), a free tape drive 34(1) allocated to another device at the time of the write request from host 11(1) (if any), or a spare tape drive 34(1) (if any). The policy should be directed to selecting the replacement tape drive 34(1) in quickest and highest possible recovery possible based on the performance and usage data of the selectable tape drives 34 and in a manner transparent to the host as would be appreciated by those having ordinary skill in the art.
In practice, the present invention does not impose any limitations or any restrictions to the structural configuration of module 32(1) in performing stage S46. Thus, the following description of a flowchart 60 illustrated in
Referring to
A stage S64 of flowchart 60 encompasses module 32(1) recovering any data buffered in specified tape drive 34(1)(1), and a stage S66 of flowchart 60 encompasses module 32(1) determining whether the specified tape cartridge 35(1)(1) is defective.
If the specified tape cartridge 35(1)(1) is defective, then module 32(1) proceeds to a stage S68 of flowchart 60 to direct library manager 36 (1) to mount a replacement tape cartridge 35(1)(2) in the replacement tape drive 34(1)(2) to thereby control a copying of any data recorded on the specified tape cartridge 35(1)(1) to the replacement tape cartridge 35(1)(2) by recovering any recorded data in the specified tape cartridge 35(1)(1) and writing any recorded data recovered from the specified tape cartridge 35(1)(1) to the buffer of the replacement tape drive 34(1)(2). To facilitate future reads of the data, library manager 36(1) will mark the specified tape cartridge 35(1)(1) as a failed media and give the replacement tape cartridge 35(1)(2) the identity of the specified tape cartridge 35(1)(1).
If the specified tape cartridge 35(1)(1) is not defective, then module 32(1) proceeds to a stage S70 of flowchart 60 to direct library 36(1) to dismount the specified tape cartridge 35(1)(1) from specified tape drive 34(1)(1) and to mount the specified tape cartridge 35(1)(1) in the replacement tape drive 34(1)(2) whereby module 32(1) points to the last recorded position in the specified tape cartridge 35(1)(1) to thereby facilitate a continuation of writing of the data to specified tape drive 34(1)(1).
Upon completion of stage S68 or stage S70, module 32(1) sequentially proceeds to a stage S72 of flowchart 70 to writing any buffered data recovered from the buffer of the specified tape drive 34(1)(1) to the buffer of the replacement tape drive 34(1)(2) whereby the recovered buffered data is stored in the buffer of the replacement tape drive 34(1)(2), and a stage S74 of flowchart 70 to notify host 11(1) of a successful error recovery.
Referring again to
Referring to
Referring to
Referring to
While the embodiments of the present invention disclosed herein are presently considered to be preferred embodiments, various changes and modifications can be made without departing from the spirit and scope of the present invention. The scope of the invention is indicated in the appended claims, and all changes that come within the meaning and range of equivalents are intended to be embraced therein.