Abstract:
There is provided a storage control program, a storage control apparatus, and a storage control method capable of improving a random read performance for a logging operation. 
     A storage control program allows a computer to control a storage apparatus and causes the computer to execute: a data write step that logs data to the storage apparatus based on a write request from outside; and a position information control step that can write position information in a cache apparatus connected to the computer through a network. The position information is equivalent to correspondence between a logical position specified by the write request and a physical position in the storage apparatus where the data write step logs data.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The present invention relates to a storage control program, a storage control apparatus, and a storage control method for writing a log onto a storage apparatus. 
         [0003]    2. Description of the Related Art 
         [0004]    A hard disk causes a random access to be slower than a sequential access. Storage systems using hard disks are subject to the similar problem. Several methods are proposed to solve this problem. 
         [0005]    A first method is to simply array a large number of disks for performing I/O operations in parallel and improving the performance. This method can be used to construct a large-scale RAID (Redundant Arrays of Inexpensive Disks) system and improve both IOPS (Input Output Per Second) and reliability of random access. 
         [0006]    A second method is to use a cache. This method can be categorized into write through cache and write back cache. The write through cache uses the cache during reading. The write back cache uses the cache during reading and writing. These methods can be used with an increased cache capacity to increase a cache hit ratio and drastically improve the IOPS for random access. 
         [0007]    The write back cache needs to save data in memory before writing the data to a disk, thus degrading the reliability. Multiplexing the cache may ensure the reliability but doubles the cache memory cost. 
         [0008]    A random write will now be described. 
         [0009]    The random write includes a method called a logging operation. The logging operation sequentially writes information about a logical position (address) and data for the random write. Data reading uses information in a position information table that indicates correspondence between logical and physical positions to read data for reproduction. In this manner, the random write can achieve a throughput comparable to that of the sequential access. The logging operation excels in the random write. The write through cache excels in the random read. A combination of the logging operation and the write through cache can provide preferable results in terms of the performance, reliability, and costs for the random access. 
         [0010]    Conventional technologies related to the invention disclose a storage system that distributes a cache apparatus, a disk apparatus, and a control apparatus over a network to increase a cache memory area. (For example, see Patent Document 1: WO2003/065195, Patent Document 2: WO2003/075147, and Patent Document 3: WO2004/027625). 
         [0011]    The combination of the logging operation and the write through cache is very effective but causes a problem specific to the logging method. Especially, a storage system based on the logging operation needs to manage a position information table that indicates the correspondence between a logical position, i.e., a write position used by a host, and a physical position, i.e., a write position for a low-order device (disk apparatus). Searching the position information table is time-consuming, thus degrading the reading performance in case of a cache miss. The position information table necessitates one-to-one correspondence between sectors and requires an extra space approximately 1/64 to 1/512 of a volume size. 
       SUMMARY OF THE INVENTION 
       [0012]    The present invention has been made in consideration of the foregoing. It is therefore an object of the present invention to provide a storage control program, a storage control apparatus, and a storage control method capable of improving a random read performance for a logging operation. 
         [0013]    To solve the above-mentioned problem, the present invention provides a storage control program for allowing a computer to control a storage apparatus. The program causes the computer to execute: a data write step that logs data to the storage apparatus based on a write request from outside; and a position information control step that can write position information in a cache apparatus connected to the computer through a network. The position information is equivalent to correspondence between a logical position specified by the write request and a physical position in the storage apparatus where the data write step logs data. 
         [0014]    In the storage control program according to the invention, the position information control step can further read, from the position information stored in the cache apparatus, based on a read request from outside, a physical position corresponding to a logical position specified by the read request. The program can further allow a computer to execute a data read step that reads data from a physical position read by the position information control step. 
         [0015]    In the storage control program according to the invention, the position information control step uses a cache in the computer and a cache in the cache apparatus as a first hierarchical storage apparatus and manages the position information in the first hierarchical storage apparatus. The cache in the cache apparatus has a larger capacity than the cache in the computer. 
         [0016]    In the storage control program according to the invention, the position information control step writes most recent position information to the cache in the computer and moves less frequently used position information from position information stored in the cache in the computer to the cache in the cache apparatus. 
         [0017]    In the storage control program according to the invention, the position information control step adds the storage apparatus to the first hierarchical storage apparatus to provide a first hierarchical storage apparatus and uses the first hierarchical storage apparatus to manage the position information. The storage apparatus has a larger capacity than the cache in the cache apparatus. 
         [0018]    In the storage control program according to the invention, the position information control step moves less frequently used position information from position information stored in the cache in the cache apparatus to the storage apparatus. 
         [0019]    In the storage control program according to the invention, the data write step uses the cache in the computer, the cache in the cache apparatus, and the storage apparatus as a second hierarchical recording medium, and writes data to the second hierarchical recording medium by means of write through. The data read step reads data from the second hierarchical recording medium. The cache in the cache apparatus has a larger capacity than the cache in the computer and the storage apparatus has a larger capacity than the cache in the cache apparatus. 
         [0020]    The invention provides a storage control apparatus for controlling a storage apparatus. The storage control apparatus includes: a data control section that logs data to the storage apparatus based on a write request from outside; and a position information control section that can write position information to a cache apparatus connected to the storage control apparatus through a network, in which the position information is equivalent to correspondence between a logical position specified by the write request and a physical position in the storage apparatus where the data control section logs data. 
         [0021]    In the storage control apparatus according to the invention, the position information control section can further read, based on a read request from outside, from the position information stored in the cache apparatus, a physical position corresponding to a logical position specified by the read request. The data control section further reads data from a physical position read by the position information control section. 
         [0022]    In the storage control apparatus according to the invention, the position information control section uses a cache in the storage control apparatus and a cache in the cache apparatus as a first hierarchical storage apparatus and manages the position information in the first hierarchical storage apparatus. The cache in the cache apparatus has a larger capacity than the cache in the storage control apparatus. 
         [0023]    In the storage control apparatus according to the invention, the position information control section writes most recent position information to the cache in the computer and moves less frequently used position information from position information stored in the cache in the storage control apparatus to the cache in the cache apparatus. 
         [0024]    In the storage control apparatus according to the invention, the position information control section adds the storage apparatus to the first hierarchical storage apparatus to provide a first hierarchical storage apparatus and uses the first hierarchical storage apparatus to manage the position information. The storage apparatus has a larger capacity than the cache in the cache apparatus. 
         [0025]    In the storage control apparatus according to the invention, the position information control section moves less frequently used position information from position information stored in the cache in the cache apparatus to the storage apparatus. 
         [0026]    In the storage control apparatus according to the invention, the data control section uses the cache in the storage control apparatus, the cache in the cache apparatus, and the storage apparatus as a second hierarchical recording medium, and writes data to and reads data from the second hierarchical recording medium by means of write through. The cache in the storage control apparatus is faster than the cache in the cache apparatus. The cache in the cache apparatus is faster than the storage apparatus. 
         [0027]    The invention provides a storage control method of controlling a storage apparatus. The method executes: a data write step that logs data to the storage apparatus based on a write request from outside; and a position information control step that can write position information in a cache apparatus connected to the computer through a network, wherein the position information is equivalent to correspondence between a logical position specified by the write request and a physical position in the storage apparatus where the data write step logs data. 
         [0028]    The invention can improve a random read performance for a logging operation, especially in case of a cache miss. 
     
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0029]      FIG. 1  is a block diagram exemplifying the configuration of a storage system according to a first embodiment; 
           [0030]      FIG. 2  is a block diagram exemplifying the configuration of a position information table according to the first embodiment; 
           [0031]      FIG. 3  is a flowchart exemplifying operations of a write process on a storage control apparatus according to the first embodiment; 
           [0032]      FIG. 4  is a flowchart exemplifying operations of a read process on the storage control apparatus according to the first embodiment; 
           [0033]      FIG. 5  exemplifies a message structure in a cache protocol according to the first embodiment; 
           [0034]      FIG. 6  exemplifies a data structure in the cache protocol according to the first embodiment; 
           [0035]      FIG. 7  is a flowchart exemplifying operations of retrieving and updating a position information table according to the first embodiment; 
           [0036]      FIG. 8  exemplifies a data structure in a cache protocol according to a second embodiment; and 
           [0037]      FIG. 9  is a flowchart exemplifying operations of retrieving and updating a position information table according to the second embodiment. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0038]    Embodiments of the present invention will be described in further detail with reference to the accompanying drawings. 
       First Embodiment 
       [0039]    The embodiment describes a storage control apparatus using the combination of the logging operation and the write through cache as mentioned above. 
         [0040]    The following first describes the configuration of a storage system using the storage control apparatus according to the embodiment. 
         [0041]      FIG. 1  is a block diagram exemplifying the configuration of the storage system according to the embodiment. The storage system includes a storage control apparatus  1 , a cache apparatus  2 , a disk apparatus  3  (storage apparatus), and a network  4 . The storage control apparatus  1  is connected to a host in the outside and the disk apparatus  3 . The storage control apparatus  1  is connected to the cache apparatus  2  via the network  4 . 
         [0042]    The storage control apparatus  1  includes a data control section  11 , a log control section  12  (position information control section), a data cache  13 , and a position information cache  14 . The data cache  13  may be provided in the data control section  11 . The position information cache  14  may be provided in the log control section  12 . 
         [0043]    The cache apparatus  2  includes a cache control section  21 , a data cache  23 , and a position information cache  24 . The cache control section  21  controls the data cache  23  and the position information cache  24 . The data cache  23  uses larger memory than the data cache  13 . The position information cache  24  uses larger memory than the position information cache  14 . The data cache  23  and the position information cache  24  may be configured as single memory. 
         [0044]    The disk apparatus  3  includes a data area  33  for storing logged data and a position information area  34  for storing position information. 
         [0045]    The data control section  11  controls the data cache  13  in the storage control apparatus  1  and the data cache  23  in the cache apparatus  2 . The data control section  11  follows a read or write request from the host, issues a read or write request to the log control section  12 , and returns a result to the host. The log control section  12  controls the position information cache  14  in the storage control apparatus  1  and the position information cache  24  in the cache apparatus  2 . The log control section  12  converts data for a write request from the data control section  11  into a log format and writes it to the data area  33  of the disk apparatus  3 . When receiving a read request from the data control section  11 , the log control section  12  reads the requested data from the data area  33  of the disk apparatus  3  and transmits the data to the data control section  11 . 
         [0046]    The data control section  11  manages the data caches  13  and  23 , and the data area  33  as hierarchical storages and stores data in them. In terms of data access, the data cache  13  features a smallest capacity and a fastest speed and stores most frequently used data. The data cache  23  features a larger capacity and a slower speed and stores less frequently used data than the data cache  13 . The data area  33  features a largest capacity and a slowest speed and stores least frequently used data. 
         [0047]    Similarly, the log control section  12  manages the position information caches  14  and  24 , and the position information area  34  as hierarchical storages and stores a position information table in each of them. In terms of access to the position information table, the position information cache  14  features a smallest capacity and a fastest speed and stores most frequently used position information. The position information cache  24  features a larger capacity and a slower speed and stores less frequently used position information than the position information cache  14 . The position information area  34  features a largest capacity and a slowest speed and stores least frequently used position information. 
         [0048]    The position information table will now be described. 
         [0049]    The management of the position information table uses the same method as that for a file system&#39;s block map.  FIG. 2  is a block diagram exemplifying the configuration of the position information table according to the embodiment. As shown in  FIG. 2 , the position information table contains two or three levels of indirect tables that represent position information about the correspondence between a logical position used by the host and a physical position in the data area  33 . The log control section  12  searches a logical position in the table shown at the left end of  FIG. 2  for a physical position shown at the right end thereof. The use of the position information table can fast update or reference part of data in the data area  33 . A large volume can be managed. 
         [0050]    A write process will now be described. 
         [0051]    Since the write through cache is used, the data control section  11  writes data not only to data caches  13  and  23  but also to the disk apparatus  3  during the write process.  FIG. 3  is a flowchart exemplifying operations of the write process on the storage control apparatus according to the embodiment. 
         [0052]    The data control section  11  receives a write request from the host and issues the write request to the log control section  12  (S 11 ). The log control section  12  creates a header and a trailer for data corresponding to the write request received from the data control section  11  (S 12 ). The log control section  12  writes the header, the data, and the trailer as a log format to the data area  33  of the disk apparatus  3  (S 13 ). 
         [0053]    The log control section  12  updates the position information table (S 21 ) and notifies the data control section  11  of the write completion (S 22 ). The data control section  11  receives the notification about the write completion from the log control section  12 , and then updates the data caches  13  an  23  (S 23 ) to terminate the flow. 
         [0054]    A read process will now be described. 
         [0055]    When a cache hit occurs in the data cache  13  or  23  during a read process, the storage control apparatus  1  returns data in the cache to the host. When a cache miss occurs, the storage control apparatus  1  returns data in the disk apparatus  3  to the host.  FIG. 4  is a flowchart exemplifying operations of the read process on the storage control apparatus according to the embodiment. 
         [0056]    The data control section  11  receives a read request from the host and determines whether or not the data requested from the host is hit in the data cache  13  or  23  (S 31 ). When a cache hit occurs (yes at S 31 ), the data control section  11  reads the requested data from the hit data cache and transmits the data to the host (S 32 ). The data control section  11  updates LRU information in the hit data cache (S 35 ) to terminate the flow. The data control section  11  uses the LRU in the data cache  13  to move less frequently used data from the data cache  13  to the data cache  23 . Similarly, the data control section  21  uses the LRU in the data cache  23  to move less frequently used data from the data cache  23  to the data area  33 . 
         [0057]    When a cache miss occurs (no at S 31 ), the data control section  11  issues a read request to the log control section  12  (S 41 ). The log control section  12  performs a retrieval process to retrieve a physical position on the disk apparatus  3  from a logical position of the data specified in the position information table of the position information cache  24  (S 42 ). The log control section  12  reads data at the retrieved physical position and transmits the data to the host (S 43 ) to terminate the flow. 
         [0058]    The following describes the retrieval process (S 42 ) for the position information table during the write process and the update process (S 21 ) for the same during the read process in detail. 
         [0059]    According to the embodiment, the log control section  11  controls all the position information tables in the position information caches  14  and  24 , and the position information area  34 . The log control section  12  communicates with the cache control section  21  to operate the position information cache  24 . For this communication, the log control section  12  uses the cache protocol as disclosed in patent document 3. 
         [0060]      FIG. 5  exemplifies a message structure in the cache protocol according to the embodiment. A request message is transmitted from the data control section  11  or the log control section  12  to the cache control section  21  and contains a command, an ID, and request (req) data. As a result of the request message, a response message is transmitted from the cache control section  21  to the data control section  11  and the log control section  12  and contains a command, an ID, and response (res) data. 
         [0061]      FIG. 6  exemplifies a data structure in the cache protocol according to the embodiment. Allocation request data contains a size to be allocated. Allocation response data for the allocation request data contains a pointer to the allocated position and a size. Deallocation request data contains a pointer to a position to be deallocated. Deallocation response data for the deallocation request data indicates whether or not the deallocation is successful. Read request data contains a pointer to a position to read and a size. Read response data for the read request data contains the read size and data. Write request data contains a pointer to a position to write, a size, and data. Write response data for the write request data indicates whether or not the write is successful. 
         [0062]      FIG. 7  is a flowchart exemplifying operations of retrieving and updating the position information table according to the embodiment. The log control section  12  receives a write request (during the update process) or a read request (during the retrieval process) from the data control section  11 . The log control section  12  then determines whether or not the requested data hits in the position information table of the position information cache  14  that is the fastest local cache (S 51 ). 
         [0063]    When a cache hit occurs (yes at S 51 ), control proceeds to step S 66 . When a cache miss occurs (no at S 51 ), the log control section  12  determines whether or not the cache hit occurs in the position information cache  24  (S 52 ). When the cache hit occurs (yes at S 52 ), the log control section  12  reads the corresponding position information from the position information cache  24  (S 53 ). Control proceeds to step S 61 . The log control section  12  issues a read request to the cache control section  21 . The cache control section  21  issues a read response to the log control section  12 . When the cache miss occurs (yes at S 52 ), the log control section  12  reads the corresponding position information from the position information area  34  (S 54 ). Control proceeds to step S 61 . 
         [0064]    The log control section  12  additionally writes the position information read at step S 53  or S 54  to the position information cache  14  (S 61 ). The log control section  12  updates LRU (Least Recently Used) information for the position information cache  14  (S 62 ). The log control section  12  uses the LRU for the position information cache  14  to write position information earlier than a specified time to the position information cache  24  (S 63 ). The log control section  12  issues an allocation request to the cache control section  21 . The cache control section  21  issues an allocation response to the log control section  12 . 
         [0065]    The cache control section  21  updates the LRU for the position information cache  24  (S 64 ). The log control section  12  uses the LRU for the position information cache  24  to write position information earlier than a specified time to the position information area  34  (S 65 ). The log control section  12  issues a read request to the cache control section  21 . The cache control section  21  issues a read response to the log control section  12 . The log control section  12  issues a deallocation request to the cache control section  21 . The cache control section  21  issues a deallocation response to the log control section  12 . The log control section  12  performs retrieval in the position information cache  14  and updates the position information table when needed (S 66 ). The process flow then terminates. 
         [0066]    According to the embodiment, the log control section  12  in the storage control apparatus  1  hierarchically manages the position information tables for the position information cache  14  in the storage control apparatus  1 , for the position information cache  24  in the cache apparatus  2 , and for the position information area  34  in the disk apparatus  3 . In this manner, it is possible to improve the performance of retrieving physical positions on the disk apparatus  3  during a random read and the performance of the random read for the logging operation. 
       Second Embodiment 
       [0067]    The following first describes the configuration of the storage system using the storage control apparatus according to the second embodiment. The storage system according to the second embodiment has the same configuration as the first embodiment. Both embodiments differ from each other in operations of the data control section  11  and the log control section  12 . 
         [0068]    The following describes operations of the storage control apparatus according to the second embodiment. The write and read operations for the second embodiment equal those for the first embodiment. Both embodiments differ from each other in the contents of the retrieval process (S 42 ) for the position information table during the write process and the update process (S 21 ) for the same during the read process. 
         [0069]    The following describes the retrieval process (S 42 ) for the position information table during the write process and the update process (S 21 ) for the same during the read process in detail. 
         [0070]    According to the embodiment, the log control section  12  manages the position information cache  14 . The cache control section  21  manages the position information cache  24  and the position information area  34 . The log control section  12  and the cache control section  21  communicate with each other to operate the position information cache  24  and the position information area  34 . For this communication, the log control section  12  and the cache control section  21  use the cache protocol according to the first embodiment provided with an additional protocol for table operations. 
         [0071]      FIG. 8  exemplifies a data structure in the cache protocol according to the second embodiment. Retrieval request data contains an offset indicating a logical position of targeted data and a length thereof. Retrieval response data contains a size indicating the number of blocks in a retrieval result, an offset indicating a physical position of each block, and a block length. Update request data contains a size indicating the number of blocks in targeted data, an offset indicating a logical position of each block, and a block length. Update response data indicates a successful or unsuccessful result of the process in response to the update request. 
         [0072]    Similarly to the update request, table writing request data contains a size indicating the number of blocks in targeted data, an offset indicating a logical position of each block, and a block length. Similarly to the update response, table writing response data indicates a successful or unsuccessful result of the process in response to the table writing request. Similarly to the retrieval request, table reading request data contains an offset indicating a logical position of targeted data and a length thereof. Similarly to retrieval response, table reading response data contains a size indicating the number of blocks in a read result, an offset indicating a physical position of each block, and a block length. 
         [0073]      FIG. 9  is a flowchart exemplifying operations of retrieving and updating the position information table according to the embodiment. In  FIG. 9 , operations of the cache control section  21  are shown inside a dashed frame. Operations of the log control section  12  are shown outside the frame. The data control section  11  issues a write request (during the update process) or a read request (during the retrieval process). The log control section  12  determines whether or not the requested position information hits in the position information cache  14  (S 71 ). When a cache hit occurs (yes at S 71 ), control proceeds to step S 94 . When a cache miss occurs (no at S 71 ), the log control section  12  issues a retrieval request to the cache control section  21  (S 72 ). The retrieval request designates retrieval of the targeted position information in the position information cache  24 . 
         [0074]    The cache control section  21  retrieves the requested position information in the position information cache  24  according to the retrieval request (S 73 ). The cache control section  21  determines whether or not the requested position information is found in the position information cache  24  (S 74 ). When the requested position information is found (yes at S 74 ), control proceeds to step S 94 . When the requested position information is not found (no at S 74 ), the cache control section  21  issues a table read request to the log control section  12  (S 75 ). The table read request designates to read the requested position information from the position information area  34 . The log control section  12  reads the requested position information from the position information area  34  according to the table read request (S 76 ). The log control section  12  transmits the read position information as a table read response to the cache control section  21  (S 77 ). 
         [0075]    The cache control section  21  updates the LRU for the position information cache  24  (S 81 ). Using this LRU, the cache control section  21  issues a table write request to the log control section  12  (S 82 ). The table write request designates to write position information earlier than a specified time from the position information cache  24  to the position information area  34 . The log control section  12  writes the earlier information to the position information area  34  according to the table write request (S 83 ). The log control section  12  issues a table write response indicating the write completion (S 84 ). The cache control section  21  transmits the acquired position information as a retrieval response to the log control section  12  (S 85 ). 
         [0076]    The log control section  12  adds the position information acquired from the retrieval response to the position information cache  14  (S 91 ). The log control section  12  updates the LRU for the position information cache  14  (S 92 ). Using this LRU, the log control section  12  deletes the position information earlier than a specified time from the position information cache  14  (S 93 ). The log control section  12  performs retrieval in the position information cache  14  and updates the position information table when needed (S 94 ). The process flow then terminates. 
         [0077]    According to the embodiment, the log control section  12  hierarchically manages the position information cache  14  and the cache control section  21 . Further, the cache control section  21  hierarchically manages the position information cache  14  and the position information area  34  to hierarchically use the position information area  34  in the disk apparatus  3 . In this manner, it is possible to improve the performance of retrieving physical positions on the disk apparatus  3  during a random read and the performance of the random read for the logging operation. 
         [0078]    According to the above-mentioned embodiments, the position information tables are written to the position information caches  14  and  24 , and the position information area  34 . The position information area  24  may be unnecessary when the position information cache  24  has a sufficient capacity. 
         [0079]    A data write step corresponds to steps S 11 , S 12 , S 13 , S 22 , and S 23  in the embodiment. A data read step corresponds to steps S 31 , S 41 , S 32 , S 33 , and S 43  in the embodiment. A position information control step corresponds to steps S 21  and S 42  in the embodiment. 
         [0080]    The storage control apparatus according to the embodiment can be easily applied to a storage system and can further improve its performance. 
         [0081]    A program can execute the above-mentioned steps on a computer included in the storage control apparatus and can be provided as a storage control program. The program can be stored in a computer-readable recording medium and can be executed on the computer included in the storage control apparatus. The computer-readable recording medium includes: internal storages mounted in the computer such as ROM and RAM; portable storages such as a CD-ROM, flexible disk, DVD disk, magnetic optical disk, and IC card; and a database for storing computer programs, another computer and its database, and a transmission medium over a telecommunication line.