Configuration information recovery method, device, system and disk array controller
By setting multiple configuration information versions in the physical hard disk for each disk array system in the disk array system, and determining the correct version using the version number and number of writes, the configuration recovery reliability problem caused by incomplete configuration information update is solved. Achieves stable configuration recovery of disk array groups.
Patent Information
- Application Number
- CN202410823739.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-06-25
AI Technical Summary
In disk array systems, incomplete update of configuration information leads to disordered storage system configuration information, reducing the reliability of disk array group configuration recovery.
By setting up multiple different versions of configuration information on the physical hard disk and retaining at least one of the same versions of configuration information for each disk array group, using the version number and number of writes to determine the correctly written configuration information version, ensure that the disk array group is grouped with disk array number and the number of writes. It can recover stably during configuration recovery.
Improve the reliability of disk array group configuration recovery, avoiding the reduction of fault complexity and reliability caused by configuration information disorders in the storage system.
Smart Images

Figure CN118377437B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage arrays, and in particular to a configuration information recovery method, device, system and disk array controller. Background Art
[0002] With the continuous development of computer technology, users have higher and higher demands for storage capacity, and storage systems based on disk array technology (RAID, Redundant Array of Independent Disks) have also emerged. In this type of storage system, multiple physical hard disks form a disk array group and jointly provide storage services to users, thereby meeting users' large-capacity storage needs.
[0003] In the related art, in order to improve the reliability of the disk array, each physical hard disk in the storage system needs to save the configuration information of the disk array group. However, when updating the configuration information in each physical hard disk, if the new version of the configuration information is not completely written to all physical hard disks, and a physical hard disk fails and the configuration information of the disk array group needs to be restored, the reliability of the disk array group configuration recovery will be reduced because the storage system encounters configuration information disorder. Summary of the invention
[0004] The purpose of the present invention is to provide a configuration information recovery method, device, system and disk array controller, which can ensure that there is at least one guaranteed version of configuration information in the disk array group by changing the way the physical hard disk stores the configuration information, thereby improving the reliability of the disk array group configuration recovery.
[0005] In order to solve the above technical problems, the present invention provides a configuration information recovery method, which is applied to a disk array controller, and the method comprises:
[0006] When a configuration recovery operation of a disk array group is triggered, all physical hard disks storing configuration information of the disk array group are determined; wherein the configuration information is provided with a version number and a write quantity, the write quantity represents the number of physical hard disks logically storing the configuration information, each of the physical hard disks is provided with a plurality of different versions of configuration information for the disk array group, and all the physical hard disks store at least one configuration information of the same version;
[0007] Acquire all configuration information corresponding to the disk array group from each of the physical hard disks, and determine the number of acquired configuration information of each version and the number of offline physical hard disks;
[0008] Determine the target configuration information that has been correctly written into all physical hard disks logically storing the configuration information and has the latest version according to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information;
[0009] The target configuration information is set as the restored configuration information of the disk array group.
[0010] Optionally, a plurality of disk array groups are arranged in the storage system where the disk array controller is located, and the configuration information of the disk array group is only stored in all physical hard disks belonging to the disk array group.
[0011] Optionally, the determining all physical hard disks storing the configuration information of the disk array group includes:
[0012] All physical hard disks included in the disk array group are determined to obtain the configuration information from all physical hard disks included in the disk array group.
[0013] Optionally, the determining, according to the acquisition quantity, the write quantity and the offline quantity corresponding to each version of the configuration information, the target configuration information that has been correctly written into all physical hard disks that logically store the configuration information and has the latest version includes:
[0014] According to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information, determine the correct configuration information of all physical hard disks that logically store the configuration information and have been correctly written;
[0015] If there are multiple correct configuration information, the correct configuration information with the largest version number is set as the target configuration information;
[0016] If there is one correct configuration information, the correct configuration information is set as the target configuration information.
[0017] Optionally, determining the correct configuration information of all physical hard disks that have correctly written the configuration information logically based on the acquisition quantity, the write quantity and the offline quantity corresponding to each version of the configuration information includes:
[0018] Set the configuration information of the first version as the pending configuration information;
[0019] Determine whether the difference between the written quantity of the configuration information to be processed and the acquired quantity of the configuration information to be processed is equal to the offline quantity;
[0020] If they are equal, the configuration information to be processed is marked as correct configuration information;
[0021] If not, marking the configuration information to be processed as erroneous configuration information;
[0022] Determine whether there is unmarked configuration information;
[0023] If so, the next version of the configuration information is set as the pending configuration information, and the step of determining whether the difference between the write quantity of the pending configuration information and the obtain quantity of the pending configuration information is equal to the offline quantity is entered.
[0024] Optionally, the physical hard disk is provided with two configuration information storage locations for the disk array group, for storing two adjacent versions of configuration information.
[0025] Optionally, the acquiring all configuration information corresponding to the disk array group from each of the physical hard disks includes:
[0026] Get the first physical hard disk as the configuration hard disk;
[0027] Acquire the first configuration information from the first configuration information storage location in the configuration acquisition hard disk;
[0028] Acquire the second configuration information from the second configuration information storage location in the configuration acquisition hard disk;
[0029] Determine whether there is a physical hard disk for which configuration information has not been obtained;
[0030] If it exists, the next physical hard disk is set as the configuration acquisition hard disk, and the step of acquiring the first configuration information from the first configuration information storage location in the configuration acquisition hard disk is entered.
[0031] Optionally, before acquiring the first configuration information from the first configuration information storage location in the configuration acquisition hard disk, the method further includes:
[0032] Determine whether the hard disk can be accessed by the configuration;
[0033] If the access is not possible, the number of failures is increased by one, and the process proceeds to the step of determining whether there is a physical hard disk for which the configuration information has not been obtained; the initial value of the number of failures is zero.
[0034] If it is accessible, the process proceeds to the step of obtaining the first configuration information from the first configuration information storage location in the configuration hard disk.
[0035] Optionally, it also includes:
[0036] When a configuration update operation of a disk array group is triggered, generating new version configuration information for the disk array group;
[0037] For each physical hard disk in the disk array group, determining whether a first configuration information storage location in the physical hard disk stores configuration information;
[0038] If the first configuration information storage location does not store the configuration information, storing the new version of the configuration information in the first configuration information storage location;
[0039] If the first configuration information storage location has stored the configuration information, determining whether the configuration information stored in the first configuration information storage location is a previous version of the new version configuration information;
[0040] If it is the previous version, writing the new version configuration information into the second configuration information storage location in the physical hard disk;
[0041] If it is not the previous version, the new version configuration information is written into the first configuration information storage location.
[0042] Optionally, generating new version configuration information for the disk array group includes:
[0043] Add one to the version number of the previous version of the configuration information to obtain the version number of the new version of the configuration information;
[0044] The current number of online physical hard disks in the disk array group is determined, and the number of online physical hard disks is set as the write number of the new version configuration information.
[0045] Optionally, trigger a configuration update operation of the disk array group, including:
[0046] When receiving the configuration update information sent by the host, the configuration update operation of the disk array group is triggered.
[0047] Optionally, after writing the new version configuration information to the physical hard disks in the disk array group, the method further includes:
[0048] Only when it is determined that the new version of the configuration information has been correctly written into each physical hard disk in the disk array group, configuration update success information is returned to the host.
[0049] Optionally, after setting the target configuration information as the restored configuration information of the disk array group, the method further includes:
[0050] Determine whether the physical hard disk stores erroneous configuration information with a version number greater than the restored configuration information;
[0051] If so, the erroneous configuration information is invalidated.
[0052] Optionally, after setting the target configuration information as the restored configuration information of the disk array group, the method further includes:
[0053] The user data in each of the physical hard disks is accessed according to the restored configuration information.
[0054] The present invention also provides a configuration information recovery device, which is applied to a disk array controller, and the device comprises:
[0055] A physical hard disk determination module is used to determine all physical hard disks storing configuration information of the disk array group when a configuration recovery operation of the disk array group is triggered; wherein the configuration information is provided with a version number and a write quantity, the write quantity represents the number of physical hard disks logically storing the configuration information, each of the physical hard disks is provided with a plurality of different versions of configuration information for the disk array group, and all the physical hard disks store at least one configuration information of the same version;
[0056] An acquisition module, used for acquiring all configuration information corresponding to the disk array group from each physical hard disk, and determining the acquisition quantity of each version of configuration information and the offline quantity of the physical hard disk;
[0057] A screening module, for determining the target configuration information which has been correctly written into all the physical hard disks which logically store the configuration information and has the latest version according to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information;
[0058] The configuration recovery module is used to set the target configuration information as the recovered configuration information of the disk array group.
[0059] The present invention also provides a storage system, comprising:
[0060] The disk array controller is used to execute the configuration information recovery method as described above.
[0061] Multiple physical hard disks are used to store configuration information of a disk array group. The configuration information is provided with a version number and a write quantity. Each of the physical hard disks is provided with multiple different versions of configuration information for the disk array group. The write quantity represents the number of physical hard disks that logically store the configuration information.
[0062] Optionally, a plurality of disk array groups are provided in the storage system, and configuration information of the disk array group is stored only in all physical hard disks belonging to the disk array group.
[0063] The present invention also provides a disk array controller, comprising:
[0064] Memory for storing computer programs;
[0065] A processor is used to implement the configuration information recovery method as described above when executing the computer program.
[0066] The present invention also provides a computer program product, comprising a computer program / instruction, wherein the computer program / instruction implements the steps of the configuration information recovery method as described above when executed by a processor.
[0067] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the configuration information recovery method as described above is implemented.
[0068] The present invention provides a configuration information recovery method, which is applied to a disk array controller. The method comprises: when a configuration recovery operation of a disk array group is triggered, all physical hard disks storing the configuration information of the disk array group are determined; wherein the configuration information is provided with a version number and a write quantity, the write quantity represents the number of physical hard disks logically storing the configuration information, each of the physical hard disks is provided with a plurality of different versions of configuration information for the disk array group, and all the physical hard disks store at least one configuration information of the same version; all configuration information corresponding to the disk array group is obtained from each of the physical hard disks, and the number of obtained configuration information of each version and the number of offline physical hard disks are determined; according to the number of obtained configuration information, the number of write configuration information and the number of offline configuration information corresponding to each version of the configuration information, the target configuration information having the latest version correctly written into all the physical hard disks logically storing the configuration information is determined; and the target configuration information is set as the recovered configuration information of the disk array group.
[0069] The beneficial effects of the present invention are as follows: the configuration information of the disk array group in the present invention is provided with a version number and a write quantity, and the write quantity represents the number of physical hard disks that logically store the configuration information; in addition, the physical hard disks in the present invention are provided with multiple different versions of configuration information for the disk array group, and for the same disk array group, all physical hard disks store at least one configuration information of the same version, that is, the disk array group has at least one guaranteed version of configuration information. Furthermore, when the configuration recovery operation of the disk array group is triggered, the disk array controller can determine all physical hard disks storing the configuration information of the disk array group, and can obtain all configuration information corresponding to the disk array group from each physical hard disk, and can determine the acquisition quantity of each version of the configuration information and the offline quantity of the physical hard disk; then, the disk array controller can determine the target configuration information that has been correctly written into all the physical hard disks that logically store the configuration information and has the latest version according to the acquisition quantity, write quantity and offline quantity corresponding to each version of the configuration information, that is, it can filter out the erroneous configuration information version that has not been completely written into all the physical hard disks according to the acquisition quantity, write quantity and offline quantity, and can stably restore the configuration of the disk array group according to the target configuration information that has been correctly written into all the physical hard disks that logically store the configuration information and has the latest version, so that the storage system information disorder can be eliminated and the reliability of the disk array group configuration recovery can be improved. The present invention also provides a configuration information recovery device, a storage system, a disk array controller, a computer program product and a computer-readable storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0071] Figure 1 A schematic diagram of a physical hard disk storing disk array group configuration information in the related technology provided by an embodiment of the present invention;
[0072] Figure 2 A structural block diagram of a storage system provided by an embodiment of the present invention;
[0073] Figure 3 A flowchart of a configuration information recovery method provided by an embodiment of the present invention;
[0074] Figure 4 A schematic diagram of a first type of configuration information storage provided by an embodiment of the present invention;
[0075] Figure 5A flowchart of a configuration information update process provided by an embodiment of the present invention;
[0076] Figure 6 A schematic diagram of a second type of configuration information storage provided by an embodiment of the present invention;
[0077] Figure 7 A flowchart of a configuration recovery process provided by an embodiment of the present invention;
[0078] Figure 8 A schematic diagram of updating configuration information provided by an embodiment of the present invention;
[0079] Fig. 9 A schematic diagram of configuration information recovery provided by an embodiment of the present invention;
[0080] Fig.10 A schematic diagram of another configuration information recovery provided by an embodiment of the present invention;
[0081] Fig.11 A structural block diagram of a configuration information recovery device provided by an embodiment of the present invention;
[0082] Fig.12 A structural block diagram of a disk array controller provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0083] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0084] With the continuous development of computer technology, users have higher and higher demands for storage capacity, and storage systems based on disk array technology (RAID, Redundant Array of Independent Disks) have also emerged. In this type of storage system, multiple physical hard disks form a disk array group (RAID group) and jointly provide storage services to users, thereby meeting users' large-capacity storage needs.
[0085] In the related art, in order to improve the reliability of the disk array, each physical hard disk in the storage system needs to save the configuration information of the disk array group. These configuration information are generally saved in the device data format area (DDF, Device Data Format) of the physical hard disk. In addition, each physical hard disk needs to save the configuration information of all disk array groups, regardless of whether the physical hard disk belongs to the disk array group. Due to the large number of physical hard disks, and when updating the above configuration information, each configuration information in all physical hard disks needs to be updated, which can easily cause the storage system to encounter a disorder in the disk array group configuration, thereby reducing the reliability of the disk array configuration recovery when the storage system encounters a failure. The management method of configuration information in the related art is as follows: Figure 1 As shown, Figure 1 This is a schematic diagram of a physical hard disk storing disk array group configuration information in the related technology provided by an embodiment of the present invention. Figure 1 In the scenario shown, the user uses two physical hard disks pd0 and pd1 to configure a RAID0, and uses four physical hard disks pd2, pd3, pd4, and pd5 to configure a RAID1. The DDF area of pd0~5 stores the full disk array group information of RAID0 and RAID1, where Seq_Num (Sequence_Number) is the version number of the configuration information. If pd0 has been updated but the remaining pds have not been updated during the configuration information update process, the configuration information of pd0 and pd1~5 will be different, and the Seq_Num value recorded in pd0 is the largest, indicating that it has the latest version of the configuration information. If the storage system encounters a fault at this time, it will not be able to reliably restore the configuration information of the disk array group. For example, if the damaged physical hard disk is pd1, the storage system may recover with the configuration information version with Seq_Num 4 or with Seq_Num 3; if the damaged physical hard disk is pd0, the storage system may recover with the configuration information version with Seq_Num 3. It can be seen that in the above scenario, the storage system cannot reliably and stably recover the configuration information; and the stability of the recovery of the configuration information is easily affected by the specific damage of the physical hard disk. In other cases, if the number of disk array groups is larger, the reliability of the storage system in recovering the disk array group configuration information is lower, and the recovery complexity is higher.
[0086] In view of this, an embodiment of the present invention can provide a configuration information recovery method, which can ensure that the disk array group has at least one guaranteed version of configuration information by changing the way the physical hard disk stores configuration information, thereby improving the reliability of disk array group configuration recovery.
[0087] For ease of understanding, the following will first introduce the storage system structure applicable to the embodiment of the present invention. Figure 2 , Figure 2 The structural block diagram of a storage system provided by an embodiment of the present invention includes a disk array controller 10 and multiple physical hard disks 20. The disk array controller 10 is the execution subject of the method provided by the embodiment of the present invention; multiple physical hard disks 20 can form one or more disk array groups, and the number of physical hard disks 20 included in each disk array group can be different, and the composition mode of each disk array group can be different, for example, RAID0, RAID1, RAID5, etc. It should be pointed out that each physical hard disk 20 can save the configuration information of all disk array groups; considering that all physical hard disks 20 save the configuration information of all disk array groups, it will cause the update time of the configuration information to be too long, seriously affecting the update success rate of the configuration information, and bringing a higher risk of disorder to the storage system, therefore, in the embodiment of the present invention, each physical hard disk 20 can also save only the configuration information of the disk array group to which it belongs. In this way, when updating the configuration information, it is only necessary to update the configuration information in the physical hard disks 20 belonging to the disk array group.
[0088] Furthermore, in the related art, each physical hard disk 20 only stores one copy of the configuration information of the disk array group, which easily causes the storage system to encounter a disorder in the configuration information of the disk array group. In the embodiment of the present invention, for the same disk array group, each physical hard disk 20 can store multiple versions of configuration information. Among them, for all physical hard disks 20 that store the same disk array configuration information (such as all physical hard disks 20 belonging to the same disk array group), they store at least one configuration information of the same version. For example, the physical hard disks pd0~3 all store the configuration information of the RAID5 group, then in one possible case, pd0~3 all store the configuration information of the RAID5 group with version number 3. In addition, pd0~3 can also store configuration information of other version numbers, such as pd0 can also store configuration information with version number 4, and pd1~3 can also store configuration information with version number 2; for another example, pd0~3 also store configuration information with version number 4. It can be seen that among all the configuration information versions of the RAID5 group saved in the physical hard disks pd0~3, there is at least one configuration information version that exists in all physical hard disks pd0~3. This configuration information version can be used as the most reliable and guaranteed configuration information message to ensure that the storage system can stably restore configuration information with high reliability at any stage.
[0089] It should be noted that the embodiment of the present invention does not limit the number of physical hard disks 20, which can be set according to actual application requirements. The embodiment of the present invention also does not limit the specific hardware structure of the disk array controller 10 and the physical hard disk 20 and the communication method between them, which can be set according to the relevant technology of the storage system and actual application requirements.
[0090] Based on the above storage system structure introduction, the configuration information recovery method provided by the embodiment of the present invention will be introduced below. Figure 3 , Figure 3 A flowchart of a configuration information recovery method provided by an embodiment of the present invention, which is applied to a disk array controller, and the method includes:
[0091] S301. When a configuration recovery operation of a disk array group is triggered, all physical hard disks storing configuration information of the disk array group are determined; wherein the configuration information is provided with a version number and a write quantity, the write quantity represents the number of physical hard disks logically storing the configuration information, each of the physical hard disks is provided with a plurality of different versions of configuration information for the disk array group, and all the physical hard disks store at least one configuration information of the same version.
[0092] In the embodiment of the present invention, the configuration recovery operation represents the recovery of the configuration information of the disk array group, and the operation can be used after the storage system encounters abnormal power failure or physical hard disk failure. As described above, in order to improve the reliability of configuration information recovery, the physical hard disks in the embodiment of the present invention are provided with multiple different versions of configuration information for the disk array group. Moreover, for all physical hard disks storing the configuration information of the same disk array group, these physical hard disks store at least one configuration information of the same version as a reliable backup version. It should be noted that the embodiment of the present invention does not limit the number of configuration information versions that can be saved by each physical hard disk, which should be at least two different versions, which can be set according to actual application requirements. In order to further improve the reliability of configuration information recovery, each physical hard disk can store two adjacent versions of configuration information for the disk array group. At this time, considering that the present embodiment has clearly emphasized that these physical hard disks store at least one configuration information of the same version, the disk array controller can restore the latest configuration information version of the disk array group in the best case, and at least restore the second latest configuration information version of the disk array group, thereby ensuring the reliability of the recovery of the disk array group configuration information.
[0093] Furthermore, to facilitate configuration information acquisition, the physical hard disk is provided with two fixed configuration information storage locations for the disk array group, which are used to store two adjacent versions of configuration information. When updating configuration information, the two configuration information storage locations can be updated alternately. For example, for configuration information with version number 1, it can be updated in the first configuration information storage location; for configuration information with version number 2, it can be updated in the second configuration information storage location; for configuration information with version number 3, it can be updated in the first configuration information storage location, overwriting version 1, and so on. Please refer to Figure 4 , Figure 4The first configuration information storage diagram provided by the embodiment of the present invention is shown in FIG. 1 , wherein the physical hard disks pd0 and 1 form a RAID0 group, pd0 contains DDF0 and DDF1 areas, DDF0 stores configuration information with a version number of 4 and a write quantity of 2, and DDF1 stores configuration information with a version number of 3 and a write quantity of 2, and the same is true for pd1.
[0094] Furthermore, in order to facilitate the screening of reliable configuration information versions, the embodiment of the present invention can also add a write number (PD_Wt_Num) to the configuration information, which represents the number of physical hard disks that logically store the configuration information. In this way, the present invention can compare the write number with the number of physical hard disks that actually store the configuration information of this version, so as to determine whether the configuration information of this version has been correctly written into all physical hard disks that store the configuration information of the disk array group, and thus determine whether the configuration information of this version is reliable.
[0095] Furthermore, a plurality of disk array groups may be provided in the storage system where the disk array controller is located, and the composition of these disk array groups may be arbitrarily selected, and the number of physical hard disks that each disk array group may contain may be arbitrarily selected. In addition, in order to reduce the possibility of configuration information disorder in the storage system and improve the success rate of configuration information update, the configuration information of the disk array group is only stored in all physical hard disks belonging to the disk array group. In this way, when updating the configuration information, it is only necessary to update the physical hard disks in the disk array group; and when performing a configuration recovery operation of the disk array group, it is only necessary to recover the configuration information recorded by the physical hard disks in the disk array group.
[0096] Based on this, determining all physical hard disks storing the configuration information of the disk array group may include:
[0097] Step 11: Determine all physical hard disks included in the disk array group to obtain the configuration information from all physical hard disks included in the disk array group.
[0098] It is worth pointing out that since the embodiment of the present invention only uses the configuration information of the physical hard disks in the disk array group to save in the group, the configuration information of the specified disk array group can be restored, without having to restore only the configuration information of all disk array groups at the same time as in the related art, thereby improving the flexibility of configuration information recovery.
[0099] Furthermore, the embodiments of the present invention do not limit the specific content that the above configuration information may include, and may be set according to actual application requirements. For example, the content that the configuration information may include is shown in the following table:
[0100] Table 1 DDF structure
[0101] content DDF Header Controller data Physical hard disk record Virtual Hard Disk Record Configuration Records Physical hard disk data Bad block management log Diagnostic Space Special logs
[0102] The table above shows the contents of each section of the DDF configuration structure. The DDF Header is stored at the MAX_LBA (maximum logical space address) of the hard disk, and contains the LBA logical space address pointing to other sections, which is used to address and locate each section. The Controller Data mainly contains the RAID card controller information, so as to distinguish the RAID card controllers produced by different manufacturers to operate the DDF structure. The Configuration Records mainly contain the basic information of the RAID group. The Physical Disk Records mainly contain the information of the physical hard disk connected to the RAID card controller for configuration. The Virtual Disk Records mainly contain the configuration information of all logical volumes that have been configured on the RAID group. The Physical Disk Data mainly contains the information of the physical hard disk that has been converted from a hot spare disk to a member disk. When a hot spare disk is converted to a member disk, it will become a member disk permanently, and the hot spare disk information related to RAID will be deleted. The Bad Block Management Log mainly contains the bad blocks of the hard disk and the mapping relationship between the bad blocks. The Diagnostic Space is mainly used for destructive read / write tests of physical hard disks. The Vendor Special logs mainly record some special logs.
[0103] The DDF Header contains a Sequence_Number field, which is 4 bytes in size. Every time the configuration data of the RAID card needs to be updated and the DDF structure needs to be written, the Sequence_Number value needs to be increased by 1. When the DDF configuration data needs to be restored, by comparing the values of the Sequence_Number field, it can be determined whether the DDF configurations in different physical hard disks are the same.
[0104] S302: Acquire all configuration information corresponding to the disk array group from each physical hard disk, and determine the acquired quantity of each version of configuration information and the offline quantity of the physical hard disk.
[0105] In this step, in addition to obtaining the configuration information corresponding to the disk array group from each physical hard disk, it is also necessary to determine the number of each version of configuration information obtained and the number of offline physical hard disks. As described above, the basis for determining whether a configuration information version is reliable in the embodiment of the present invention is: determining whether the number of physical hard disks that logically store the configuration information of this version is consistent with the number of physical hard disks that actually store the configuration information of this version. If they are consistent, it means that the configuration information version is reliable; if they are inconsistent, it means that the configuration information version is unreliable. However, for a physical hard disk that fails and is offline, the disk array controller will not be able to obtain configuration information from it, which will affect the statistics of the number of physical hard disks that actually store the configuration information. Therefore, the embodiment of the present invention can also count the number of offline physical hard disks to use the offline number to correct the number of physical hard disks that actually store the configuration information.
[0106] Furthermore, as described above, the physical hard disk may be provided with two fixed configuration information storage locations for the disk array group, so in this step, each configuration information storage location of each physical hard disk may be traversed to obtain all configuration information corresponding to the disk array group.
[0107] Based on this, the step of obtaining all configuration information corresponding to the disk array group from each physical hard disk includes:
[0108] Step 21: Use the first physical hard disk as the configuration to obtain the hard disk;
[0109] Step 22: Acquire the first configuration information from the first configuration information storage location in the configuration acquisition hard disk;
[0110] Step 23: Acquire the second configuration information from the second configuration information storage location in the configuration acquisition hard disk;
[0111] Step 24: Determine whether there is a physical hard disk for which the configuration information has not been obtained; if so, proceed to step 25; if not, proceed to step 26;
[0112] Step 25: Set the next physical hard disk as the configuration acquisition hard disk, and proceed to the step of acquiring the first configuration information from the first configuration information storage location in the configuration acquisition hard disk.
[0113] Step 26: Exit Acquisition.
[0114] It should be noted that the embodiment of the present invention does not limit the storage location of the physical hard disk where the first configuration information storage location and the second configuration information storage location are set, and can be set according to actual application requirements. For example, it can be set according to the location of the existing DDF area.
[0115] Furthermore, the disk array controller may also detect the faulty offline state of the physical hard disk during the process of acquiring configuration information from the physical hard disk, thereby counting the number of offline physical hard disks.
[0116] Based on this, before acquiring the first configuration information from the first configuration information storage location in the configuration acquisition hard disk, the method may further include:
[0117] Step 31: Determine whether the hard disk obtained by the configuration is accessible; if not, proceed to step 32; if accessible, proceed to step 33;
[0118] Step 32: Add one to the fault number and proceed to the step of determining whether there is a physical hard disk for which configuration information has not been obtained; the initial value of the fault number is zero.
[0119] Step 33: Enter the step of obtaining the first configuration information from the first configuration information storage location in the configuration hard disk.
[0120] S303: Determine the target configuration information that has been correctly written into all the physical hard disks that logically store the configuration information and has the latest version according to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information.
[0121] In this step, the acquisition number indicates the number of physical hard disks that have stored the configuration information of this version and are online, and the write number indicates the number of physical hard disks that logically store the configuration information of this version. After obtaining the acquisition number, the write number, and the offline number, the embodiment of the present invention can use these three numbers to filter the correct configuration information of all physical hard disks that have correctly written the configuration information logically. In addition, if there are multiple versions of the correct configuration information, in order to ensure the timeliness of the configuration information, the correct configuration information with the latest version can also be used as the target configuration information that needs to be restored in the end.
[0122] Based on this, the target configuration information with the latest version that has been correctly written into all physical hard disks that logically store the configuration information is determined according to the acquisition quantity, the write quantity and the offline quantity corresponding to each version of the configuration information, including:
[0123] Step 41: determining the correct configuration information of all physical hard disks that have been correctly written to logically store the configuration information according to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information;
[0124] Step 42: If there are multiple correct configuration information, set the correct configuration information with the largest version number as the target configuration information;
[0125] Step 43: If there is one correct configuration information, set the correct configuration information as the target configuration information.
[0126] Furthermore, the embodiment of the present invention can filter the correct configuration information according to the quantitative relationship between the acquisition quantity, the write quantity and the offline quantity of the physical hard disk corresponding to each version of the configuration information. Specifically, it can be determined whether the difference between the write quantity of each version of the configuration information and the acquisition quantity of the configuration information of the version is equal to the offline quantity. If they are equal, it means that the version is normal; if not, it means that the version is abnormal.
[0127] Based on this, the determination of the correct configuration information of all physical hard disks that have correctly written the configuration information logically according to the acquisition quantity, the write quantity and the offline quantity corresponding to each version of the configuration information includes:
[0128] Step 51: Setting the configuration information of the first version as the configuration information to be processed;
[0129] Step 52: Determine whether the difference between the number of written configuration information to be processed and the number of acquired configuration information to be processed is equal to the offline number;
[0130] Step 53: If they are equal, marking the configuration information to be processed as correct configuration information;
[0131] Step 54: If not, marking the configuration information to be processed as erroneous configuration information;
[0132] Step 55: Determine whether there is unmarked configuration information;
[0133] Step 56: If it exists, then set the next version of configuration information as the pending configuration information, and proceed to the step of determining whether the difference between the write quantity of the pending configuration information and the obtain quantity of the pending configuration information is equal to the offline quantity.
[0134] It can be seen that the embodiment of the present invention can effectively screen reliable configuration information by setting multiple versions of configuration information of the disk array group in the physical hard disk, ensuring that all physical hard disks store at least one same version of configuration information of the disk array group, and increasing the number of writes in the configuration information, thereby improving the recovery reliability of the disk array group configuration information.
[0135] S304: Set the target configuration information as the restored configuration information of the disk array group.
[0136] After determining the target configuration information, the disk array controller only needs to restore the disk array group according to the configuration information.
[0137] Furthermore, since the physical hard disk is provided with two fixed configuration information storage locations for the disk array group, which are used to store two adjacent versions of configuration information; and when the configuration information is restored, the disk array controller may only update part of the physical hard disks, but not update the remaining physical hard disks, which results in some physical hard disks storing the latest configuration information that cannot be restored. At this time, the latest configuration information is erroneous configuration information. It is understandable that the version of the erroneous configuration information will be higher than the target configuration information to be restored. In order to avoid the influence of the erroneous configuration information on the subsequent configuration information update and recovery, after obtaining the target configuration information, the present invention can also detect the two versions of configuration information stored in the physical hard disk, and determine whether the physical hard disk stores erroneous configuration information with a version number greater than the restored configuration information. If so, the erroneous configuration information is invalidated, such as deleted or rolled back.
[0138] Based on this, after setting the target configuration information as the restored configuration information of the disk array group, the method may further include:
[0139] Step 61: Determine whether the physical hard disk stores erroneous configuration information whose version number is greater than the restored configuration information;
[0140] Step 62: If yes, invalidate the erroneous configuration information.
[0141] Furthermore, after obtaining the restored configuration information, the disk array controller may access the user data in each of the physical hard disks according to the restored configuration information to ensure that the user data is correctly obtained from the physical hard disks.
[0142] Based on this, after setting the target configuration information as the restored configuration information of the disk array group, the method further includes:
[0143] Step 71: Access user data in each of the physical hard disks according to the restored configuration information.
[0144] Based on the above embodiments, the configuration information of the disk array group in the present invention is provided with a version number and a write quantity, and the write quantity represents the number of physical hard disks that logically store the configuration information; in addition, the physical hard disks in the present invention are provided with multiple different versions of configuration information for the disk array group, and for the same disk array group, all physical hard disks store at least one configuration information of the same version, that is, the disk array group has at least one guaranteed version of configuration information. Furthermore, when the configuration recovery operation of the disk array group is triggered, the disk array controller can determine all physical hard disks storing the configuration information of the disk array group, and can obtain all the configuration information corresponding to the disk array group from each physical hard disk, and can determine the acquisition quantity of each version of the configuration information and the offline quantity of the physical hard disks; subsequently, the disk array controller can determine the target configuration information that has been correctly written into all the physical hard disks that logically store the configuration information and has the latest version according to the acquisition quantity, write quantity and offline quantity corresponding to each version of the configuration information, that is, it can filter out the erroneous configuration information version that has not been completely written into all the physical hard disks according to the acquisition quantity, write quantity and offline quantity, and can stably restore the configuration of the disk array group according to the target configuration information that has been correctly written into all the physical hard disks that logically store the configuration information and has the latest version, thereby storing system information disorder and improving the reliability of the disk array group configuration recovery.
[0145] Based on the above embodiment, the updating process of the configuration information is introduced below. In a possible situation, the method may also include:
[0146] S401. When a configuration update operation of a disk array group is triggered, generate new version configuration information for the disk array group.
[0147] In this step, the configuration update operation indicates that the configuration information of the disk array group needs to be updated. It should be noted that the configuration update operation can be triggered by the disk array controller or by the host. It is worth noting that since the embodiment of the present invention only uses the configuration information of the physical hard disks in the disk array group to save in the group, the host can flexibly specify which disk array group's configuration information is to be restored.
[0148] Based on this, triggering the configuration update operation of the disk array group may include:
[0149] Step 71: upon receiving the configuration update information sent by the host, triggering the configuration update operation of the disk array group.
[0150] Furthermore, the embodiment of the present invention does not limit the specific method of generating the new version configuration information for the disk array group, but it should be pointed out that: the version number in the new version configuration information needs to be increased by one based on the previous version number; since the new version configuration information cannot be written into the faulty offline physical hard disk in the disk array group, the current number of online physical hard disks in the disk array group will be determined, and the number of online physical hard disks will be set as the number of writes for the new version configuration information. Subsequently, the new version configuration information can be written into the online physical hard disks in the disk array group.
[0151] Based on this, generating new version configuration information for the disk array group may include:
[0152] Step 81: Add one to the version number of the previous version of the configuration information to obtain the version number of the new version of the configuration information;
[0153] Step 82: Determine the current number of online physical hard disks in the disk array group, and set the number of online physical hard disks as the write number of the new version configuration information.
[0154] S402: For each physical hard disk in the disk array group, determine whether a first configuration information storage location in the physical hard disk stores configuration information.
[0155] When writing the new version of configuration information to each physical hard disk, it is first necessary to determine which configuration information storage location in the physical hard disk to write the new version of configuration information to. Specifically, the present invention can first determine whether the first configuration information storage location in the physical hard disk has configuration information stored. If no configuration information is stored, it can be written directly; if the configuration information is already stored, it is necessary to compare the version numbers.
[0156] S403: If the first configuration information storage location does not store the configuration information, store the new version configuration information in the first configuration information;
[0157] S404: If the configuration information has been stored in the first configuration information storage location, determine whether the configuration information stored in the first configuration information storage location is a previous version of the new version configuration information.
[0158] If the configuration information has been stored in the first configuration information storage location, this step will determine whether the configuration information stored in the first configuration information storage location is the previous version of the new version configuration information. If it is not the previous version, it means that the configuration information in the first configuration information storage location needs to be overwritten, and then only the new version configuration information needs to be written to the location; if it is the previous version, it means that the configuration information in the second configuration information storage location in the physical hard disk needs to be overwritten, and then the new version configuration information can be written to the second configuration information storage location.
[0159] S405: If it is the previous version, write the new version configuration information into the second configuration information storage location in the physical hard disk.
[0160] S406: If it is not the previous version, write the new version configuration information into the first configuration information storage location.
[0161] Finally, if the configuration update operation is initiated by the host, the disk array controller can return the configuration update success information to the host only when it determines that the new version configuration information has been correctly written to each physical hard disk in the disk array group, so as to ensure the reliability of the configuration update.
[0162] Based on this, after writing the new version configuration information to the physical hard disks in the disk array group, the method further includes:
[0163] Step 91: Only when it is determined that the new version configuration information has been correctly written into each physical hard disk in the disk array group, return configuration update success information to the host.
[0164] Based on the above embodiment, the above method is fully introduced below based on a specific flowchart. Figure 5 , Figure 5 A flowchart of a configuration information update process provided by an embodiment of the present invention. The configuration update process is as follows:
[0165] Step 1: User configures RAID group;
[0166] Step 2: Traverse the hard disk information of the RAID group configured by the user;
[0167] Step 3: Store the user-configured RAID group configuration in the DDF configuration structure of each hard disk according to the hard disk information. It is not necessary to store the RAID group configuration in each hard disk under the RAID card.
[0168] Please refer to Figure 6 , Figure 6 A schematic diagram of the second configuration information storage provided by an embodiment of the present invention. In the scenario shown in the figure, the user uses pd2~5 hard disks to create a RAID5 of 4 disks. According to the user's configuration, the DDF configuration information of raid5 is first written to the DDF0 copy area of pd2~5, where the Sequence_Number value is 1 and the PD_Write_Number is 4. After the second configuration update, the DDF configuration information of raid5 is written to the DDF1 copy area of pd2~5, where the Sequence_Number value is 2 and the PD_Write_Number is 4.
[0169] Please refer to Figure 7 , Figure 7 This is a flow chart of a configuration recovery process provided by an embodiment of the present invention. The specific configuration recovery process is as follows:
[0170] Step 1: Traverse all hard disk information under the RAID group;
[0171] Step 2: Read the Sequence_Number value and PD_Write_Number value of the ddf0 copy area in each hard disk;
[0172] Step 3: Read the Sequence_Number value and PD_Write_Number value of the ddf1 copy area in each hard disk;
[0173] Step 4: Confirm the correct and latest configuration of the storage area in the hard disk by comparing the Sequence_Number value and PD_Write_Number value of the ddf0 copy area and the ddf1 copy area;
[0174] Step 5: Restore the user configuration based on the confirmed reliable DDF configuration.
[0175] Please refer to Figure 8 , Figure 8 A schematic diagram of updating configuration information provided by an embodiment of the present invention. A user uses pd2, pd3, pd4, and pd5 hard disks to create a RAID5 with 4 disks. When updating the configuration before configuration recovery, the DDF1 area of pd2 successfully writes the DDF configuration data, the Sequence_Number value is updated to 5, and the PD_Write_Number is 4; the DDF1 area of pd3, pd4, and pd5 fails to write, and the old DDF configuration data is stored.
[0176] Please refer to Fig. 9 , Fig. 9 A schematic diagram of configuration information recovery provided by an embodiment of the present invention. If the pd2 hard disk fails or is pulled out by the user, the DDF configuration in the DDF0 area of the pd3, pd4, and pd5 hard disks is read during recovery. Sequence_Number=4, PD_Write_Number=4, the actual number of hard disks with the same configuration PD_DDF_Number = 3, the number of failed member disks of the raid5 PD_Failed_Number=1, PD_DDF_Number = PD_Write_Number - PD_Failed_Number.
[0177] In the DDF configuration of the DDF1 area of the pd3, pd4, and pd5 hard disks, Sequence_Number=3, PD_Write_Number=4. The actual number of hard disks with the same configuration is PD_DDF_Number = 3. The number of failed member disks of the raid5 is PD_Failed_Number=1. PD_DDF_Number = PD_Write_Number - PD_Failed_Number.
[0178] By comparing DDF0: Sequence_Number>DDF1: Sequence_Number and DDF0:PD_Write_Number satisfies PD_DDF_Number ==PD_Write_Number - PD_Failed_Number; it can be confirmed that the configuration of the DDF0 area of PD3, PD4, and PD5 is the correct and latest configuration.
[0179] Please refer to Fig.10 , Fig.10 A schematic diagram of another configuration information recovery provided by an embodiment of the present invention. If the pd3 hard disk fails or is pulled out by the user, the DDF configuration in the DDF0 area of the pd2, pd4, and pd5 hard disks is read during recovery. Sequence_Number=4, PD_Write_Number=4, the actual number of hard disks with the same configuration PD_DDF_Number=3, the number of failed member disks of the raid5 PD_Failed_Number=1, PD_DDF_Number=PD_Write_Number-PD_Failed_Number.
[0180] In the DDF configuration of the DDF1 area of the pd2, pd4, and pd5 hard disks, the maximum Sequence_Number is 5, PD_Write_Number is 4, the actual number of hard disks with the same configuration is PD_DDF_Number = 1, the number of failed member disks of the raid5 is PD_Failed_Number = 1, and PD_DDF_Number ≠ PD_Write_Number - PD_Failed_Number.
[0181] By comparing DDF0: Sequence_Number>DDF1: Sequence_Number and DDF0:PD_Write_Number satisfies PD_DDF_Number ==PD_Write_Number - PD_Failed_Number; it can be confirmed that the configuration of the DDF0 area of PD2, PD4, and PD5 is the latest, correct, and complete configuration.
[0182] Therefore, it can be determined that by adopting the "ping-pong" configuration method combined with the comparison of Sequence_Number and PD_Write_Number in the configuration, the latest, complete and correct user data configuration can be restored in the event of a hard disk failure when restoring the configuration.
[0183] The following is an introduction to a configuration information recovery device, a storage system, a disk array controller, a computer program product, and a computer-readable storage medium provided in an embodiment of the present invention. The configuration information recovery device, the storage system, the disk array controller, the computer program product, and the computer-readable storage medium described below can be referenced to each other in correspondence with the configuration information recovery method described above.
[0184] Please refer to Fig.11 , Fig.11 A structural block diagram of a configuration information recovery device provided by an embodiment of the present invention, the device is applied to a disk array controller and may include:
[0185] The physical hard disk determination module 1101 is used to determine all physical hard disks storing configuration information of the disk array group when a configuration recovery operation of the disk array group is triggered; wherein the configuration information is provided with a version number and a write quantity, the write quantity represents the number of physical hard disks logically storing the configuration information, each of the physical hard disks is provided with a plurality of different versions of configuration information for the disk array group, and all the physical hard disks store at least one configuration information of the same version;
[0186] The acquisition module 1102 is used to acquire all configuration information corresponding to the disk array group from each physical hard disk, and determine the acquired quantity of each version of configuration information and the offline quantity of the physical hard disk;
[0187] The screening module 1103 is used to determine the target configuration information that has been correctly written into all physical hard disks that logically store the configuration information and has the latest version according to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information;
[0188] The configuration recovery module 1104 is configured to set the target configuration information as the recovered configuration information of the disk array group.
[0189] Optionally, a plurality of disk array groups are arranged in the storage system where the disk array controller is located, and the configuration information of the disk array group is only stored in all physical hard disks belonging to the disk array group.
[0190] Optionally, the physical hard disk determination module 1101 is specifically configured to:
[0191] All physical hard disks included in the disk array group are determined to obtain the configuration information from all physical hard disks included in the disk array group.
[0192] Optionally, the screening module 1103 may include:
[0193] A screening submodule, for determining the correct configuration information of all physical hard disks that have been correctly written to logically store the configuration information according to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information;
[0194] A first setting submodule, configured to set the correct configuration information having the largest version number as the target configuration information if there are multiple correct configuration information;
[0195] The second setting submodule is used to set the correct configuration information as the target configuration information if there is one correct configuration information.
[0196] Optionally, the screening submodule may include:
[0197] A setting unit, used to set the configuration information of the first version as the configuration information to be processed;
[0198] a marking unit, used to determine whether the difference between the number of written configuration information to be processed and the number of acquired configuration information to be processed is equal to the offline number; if they are equal, marking the configuration information to be processed as correct configuration information; if not, marking the configuration information to be processed as incorrect configuration information;
[0199] A loop control unit is used to determine whether there is unmarked configuration information; if so, the next version of the configuration information is set as the pending configuration information, and enter the step of determining whether the difference between the write quantity of the pending configuration information and the obtain quantity of the pending configuration information is equal to the offline quantity.
[0200] Optionally, the physical hard disk is provided with two configuration information storage locations for the disk array group, for storing two adjacent versions of configuration information.
[0201] Optionally, the acquisition module 1102 may include:
[0202] The setup submodule is used to obtain the hard disk using the first physical hard disk as the configuration;
[0203] A first acquisition submodule, used to acquire first configuration information from a first configuration information storage location in the configuration acquisition hard disk;
[0204] A second acquisition submodule, used to acquire the second configuration information from the second configuration information storage location in the configuration acquisition hard disk;
[0205] The loop control submodule is used to determine whether there is a physical hard disk for which configuration information has not been obtained; if so, the next physical hard disk is set as the configuration acquisition hard disk, and the step of obtaining the first configuration information from the first configuration information storage location in the configuration acquisition hard disk is entered.
[0206] Optionally, the acquisition module 1102 may further include:
[0207] The fault judgment submodule is used to judge whether the configuration acquisition hard disk can be accessed; if it is not accessible, the fault number is increased by one, and the step of judging whether there is a physical hard disk for which the configuration information has not been obtained is entered; the initial value of the fault number is zero; if it is accessible, the step of obtaining the first configuration information from the first configuration information storage location in the configuration acquisition hard disk is entered.
[0208] Optionally, the device may further include:
[0209] A configuration update module, used to generate new version configuration information for the disk array group when a configuration update operation of the disk array group is triggered;
[0210] A first write position determination module, configured to determine, for each physical hard disk in the disk array group, whether a first configuration information storage position in the physical hard disk stores configuration information;
[0211] A first writing module, configured to store the new version of the configuration information in the first configuration information storage location if the configuration information is not stored in the first configuration information storage location;
[0212] A second write position determination module, configured to determine whether the configuration information stored in the first configuration information storage location is a previous version of the new version configuration information if the configuration information has been stored in the first configuration information storage location;
[0213] A second writing module, configured to write the new version configuration information into a second configuration information storage location in the physical hard disk if it is the previous version;
[0214] The third writing module is used to write the new version configuration information into the first configuration information storage location if it is not the previous version.
[0215] Optionally, the configuration update module may include:
[0216] A version number update submodule, used to add one to the version number of the previous version configuration information to obtain the version number of the new version configuration information;
[0217] The write quantity update submodule is used to determine the current number of online physical hard disks in the disk array group, and set the number of online physical hard disks as the write quantity of the new version configuration information.
[0218] Optionally, configuring the update module may include:
[0219] The operation trigger submodule is used to trigger the configuration update operation of the disk array group when receiving the configuration update information sent by the host.
[0220] Optionally, the device may further include:
[0221] The update success response module is used to return configuration update success information to the host only when it is determined that the new version configuration information has been correctly written into each physical hard disk in the disk array group.
[0222] Optionally, the device may further include:
[0223] The invalidation module is used to determine whether the physical hard disk stores erroneous configuration information whose version number is greater than the restored configuration information; if so, invalidate the erroneous configuration information.
[0224] Optionally, the device may further include:
[0225] The user data access module is used to access the user data in each of the physical hard disks according to the restored configuration information.
[0226] Please refer to Figure 2 , Figure 2 A structural block diagram of a storage system provided by an embodiment of the present invention, the system may include:
[0227] The disk array controller 10 is used to execute the configuration information recovery method as described above.
[0228] Multiple physical hard disks 20 are used to store configuration information of the disk array group. The configuration information is provided with a version number and a write quantity. Each physical hard disk is provided with multiple different versions of configuration information for the disk array group. The write quantity represents the number of physical hard disks that logically store the configuration information.
[0229] Optionally, a plurality of disk array groups are provided in the storage system, and the configuration information of the disk array group is only stored in all the physical hard disks 20 belonging to the disk array group.
[0230] Since the embodiments of the storage system part correspond to the embodiments of the configuration information recovery method part, please refer to the description of the embodiments of the configuration information recovery method part for the embodiments of the storage system part, which will not be repeated here.
[0231] Please refer to Fig.12 , Fig.12 A structural block diagram of a disk array controller provided by an embodiment of the present invention, the disk array controller may include:
[0232] A memory 101, used for storing computer programs;
[0233] The processor 102 is configured to implement the configuration information recovery method described above when executing a computer program.
[0234] It is also understandable that the disk array controller may also include other components, such as an interface for communicating with a host, etc., which may be set according to actual application requirements.
[0235] Since the embodiments of the disk array controller part correspond to the embodiments of the configuration information recovery method part, the embodiments of the disk array controller part refer to the description of the embodiments of the configuration information recovery method part, which will not be repeated here.
[0236] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the configuration information recovery method described in the above embodiment is implemented.
[0237] Since the embodiments of the computer program product part correspond to the embodiments of the configuration information recovery method part, please refer to the description of the embodiments of the configuration information recovery method part for the embodiments of the computer program product part, and will not be repeated here.
[0238] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the configuration information recovery method described in the above embodiment is implemented.
[0239] Since the embodiments of the computer-readable storage medium part correspond to the embodiments of the configuration information recovery method part, the embodiments of the storage medium part refer to the description of the embodiments of the configuration information recovery method part, which will not be repeated here.
[0240] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0241] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0242] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0243] The configuration information recovery method, device, system and disk array controller provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation of the present invention. The description of the above embodiments is only used to help understand the method and core idea of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the present invention.
Claims
1. A configuration information recovery method, characterized in that: Applied to a disk array controller, the method comprises: When a configuration recovery operation of a disk array group is triggered, all physical hard disks storing configuration information of the disk array group are determined; wherein the configuration information is provided with a version number and a write quantity, the write quantity represents the number of physical hard disks logically storing the configuration information, each of the physical hard disks is provided with a plurality of different versions of configuration information for the disk array group, and all the physical hard disks store at least one configuration information of the same version; Acquire all configuration information corresponding to the disk array group from each of the physical hard disks, and determine the number of acquired configuration information of each version and the number of offline physical hard disks; Determine the target configuration information that has been correctly written into all physical hard disks logically storing the configuration information and has the latest version according to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information; The target configuration information is set as the restored configuration information of the disk array group.
2. The configuration information recovery method according to claim 1, characterized in that: A plurality of disk array groups are arranged in the storage system where the disk array controller is located, and the configuration information of the disk array group is only stored in all the physical hard disks belonging to the disk array group.
3. The configuration information recovery method according to claim 2, characterized in that: Determine all physical hard disks storing the configuration information of the disk array group, including: All physical hard disks included in the disk array group are determined to obtain the configuration information from all physical hard disks included in the disk array group.
4. The configuration information recovery method according to claim 2, characterized in that: According to the acquisition quantity, the write quantity and the offline quantity corresponding to each version of the configuration information, determining the target configuration information that has been correctly written into all physical hard disks that logically store the configuration information and has the latest version, including: According to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information, determine the correct configuration information of all physical hard disks that logically store the configuration information and have been correctly written; If there are multiple correct configuration information, the correct configuration information with the largest version number is set as the target configuration information; If there is one correct configuration information, the correct configuration information is set as the target configuration information.
5. The configuration information recovery method according to claim 4, characterized in that: According to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information, the correct configuration information of all physical hard disks logically storing the configuration information is determined to have been correctly written, including: Set the configuration information of the first version as the pending configuration information; Determine whether the difference between the written quantity of the configuration information to be processed and the acquired quantity of the configuration information to be processed is equal to the offline quantity; If they are equal, the configuration information to be processed is marked as correct configuration information; If not, marking the configuration information to be processed as erroneous configuration information; Determine whether there is unmarked configuration information; If so, the next version of the configuration information is set as the pending configuration information, and the step of determining whether the difference between the write quantity of the pending configuration information and the obtain quantity of the pending configuration information is equal to the offline quantity is entered.
6. The configuration information recovery method according to any one of claims 2 to 5, characterized in that: The physical hard disk is provided with two configuration information storage locations for the disk array group, for storing two adjacent versions of configuration information.
7. The configuration information recovery method according to claim 6, characterized in that: Obtaining all configuration information corresponding to the disk array group from each of the physical hard disks, including: Get the first physical hard disk as the configuration hard disk; Acquire the first configuration information from the first configuration information storage location in the configuration acquisition hard disk; Acquire the second configuration information from the second configuration information storage location in the configuration acquisition hard disk; Determine whether there is a physical hard disk for which configuration information has not been obtained; If it exists, the next physical hard disk is set as the configuration acquisition hard disk, and the step of acquiring the first configuration information from the first configuration information storage location in the configuration acquisition hard disk is entered.
8. The configuration information recovery method according to claim 7, characterized in that: Before acquiring the first configuration information from the first configuration information storage location in the configuration acquisition hard disk, the method further includes: Determine whether the hard disk can be accessed by the configuration; If the access is not possible, the number of failures is increased by one, and the process proceeds to the step of determining whether there is a physical hard disk for which the configuration information has not been obtained; the initial value of the number of failures is zero; If it is accessible, the process proceeds to the step of obtaining the first configuration information from the first configuration information storage location in the configuration hard disk.
9. The configuration information recovery method according to claim 6, characterized in that: Also includes: When a configuration update operation of a disk array group is triggered, generating new version configuration information for the disk array group; For each physical hard disk in the disk array group, determining whether a first configuration information storage location in the physical hard disk stores configuration information; If the first configuration information storage location does not store the configuration information, storing the new version of the configuration information in the first configuration information storage location; If the first configuration information storage location has stored the configuration information, determining whether the configuration information stored in the first configuration information storage location is a previous version of the new version configuration information; If it is the previous version, writing the new version configuration information into the second configuration information storage location in the physical hard disk; If it is not the previous version, the new version configuration information is written into the first configuration information storage location.
10. The configuration information recovery method according to claim 9, characterized in that: Generating new version configuration information for the disk array group, including: Add one to the version number of the previous version of the configuration information to obtain the version number of the new version of the configuration information; The current number of online physical hard disks in the disk array group is determined, and the number of online physical hard disks is set as the write number of the new version configuration information.
11. The configuration information recovery method according to claim 10, characterized in that: Trigger the configuration update operation of the disk array group, including: When receiving the configuration update information sent by the host, the configuration update operation of the disk array group is triggered.
12. The configuration information recovery method according to claim 11, characterized in that: After writing the new version configuration information to the physical hard disks in the disk array group, the method further includes: Only when it is determined that the new version of the configuration information has been correctly written into each physical hard disk in the disk array group, configuration update success information is returned to the host.
13. The configuration information recovery method according to claim 6, characterized in that: After setting the target configuration information as the restored configuration information of the disk array group, the method further includes: Determine whether the physical hard disk stores erroneous configuration information with a version number greater than the restored configuration information; If so, the erroneous configuration information is invalidated.
14. The configuration information recovery method according to claim 1, characterized in that: After setting the target configuration information as the restored configuration information of the disk array group, the method further includes: The user data in each of the physical hard disks is accessed according to the restored configuration information.
15. A configuration information recovery device, characterized in that: Applied to a disk array controller, the device comprises: A physical hard disk determination module is used to determine all physical hard disks storing configuration information of the disk array group when a configuration recovery operation of the disk array group is triggered; wherein the configuration information is provided with a version number and a write quantity, the write quantity represents the number of physical hard disks logically storing the configuration information, each of the physical hard disks is provided with a plurality of different versions of configuration information for the disk array group, and all the physical hard disks store at least one configuration information of the same version; An acquisition module, used for acquiring all configuration information corresponding to the disk array group from each physical hard disk, and determining the acquisition quantity of each version of configuration information and the offline quantity of the physical hard disk; A screening module, for determining the target configuration information which has been correctly written into all the physical hard disks which logically store the configuration information and has the latest version according to the acquisition quantity, the writing quantity and the offline quantity corresponding to each version of the configuration information; The configuration recovery module is used to set the target configuration information as the recovered configuration information of the disk array group.
16. A storage system, characterized in that: include: A disk array controller, configured to execute the configuration information recovery method according to any one of claims 1 to 14; Multiple physical hard disks are used to store configuration information of a disk array group, the configuration information is provided with a version number and a write quantity, each of the physical hard disks is provided with multiple different versions of configuration information for the disk array group, and the write quantity represents the number of physical hard disks that logically store the configuration information.
17. The storage system according to claim 16, characterized in that: The storage system is provided with a plurality of disk array groups, and the configuration information of the disk array group is only stored in all the physical hard disks belonging to the disk array group.
18. A disk array controller, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the configuration information recovery method according to any one of claims 1 to 14 when executing the computer program.
19. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the configuration information recovery method according to any one of claims 1 to 14 are implemented.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the configuration information recovery method according to any one of claims 1 to 14 is implemented.
