Abstract:
A method for operating a tape drive may include receiving a command to read a record stored on a tape by a tape drive having a capability to compress and decompress data. The tape drive compresses a record prior to writing the record to tape when a command to write the record to tape specifies that the record is to be compressed, and when a compressed size of the record is smaller than an uncompressed size of the record. The method further include reading the record from the tape by the tape drive, where the tape includes a plurality of compressed records and a plurality of uncompressed records. The method further includes determining by the tape drive whether the record is not compressed. The method may additionally include generating a compressed record by compressing the record by the tape drive when it is determined that the record is not compressed.

Description:
BACKGROUND 
       [0001]    The present disclosure relates to data storage systems, and more specifically, to retrieving data records from a tape storage medium. 
         [0002]    Data storage systems are computing systems configured to manage the storage and retrieval of information for client computing systems. These storage systems may include one or more storage medium for storing information, and a storage controller for processing and servicing storage requests. One example of a data storage system are tape drives. Tape drives may store large amounts of data on magnetic tape media. 
       SUMMARY 
       [0003]    According to embodiments of the present disclosure, a method for operating a tape drive may include receiving a command from a requestor to read a first record stored on a first tape by a tape drive having a capability to compress and decompress data. The tape drive compresses a record prior to writing the record to tape when a command to write the record to tape specifies that the record is to be compressed, and when a compressed size of the record is smaller than an uncompressed size of the record. The method may further include reading the first record from the first tape by the tape drive, where the first tape includes a first plurality of compressed records and a second plurality of uncompressed records. The method may further include determining by the tape drive, subsequent to the reading of the first record, whether the first record is not compressed. The method may additionally include generating a compressed first record by compressing the first record by the tape drive when it is determined that the first record is not compressed. 
         [0004]    Various embodiments are directed towards a tape drive having a magnetic tape storage media having a first tape and a second tape and a storage controller having a processor and a memory, the memory having program instructions embodied therewith. The program instructions may be executable by the processor to cause the storage controller to receive a command from a requestor to read a first record stored on a first tape and to read the first record from the first tape by the tape drive, wherein the first tape includes a first plurality of compressed records and a second plurality of uncompressed records. The program instructions may be executable by the processor to further cause the storage controller to determine by the tape drive, subsequent to the reading of the first record, whether the first record is not compressed. The program instructions may be executable by the processor to further cause the storage controller to generate a compressed first record by compressing the first record by the tape drive when it is determined that the first record is not compressed. 
         [0005]    Other embodiments are directed towards a computer program product to implement the tape drive, and the method for operating a tape drive. 
         [0006]    The above summary is not intended to describe each illustrated embodiment or every implementation of the present disclosure. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0007]    The drawings included in the present application are incorporated into, and form part of, the specification. They illustrate embodiments of the present disclosure and, along with the description, serve to explain the principles of the disclosure. The drawings are only illustrative of certain embodiments and do not limit the disclosure. 
           [0008]      FIG. 1  a flowchart of computer implemented operations for retrieving a data record from a tape drive, according to various embodiments. 
           [0009]      FIG. 2  depicts a block diagram of a system for retrieving data records from a tape drive, according to various embodiments. 
       
    
    
       [0010]    While the invention is amenable to various modifications and alternative forms, specifics thereof have been shown by way of example in the drawings and will be described in detail. It should be understood, however, that the intention is not to limit the invention to the particular embodiments described. On the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. 
       DETAILED DESCRIPTION 
       [0011]    Aspects of the present disclosure relate to data storage systems, more particular aspects relate to retrieving data records from tape drives. While the present disclosure is not necessarily limited to such applications, various aspects of the disclosure may be appreciated through a discussion of various examples using this context. 
         [0012]    Tape drive based data storage systems may provide a long term high capacity storage solution for entities by storing large amounts of data on reels of magnetic tape or tape storage media. Writing data to a tape drive storage system may include mechanically seeking to an unused (or free) area of the magnetic tape suitable to writing a data record. In some situations, a data record may be compressed by, for example, a storage controller, before being written to the magnetic tape. Consequently, distributions of compressed and uncompressed data records may be stored on a given tape drive storage system. Reading a data record from the tape drive storage system may include mechanically seeking to a second area of the tape storage media, retrieving the data record, and providing it to a client computing system. Due to the distribution of compressed and uncompressed data records stored on the tape drive storage system, the data record provided to the host computing may be compressed or uncompressed. 
         [0013]    In some situations, a host computing system receiving a data record from a tape drive storage system in response to a read request may not be able to determine whether data record is in a compressed or uncompressed state. Consequently, a tape drive storage system may receive, subsequent to providing a data record to a host computing system, a request to determine whether the provided data record was compressed. This request may require an additional mechanical seek to the location of the transmitted record on the tape storage media, and an additional transmission on a data communication bus coupling the tape drive storage system to the host computing system. Servicing the request may reduce the performance tape storage drives. The reduction in performance may be particularly pronounced when the size of a data record is relatively small. 
         [0014]    Embodiments of the present disclosure provide techniques for efficiently reading data from a tape drive storage system. These techniques are based on the recognition that the performance costs of associated with decompressing data using software executing on a host computing system may be less than the round trip performance costs associated with querying a tape drive to determine whether a received data record is compressed or uncompressed. According embodiments of the present disclosure, a tape drive storage controller may be configured to always return a compressed data record to a host computing system in response to receiving a request to read the data record. In some embodiments, returning a compressed data record may include compressing a data record which was previously uncompressed (e.g., the data record was not compressed before being written to the tape storage media), and then transmitting the compressed record to the host computing system. 
         [0015]    As used herein, a data record may be a unit of variable (or fixed) length data. A data record may, for example, be a one mega-byte (e.g., 1 MB) unit of data. Furthermore, data compression, as discussed herein, may include any technique for transforming or mapping a raw (e.g., uncompressed) data record from a first representation to a second representation. Under some circumstances, the second representation may represent the data record using fewer bytes of data than the first representation. Under other circumstances, the second representation may represent the data record using more bytes of data than the first representation. For example, when a compression algorithm is applied to previously compressed data such as video data, the data size sometimes increases. This latter scenario may be referred to as an expansion. 
         [0016]    As used herein, seeking to a data record stored on tape storage media (hereinafter, “tape media”) may include electrical and mechanical operations to play or traverse a length of the magnetic tape until the data record is located. The data record may be located by, for example, read/write heads (e.g., sensors capable of reading and writing data on magnetic tape media) coupled to the tape media. 
         [0017]    Referring now to the figures,  FIG. 1  depicts a flowchart  100  of computer implemented operations for retrieving a data record from a tape drive, according to various embodiments. The operations of flowchart  100 , for example, may be performed by a tape drive storage controller in response to receiving a request from a host computing system to read a data record stored on tape media. In some embodiments, the operations of flowchart  100  may be performed by hardware and/or software components of a tape drive storage controller (hereinafter, “tape drive”). For example, the operations of flowchart  100  may be performed by tape drive  205  ( FIG. 2 ). 
         [0018]    The tape drive may begin the operations of flowchart  100  at operation  105  by receiving a command to write a record to the tape drive. The command may be received from a host computing system via a data bus coupling the tape drive to the computing system. In some embodiments, the tape drive may have a capability to compress and decompress a data record before and/or after writing it to the tape media. Under certain conditions, the received command may include an instruction to compress the data record before writing it. The tape drive, in response to receiving such a command, may compress the data record before writing it if compression would not result in an expansion. As mentioned, when a compression algorithm is applied to previously compressed data such as video data, the data size sometimes increases, resulting in an expansion. The tape drive may determine whether the compression would result in an expansion by compressing the data record and comparing the size of the compressed data record to the uncompressed data record. When the size of the compressed data record is larger than the size of the uncompressed data record (e.g., when compression results in an expansion), the tape drive may decide to write the data record without compressing it. When the size of the compressed data record is not larger than the size of the uncompressed data record, the tape drive may write the compressed record to the tape media. In some embodiments, the tape drive may verify the integrity of the compressed data record (e.g., by decompressing the record and comparing the decompressed record to the original uncompressed record) before writing it to the tape media. 
         [0019]    The tape drive may continue the operations of flowchart  100  by executing operation  110 . Executing operation  110  may include receiving a command from a host computing system (e.g., a requestor) to read a data record (e.g., a first record) stored on a reel of the tape media (e.g., a first tape). The request to may include a token or address for identifying the data record on the tape media. As with the request to write a data record, the request to read a data record may be received from the host computing system on a data bus coupling the tape drive to the host computing system. 
         [0020]    The tape drive may continue execution of the operations of the flowchart  100  at operation  115  by reading the requested data record from the tape media. Reading the requested data record may include directing mechanical and electrical components (including, for example, read/write heads) associated with the tape drive to seek to an area of the tape media having the requested data record. In some embodiments, the area having the requested data record may be determined according to the token or address received in operation  110 . Firmware or software executing on the tape drive may then direct the read/write heard to the requested data record into, for example, a memory buffer. The data record read into the memory buffer may be compressed or uncompressed depending whether the write command which caused the tape drive to previously write the requested data record included an instruction to compress the data record and on whether compression resulted in an expansion. 
         [0021]    The tape drive may continue execution of the operations of the flowchart  100  at operation  120  by determining whether the requested data record is compressed. In some embodiments, the tape drive may maintain a data table having information on whether a record stored magnetic tape media associated with the tape drive is compressed. The tape drive may index the table using, for example, the token or address associated to the requested record, to determine whether the requested record is compressed. In some embodiments, the tape drive may write a token indicating whether the requested record is compressed along with the requested record, when the requested record is first written to the storage media. The tape drive may determine whether the data record was compressed by reading the token along with the data record. In certain embodiments, the tape drive may determine whether the data record is compressed according to the format of the data record. The tape drive may continue to operation  125  when the requested data record is compressed, while the tape drive may continue to operation  130  when the requested data record is not compressed. 
         [0022]    The tape drive may execute operation  125  by generating a compressed data record (e.g., a compressed first record) from the requested data record. The tape drive may generate the compressed data record by, for example, transferring the requested data record (e.g., the data record stored in the memory buffer) to a compression engine associated with the tape drive. The compression engine may compress the data record and provide the compressed data record to the tape drive in a second memory buffer. In some embodiments, the tape drive may compress the data record even when compression results in expansion. 
         [0023]    The tape drive may execute operation  130  by transmitting the compressed data record to the host computing system. In some embodiments, the tape drive may transmit the compressed data record to the host computing system by, for example, forming a data bus packet having the compressed data record and a destination address associated with the host computing system. The tape drive may then transfer the data packet to the data bus coupling the tape drive to the host computing system. In some embodiments, the tape drive may transfer the compressed data record, along with a destination memory address accessible to the host computing system, to a dynamic memory access (DMA) controller. The DMA controller may then transmit or transfer the data packet to the indicated destination memory address. 
         [0024]    While an example embodiment of the operations of flowchart  100  is described herein, other variants of the flowchart  100  are contemplated. In some variants one or more operations of the flowchart  100  may be executed in a different order than indicated in  FIG. 1 . In other embodiments, additional operations may be added to further the execution of the operations of flowchart  100 . 
         [0025]      FIG. 2  depicts a block diagram of a system  200  for retrieving data records from a tape drive, according to various embodiments. In some embodiments, the system  200  may include host computing system  201 , tape drive  205 , and tape storage media  275 . 
         [0026]    The host computing system  201  may be a computing device having, for example, a memory, one or more processors executing computer readable code, and one or more data buses for exchanging data between components of the computing device and other computing devices/systems. In addition, the host computing system  201  may include various volatile and non-volatile memories, such as DRAM, hard drive, flash drive. Further, the host computing system  201  may include a direct memory access controller. The host computing system  201  may be coupled to tape drive  205  by bus  202 . In some embodiments, the bus  202  may be data bus such as a small computer system interface (SCSI) bus. In certain embodiments, the bus  202  may be a network communication channel. The host computing system  201  may transfer data to, or receive data from, tape drive  205  via direct option of the one or more processors to transfer data from a memory associated with the host computing system to the bus  202 . The host computing system  201  may additionally transfer data to, or receive data from, the tape drive  205  by operation of a DMA controller. 
         [0027]    The tape drive  205  may be a computing device configured to implement the operations of the present disclosure when processing requests to write data to, and/or read data from, tape storage media  275   9  (e.g., tape media). The tape drive  205  may include host interface component  210 , programmable logic circuit  215 , drive firmware  240 , buffer  255 , error correcting code (ECC) encoding component  260 , read/write control component  265 , and read/write heads  270 . 
         [0028]    In some embodiments, the host interface component  210  may be a DMA controller coupled to a bus  202 . The DMA controller may receive a destination memory address and a data record from the tape drive  205  for writing a data record of an area memory accessible to the host computing system  201 . The DMA controller may then transfer the data record to the destination memory address via bus  202  according arbitration protocols defined for the bus. In some embodiments, the host interface component  210  may be a SCSI interface logic block configured to transfer data over of a SCSI interface, or logic block having a network communication protocol stack for transferring data over a data communication network. In some situations, the tape drive  205  may receive a request to write and/or read a data record from the host computing system  201  via host interface component  210 . The request may then be transferred to a memory buffer accessing to the tape drive  205  (e.g., buffer  255 ) for processing. Furthermore, the tape drive  205  may transfer a compressed data record to the host computing system  201  via host interface  210  by transferring the data compressed data record to a second memory buffer accessible to the host interface and actuating appropriate logic circuits of the host interface for transmitting the record to the host computing system. 
         [0029]    Programmable logic circuit  215  may include one or more programmable logic devices, such as field programmable gate arrays, application specific logic devices, and programmable logic arrays. The programmable logic circuit  215  may receive (e.g., via buffer  255 ) a data record from tape drive  205  along information and/or an instruction for compressing the data record. The data record may be a data record received as part of a write request from the host computing system  201 . The data record may alternatively be a data record read from tape storage media  275 . The programmable logic circuit  215  may compress the data record using compression component  220 . In some embodiments, the programmable logic circuit  215  may provide feedback information to the tape drive  205  indicating, for example, the size of the compressed record. In certain embodiments, the tape drive  205  may direct the programmable logic circuit  215  to encrypt the compressed data record using encryption component  230 . The programmable logic circuit  215  may provide the compressed and/or encrypted data record to the tape drive  205  by, for example, transferring the record to buffer  255 . 
         [0030]    In certain situations, the tape drive  205  may transfer a data record to programmable logic circuit  215  for decryption and/or decompression. For example, the tape drive  205  may read an encrypted data record from tape storage media  275 , and forward it to programmable logic circuit  215  for decryption before transmitting to the record to the host computing system  201 . As another example, the table drive  205  may attempt to verity the integrity of a compressed data record by forwarding the compressed record to programmable logic circuit  215  for decompression. The programmable logic circuit  215  may decompress the data record using decompression component  225 . Furthermore, the programmable logic circuit  215  may decrypt the data record using decryption component  235 . The decompressed and/or decrypted data record may then be returned to tape drive  205  by, for example, writing it to buffer  255 . 
         [0031]    Drive firmware component  240  may include a processor  245  and a program memory  250 . The processor  245  may be configured to execute computer readable code stored in the program memory  250  for performing the operations of the present disclosure. More specifically, the processor  245  may execute the computer readable code to direct the host interface component  210  to receive data from, and transfer data to, host computing system  201 . The processor  245  may further execute the computer readable code to direct programmable logic circuit  215  to compress, encrypt, decompress, and decrypt data records, as described herein. The processor  245  may further execute the computer readable code to encode the data records with ECC data using ECC encoding component  260 . Furthermore, the processor  245  may execute computer readable code to configure read/write control component  265  to direct read/write heads  270  to write data to, and/or read data from, tape storage media  275 . The processor  245  may additionally execute the computer readable code stored in program memory  250  to execute the operations of the flowchart  100 . 
         [0032]    The tape storage media  275  may include one or more reels of magnetic tape coupled to electrical and mechanical assemblies for playing the tape media in a forward and/or backward direction. Mechanical components of the assembly may include motors and gears for actuating the reels, while electrical components may include control and power circuits for actuating the motors. The control and power circuits may actuate the motors turning each real in response to signals received from tape drive  205 . The tape of each reel may be configured with one or more tracks of magnetic material extending along the length of the tape. The magnetic material may be configured to store data according to an orientation of the magnetic poles of the magnetic material. The information stored on the magnetic material may be readable and/or writeable by one or more read/write heads coupled to tape drive  205 . The stored information may include a set of one or more compressed or uncompressed data records. 
         [0033]    The descriptions of the various embodiments of the present disclosure have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.