Redundant array of independent disks (RAID) capacity expansion method, device, equipment and medium
By judging the sameness of the new disk type and the target array type in an independent disk redundant array (RAID), and performing disk combination and redirect address mapping, the problem of increasing data migration in RAID expansion is solved, and efficient capacity expansion and normal use is achieved.
Patent Information
- Application Number
- CN202411983172.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-29
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-29
AI Technical Summary
During the expansion process of independent disk redundant arrays (RAIDs), data migration continues to increase, resulting in an increase in capacity expansion time, and existing methods cannot effectively reduce data migration.
By determining whether the type of the new disk is the same as the disk type in the target array, if the same, combine the new disk with the disk in the target array, create a virtual array after expansion, and use redirection to map and data migration of the stripes in the target array and the virtual array after expansion.
This reduces the amount of data migration during the expansion process, improves the expansion efficiency, ensures that the independent disk redundant array can still be used normally during expansion, and has a small impact on array performance.
Smart Images

Figure CN119690354A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and medium for expanding redundant array of independent disks. Background Art
[0002] Currently, when expanding a Redundant Arrays of Independent Disks (RAID) with standard space distribution, it is usually achieved through a simple mathematical transformation, which requires copying data from the array space G(n) before expansion to the array space G(n+x) after expansion.
[0003] However, the expansion relationship derived from mathematical transformation is immutable, and with the continuous development of disk technology, the capacity of a single disk continues to increase, which makes the amount of data migrated during the expansion of the independent disk redundant array with standard space distribution also increase, resulting in the time required for expansion also increasing. Summary of the invention
[0004] In view of this, the purpose of this application is to provide a method, device, equipment and medium for expanding a redundant array of independent disks, which can reduce the amount of data migration during the expansion process, ensure that the redundant array of independent disks can still be used normally during the expansion, and improve the efficiency of the expansion. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a method for expanding a redundant array of independent disks, comprising:
[0006] When receiving an instruction to add a new disk to a target array, determining whether the disk type of the new disk is the same as the type of the disk in the target array; the target array is a disk array obtained by pre-dividing multiple disks in a redundant array of independent disks into blocks and stripes;
[0007] If the disk type of the new disk is the same as the type of the disk in the target array, the new disk is combined with the disk in the target array to create an expanded virtual array; the number of data blocks and check blocks in the expanded virtual array is the same as that in the target array;
[0008] The target array and the stripes in the expanded virtual array are respectively mapped and data migrated by redirection to complete the expansion of the redundant array of independent disks.
[0009] Optionally, the independent disk redundant array expansion method of the present application further includes:
[0010] When a new disk is detected to be inserted into the independent disk redundant array, the new disk is added to the preset disk list, and the preset disk list is displayed on the front-end interface;
[0011] When receiving a status ready instruction for a preset disk list sent by the front-end interface, obtaining a disk type of a new disk;
[0012] Determine whether there is a disk of the same disk type as the new disk in the preset disk list;
[0013] If there is a disk of the same disk type as the new disk in the preset disk list, the new disk is added to the sublist of the same disk type in the preset disk list;
[0014] Accordingly, when receiving an instruction to add a new disk to a target array, determining whether the disk type of the new disk is the same as the type of the disk in the target array includes:
[0015] When receiving an instruction sent by the front-end interface to add a new disk in the sub-list of the preset disk list to the target array, it is determined whether the disk type of the new disk is the same as the type of the disk in the target array.
[0016] Optionally, address mapping and data migration are performed on the stripes in the target array and the virtual array after expansion respectively by redirection, including:
[0017] Determine a target stripe in a volume block having different disk addresses in the target array and the virtual array after expansion from the target array, and map the address of each disk block in the target stripe to the address of the disk block in the corresponding stripe in the virtual array after expansion by using address redirection;
[0018] The data in the target stripe of the target array is migrated to the corresponding stripe in the expanded virtual array by means of data redirection.
[0019] Optionally, data in the target stripe of the target array is migrated to a corresponding stripe in the expanded virtual array by means of data redirection, including:
[0020] Obtain the number of each stripe located in the target array to obtain the stripe number;
[0021] By means of data redirection and based on the size of the stripe number, data in each disk block in the target stripe of the target array is migrated to the disk block of the corresponding stripe in the expanded virtual array.
[0022] Optionally, the independent disk redundant array expansion method of the present application further includes:
[0023] When receiving a data read request sent by a user, determining a target disk block to be read;
[0024] According to the address mapping relationship between the target array and each disk block in the expanded virtual array, the data in the disk block corresponding to the target disk block is obtained from the target array or the expanded virtual array to obtain the target data, and the target data is returned to the user end.
[0025] Optionally, after address mapping and data migration are respectively performed on the target array and the stripes in the virtual array after expansion by redirection, the method further includes:
[0026] When a data write request sent by the user is received, the overlapping disk blocks in the target array and the expanded virtual array that are both idle are obtained from the expanded virtual array, and the data to be written is written into the overlapping disk blocks.
[0027] Optionally, the independent disk redundant array expansion method of the present application further includes:
[0028] If the disk type of the new disk is different from the type of the disk in the target array, a prompt message indicating the different disk types is generated and displayed on the front-end interface;
[0029] When receiving the instruction sent by the front-end interface to add a new disk to a new array, the new array is used as the target array, and the process jumps to the step of determining whether the disk type of the new disk is the same as the type of the disk in the target array.
[0030] In a second aspect, the present application discloses a device for expanding a redundant array of independent disks, comprising:
[0031] A judgment module, for judging whether the disk type of the new disk is the same as the type of the disk in the target array when receiving an instruction to add a new disk to the target array; the target array is a disk array obtained by pre-dividing multiple disks in the redundant array of independent disks into blocks and stripes;
[0032] a combining module, for combining the new disk with the disk in the target array to create an expanded virtual array if the disk type of the new disk is the same as that of the disk in the target array; the number of data blocks and check blocks in the expanded virtual array is the same as that in the target array;
[0033] The expansion module is used to perform address mapping and data migration on the stripes in the target array and the expanded virtual array respectively by means of redirection, so as to complete the expansion of the redundant array of independent disks.
[0034] In a third aspect, the present application discloses an electronic device, including a processor and a memory; wherein the processor implements the aforementioned independent redundant array of disks expansion method when executing a computer program stored in the memory.
[0035] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned independent redundant array of disks expansion method is implemented.
[0036] It can be seen that when the present application receives an instruction to add a new disk to a target array, it determines whether the disk type of the new disk is the same as the type of the disk in the target array; the target array is a disk array obtained by pre-dividing multiple disks in an independent disk redundant array into disk blocks and stripes; if the disk type of the new disk is the same as the type of the disk in the target array, the new disk is combined with the disk in the target array to create an expanded virtual array; the number of data blocks and check blocks in the expanded virtual array is the same as that in the target array; and address mapping and data migration are performed on the stripes in the target array and the expanded virtual array respectively by means of redirection to complete the expansion of the independent disk redundant array. The present application pre-divides multiple virtual disks in an independent disk redundant array into disk blocks and stripes. When receiving an instruction to add a new disk to a pre-created target array, it is first determined whether the disk type of the new disk is the same as the type of the disk in the target array. If they are the same, the new disk is combined with the disk in the target array to create an expanded virtual array based on the target array. Then, address mapping and data migration are performed on the target array and the stripes in the expanded virtual array respectively by redirection. By expanding the independent disk redundant array in the above manner, the array space and the volume space can be combined. Since the number of data blocks and check blocks before and after the expansion is the same, the stripe width before and after the expansion remains unchanged, so that the expansion still meets the standard space distribution. The volume blocks of the array and the disk blocks of the disk can still use a simple linear mapping relationship without occupying additional metadata space. In addition, address mapping and data migration of the stripes by redirection can reduce the amount of data migration during the expansion process and ensure that the independent disk redundant array can still be used normally during the expansion, so that the expansion process has less impact on the performance of the independent disk redundant array and improves the efficiency of expansion. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application 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 application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0038] Figure 1 A flow chart of a method for expanding redundant array of independent disks disclosed in the present application;
[0039] Figure 2A schematic diagram for creating a specific logical volume disclosed in this application;
[0040] Figure 3 A schematic diagram of volume partitioning in a specific virtual array before capacity expansion disclosed in the present application;
[0041] Figure 4 A schematic diagram of volume partitioning in a specific virtual array after capacity expansion disclosed in the present application;
[0042] Figure 5 A schematic diagram of volume partitioning in a specific virtual array before capacity expansion disclosed in the present application;
[0043] Figure 6 A schematic diagram of stripes in a specific virtual array before capacity expansion disclosed in the present application;
[0044] Figure 7 A schematic diagram of volume partitioning in a specific virtual array after capacity expansion disclosed in the present application;
[0045] Figure 8 A schematic diagram of stripes in a specific virtual array after capacity expansion disclosed in the present application;
[0046] Fig. 9 A schematic diagram of volume partitioning in a virtual array before and after capacity expansion disclosed in the present application;
[0047] Fig.10 A flowchart of a specific method for expanding redundant array of independent disks disclosed in the present application;
[0048] Fig.11 A schematic diagram of the structure of a redundant array of independent disks expansion device disclosed in the present application;
[0049] Fig.12 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] The present application discloses a method for expanding the capacity of a redundant array of independent disks. Figure 1 As shown, the method includes:
[0052] Step S11: when receiving an instruction to add a new disk to a target array, determining whether the disk type of the new disk is the same as the type of the disks in the target array; the target array is a disk array obtained by pre-dividing multiple disks in a redundant array of independent disks into blocks and stripes.
[0053] It should be noted that before expanding the capacity of the independent disk redundant array, the present application pre-creates two components, namely the volume space management component and the array space management component, wherein the volume space management component is used to manage the space of the volume, and the array space management component is used to manage the space of the array.
[0054] Specifically, the volume space management component can divide the array address space into volume blocks (extents), and allocate the volume blocks (extents) to the volume when the user creates a volume (volume). For example, when the user creates a 10G volume and the extent size is 1G, the continuous array space address will be split into 1G sizes. At this time, the volume will contain 10 extents, where the 10 extents contained in the volume can be continuous or discontinuous. See Figure 2 As shown in the figure, when the user creates a volume, the discontinuous volume extents are allocated to volume0 and volume1.
[0055] Specifically, the array space management component can combine the disk space into the array space. Specifically, the disk can be first divided into blocks to obtain disk blocks (strides), and then the disk blocks (strides) can be combined to divide it into n data blocks (such as Figure 3 D in ) and m check blocks (such as Figure 3 P) is combined into redundant strips. For details, see Figure 3 As shown, Figure 3 The figure shows the spatial distribution of an array consisting of 3 data blocks (i.e., n=3), 1 check block (i.e., m=1), and 5 disks (i.e., s=5). The array space contains 5 strips, and 2 strips correspond to 1 volume extent. In addition, the array space management component can also manage virtual arrays. When the user specifies n, m, and s to create an array, the array space management component will create a corresponding virtual array structure array0, and array0 will be visible to the user to facilitate user operations. In addition, when a new disk is added, the array space management component will expand the array. The array space distribution after expansion is shown in the figure. Figure 4As shown in array1 in the figure, the positions of data blocks and check blocks in the array space will change, but the length of the extent in array1 is the same as the length of the extent in array0. It can be understood that the disk addresses of the same extent in array1 and array0 are different due to the change in the space structure. For details, see Figure 5 , Figure 6 , Figure 7 and Figure 8 As shown in the figure, the numbers of volume blocks (extents) and strips (strips) before and after the same RAID expansion are shown, where: Figure 5 The 0, 1, and 2 in the table represent the extent numbers of array0 before expansion. Figure 6 The 0, 1, 2, 3, and 4 in the table represent the stripe numbers of array0 before expansion. Figure 7 The 0, 1, and 2 in the table represent the extent numbers of array1 after expansion. Figure 8 The 0, 1, 2, 3, 4, and 5 in the figure represent the stripe numbers corresponding to the array 1 after the expansion. By comparing the numbers before and after the expansion, we can see that the extent numbers and stripe numbers corresponding to the same disk block have changed.
[0056] It should be noted that when a user inserts a new disk into the physical interface of an independent redundant array, the computer will automatically scan the interface to identify the new disk, and when the user needs to expand the independent redundant array, an instruction to add the new disk to the target array can be issued to a computer or other device. When the computer or other device receives the expansion instruction for the new disk, the expansion operation is triggered. Specifically, the disk type of the new disk can be obtained through the array space management component, and then the disk type of the new disk is compared with the type of the disk in the target array to determine whether the disk types of the two are the same; wherein the target array is a disk array obtained by pre-dividing multiple disks in an independent redundant array of disks (i.e., RAID) into disk blocks (stride) and stripes (strip), such as Figure 3 array0 in.
[0057] In this embodiment, before the capacity of the independent disk redundant array is expanded, the following specifically includes: when it is detected that a new disk is inserted into the independent disk redundant array, the new disk is added to the preset disk list, and the preset disk list is displayed on the front-end interface; when a status ready instruction for the preset disk list sent by the front-end interface is received, the disk type of the new disk is obtained; it is determined whether there is a disk with the same disk type as the new disk in the preset disk list; if there is a disk with the same disk type as the new disk in the preset disk list, the new disk is added to the sublist of the same disk type as the new disk in the preset disk list. In this embodiment, the computer can automatically scan the physical interface of the independent redundant array to identify the disk newly inserted by the user, and add the newly inserted disk to the visible disk list of the array space management component, and then display the visible disk list on the front-end interface; then, when receiving the status ready instruction for the visible disk list sent by the user through the front-end interface, it indicates that the disks in the visible disk list are all in the ready state. At this time, the disks in the ready state in the list can be classified and managed by the array space management component. Specifically, the disk information of the newly inserted disk can be obtained first, and then based on the information, it is determined whether there is a disk of the same type in the visible disk list. If so, the newly inserted disk is added to the sub-list of the same disk type. By identifying the disk type and classifying based on the disk type, the disks of the same type can be classified and managed, and the speed of subsequent expansion of the independent redundant array of disks can be facilitated.
[0058] Accordingly, when receiving an instruction to add a new disk to the target array, determining whether the disk type of the new disk is the same as the type of the disk in the target array may specifically include: when receiving an instruction sent by the front-end interface to add a new disk in a sublist of the preset disk list to the target array, determining whether the disk type of the new disk is the same as the type of the disk in the target array. That is, when receiving an instruction sent by the user through the front-end interface to add a new disk in a sublist of the preset disk list to the specified target array array0, the expansion operation is triggered, that is, the operation of determining whether the disk type of the new disk is the same as the type of the disk in the target array array0 is triggered.
[0059] Step S12: If the disk type of the new disk is the same as that of the disk in the target array, the new disk is combined with the disk in the target array to create an expanded virtual array; the number of data blocks and check blocks in the expanded virtual array is the same as that in the target array.
[0060] In this embodiment, if the disk type of the new disk is the same as the type of the disk in the target array array0 specified by the user, the new disk is combined with the disk in the target array array0 through the array space management component to create an expanded virtual array array0; the expanded virtual array array1 has the same number of data blocks (D) and check blocks (P) as the target array array0. This application compares the disk types and combines the disks when the disk types are the same, while keeping the number of data blocks and check blocks unchanged before and after the expansion, that is, the virtual array array1 uses the same n, m space structure as array0, which can ensure that the stripe width does not change before and after the expansion, and only the array width (i.e., s) is increased.
[0061] Step S13: address mapping and data migration are performed on the target array and the stripes in the virtual array after expansion by redirection, so as to complete the expansion of the redundant array of independent disks.
[0062] In this embodiment, after the expanded virtual array array1 is created, further, address mapping is performed on the target array array0 and the strips in the expanded virtual array array1 by means of address redirection through the volume space management component, and then the data in the strips in the mapped target array array0 and the expanded virtual array array1 are migrated by means of data redirection, thereby completing the expansion of the redundant array of independent disks (RAID).
[0063] Specifically, address mapping and data migration are respectively performed on the stripes in the target array and the virtual array after expansion by redirection, which may include: determining the target stripe in the volume block with different disk addresses in the target array and the virtual array after expansion from the target array, and mapping the address of each disk block in the target stripe with the address of the disk block in the corresponding stripe in the virtual array after expansion by address redirection; migrating the data in the target stripe of the target array to the corresponding stripe in the virtual array after expansion by data redirection. In this embodiment, the volume space management component can scan the corresponding extents in the virtual arrays array0 and array1, and based on the spatial distribution of array0 and array1, determine the disk blocks (Stride) with different disk addresses, and map the disk blocks (Stride) in the corresponding extents in the two spaces, that is, map the disk blocks (Stride) in the extent in array0 to the disk blocks (Stride) in the extent in array1. For example, see Fig. 9As shown, by performing address redirection, the disk blocks in the stripes corresponding to the gray 1 area in the two arrays are mapped, such as mapping stride0 in array0 corresponding to extent0 to stride0 in array1, and mapping stride5 in array0 corresponding to extent0 to stride6 in array1; then, the data in the target stripe of the target array array0 is migrated to the corresponding stripe in the virtual array array1 after expansion by means of data redirection. By using address redirection and data redirection to perform address mapping and data migration on each stripe in the two virtual matrices (i.e., array0 and array1), and the stripe width remains unchanged, the expansion can still meet the standard space distribution, and the array blocks (i.e., volume blocks) and disk blocks can still use a simple linear mapping relationship without occupying additional metadata space. In addition, the array address space after expansion is still linearly mapped. In this way, by distinguishing whether the extent comes from array0 or array1, the old data is address mapped through the spatial distribution of array0, and the new data is address mapped through the spatial distribution of array1.
[0064] Specifically, using data redirection to migrate data in a target stripe of a target array to a corresponding stripe in a virtual array after expansion may include: obtaining the serial number of each stripe in the target array to obtain a stripe serial number; using data redirection and based on the size of the stripe serial number to migrate data in each disk block in a target stripe of the target array to a disk block of a corresponding stripe in a virtual array after expansion. In this embodiment, for extents other than extent0, such as extent1, extent2, etc., the volume space management component may determine whether to migrate or reallocate the extent first based on the distance from the first aligned extent. For example, when a user specifies n, m, s to create an array, s→s+1, and the length of the extent is x (indicating the number of stripes contained in one extent) (n+m), for the stripes of the extents numbered with mod (s+1)== 0, fewer stripes may be migrated, and these stripes may be migrated first. For example, Fig. 9 The middle gray area 2 corresponds to the disk blocks in the stripe for data migration. By redirecting data and migrating data based on the size of the stripe number, the migration efficiency can be improved and the amount of data migration during the expansion process can be reduced. At the same time, the disk redundant array can be used normally during expansion, and the performance of the disk redundant array is less affected. The expansion speed is much higher than the traditional data copy method.
[0065] It should be pointed out that the expansion process also involves user access operations, such as user data write operations and user data read operations.
[0066] Specifically, for the user to read data operation, it can include: when receiving a data read request sent by the user end, determining the target disk block to be read; according to the address mapping relationship between the target array and each disk block in the virtual array after expansion, obtaining the data in the disk block corresponding to the target disk block from the target array or the virtual array after expansion, obtaining the target data, and returning the target data to the user end. In this embodiment, the volume space management component can determine the address of the extent of the user's data to be read according to the mapping relationship between volume and extent. Since the array number and stripe number allocated to its space are recorded in the extent, the data of the disk block in the corresponding stripe in the corresponding array can be found based on the array number and stripe number. Specifically, when reading data, the array space management component can send a data read request to the corresponding array based on the array number and stripe number, so that the array calculates the disk address according to its own spatial distribution, and reads the data based on the calculated disk address. It should be pointed out that the data reading operation can occur before or after the expansion.
[0067] When reading data written before the expansion, the data can be read from array0. For example, when the user reads extent7 written before the expansion, the volume space management component can first search to obtain the disk block corresponding to extent7 stored in the extent as Stride5, and then send array0 and Stride5 to the array space management component so that the array space management component can read the data in Stride5 according to the spatial distribution of array0 and return the read data to the user end.
[0068] When reading data written after the expansion, the data can be read from array1. For example, when the user reads extent7 written before the expansion, the volume space management component can first search to obtain the disk block corresponding to extent7 stored in the extent as Stride6, and then send array1 and Stride6 to the array space management component so that the array space management component can read the data in Stride6 according to the spatial distribution of array1 and return the read data to the user end.
[0069] By distinguishing whether the user data read operation occurs before or after the capacity expansion, and reading data from the corresponding virtual array, the user data read operation can be performed while the capacity expansion operation is in progress. It can be seen that this solution has little impact on the performance of the disk redundant array.
[0070] Specifically, for the user's data writing operation, after address mapping and data migration are performed on the stripes in the target array and the expanded virtual array respectively by redirection, it can also include: when a data write request sent by the user is received, the overlapping disk blocks in the target array and the expanded virtual array that are both in an idle state are obtained from the expanded virtual array, and the data to be written is written to the overlapping disk blocks. It should be pointed out that when the user writes data, the extent corresponding to the new data written by the user will only be allocated to the extent in array1. In this embodiment, after address mapping and data migration are performed, when a data write request sent by the user is received, the overlapping disk blocks (Stride) in the target array array0 and the expanded virtual array array1 that are both in an idle state are obtained from the expanded virtual array array1, and the data to be written is written to the overlapping disk blocks (Stride). For example, when the data written before the expansion corresponds to extent7, and extent7 corresponds to stride5, extent7 after the expansion will be redirected to stride6 in array1. At this time, when the user writes data to extent7, the array space management component can first find the free StrideX in array1 through the array space management component, and submit StrideX to the volume space management component; when the volume space management component receives StrideX, it will specify to write data to StrideX in array1. At this time, extent7 can be redirected to StrideX in array1, and Stride6 can be marked as idle. Then, the array space management component is used to find out whether the corresponding StrideX in array1 is in an idle state. If so, the data to be written is written to StrideX in array1.
[0071] It is understandable that there is overlap between the extents in array1 and array0. Therefore, when allocating an extent that is in a free state, not only must the address range of the extent be free in array1, but the extent must also be free in array0. However, in actual applications, there may be no free extents in array1. For this scenario, you can first check whether there are any extents in use in array0. If there are any extents in use in array0, migrate the extents in use in array0 to the extents in array1. At this time, there will be free extents in array1. Then, write the data to be written to the free extents in array1. In this way, the user can read data when there are no free extents in array0. For example, when the array space management component does not find a free StrideX in array1, it generates information about no free StrideX to the volume space management component; then, the volume space management component searches for an extent that contains the StrideX in array0, and then specifies a group of aligned StrideX (for example Fig. 9 The 4×6 square in the upper right corner of the image is used for data migration, and then the old data in the StrideX group is read through the array space management component. According to the spatial distribution of array1, the old data is combined with the new data to be written and written into the StrideX group. Finally, the volume space management component is notified to redirect all the extents corresponding to the StrideX group to the Stride in array1.
[0072] It is understandable that for writing to the user address space, when new data is written to the extent in array1, the old extent in array1 or array0 will be released. Since it will no longer be allocated to the extent in array0, the extent in array0 will eventually be released, and array0 will be deleted.
[0073] It can be seen that when the embodiment of the present application receives an instruction to add a new disk to a target array, it is determined whether the disk type of the new disk is the same as the type of the disk in the target array; the target array is a disk array obtained by pre-dividing multiple disks in an independent disk redundant array into disk blocks and stripes; if the disk type of the new disk is the same as the type of the disk in the target array, the new disk is combined with the disk in the target array to create an expanded virtual array; the number of data blocks and check blocks in the expanded virtual array is the same as that in the target array; and address mapping and data migration are performed on the stripes in the target array and the expanded virtual array respectively by using redirection to complete the expansion of the independent disk redundant array. In the embodiment of the present application, multiple virtual disks in the independent disk redundant array are divided into disk blocks and stripes in advance. When an instruction to add a new disk to a pre-created target array is received, it is first determined whether the disk type of the new disk is the same as the type of the disk in the target array. If they are the same, the new disk is combined with the disk in the target array to create an expanded virtual array based on the target array, and then the stripes in the target array and the expanded virtual array are respectively mapped and migrated by redirection. By expanding the independent disk redundant array in the above manner, the array space and the volume space can be combined. Since the number of data blocks and check blocks before and after the expansion is the same, the stripe width before and after the expansion remains unchanged, so that the expansion still meets the standard space distribution. The volume blocks of the array and the disk blocks of the disk can still use a simple linear mapping relationship without occupying additional metadata space. In addition, by address mapping and data migration of the stripes in the redirection method, the amount of data migration during the expansion process can be reduced, and it is ensured that the independent disk redundant array can still be used normally during the expansion, so that the expansion process has a small impact on the performance of the independent disk redundant array, and the efficiency of the expansion is improved.
[0074] The present application discloses a specific method for expanding the capacity of a redundant array of independent disks. Fig.10 As shown, the method includes:
[0075] Step S21: when receiving an instruction to add a new disk to a target array, determining whether the disk type of the new disk is the same as the type of the disks in the target array; the target array is a disk array obtained by pre-dividing multiple disks in a redundant array of independent disks into blocks and stripes.
[0076] Step S22: If the disk type of the new disk is the same as that of the disk in the target array, the new disk is combined with the disk in the target array to create an expanded virtual array; the number of data blocks and check blocks in the expanded virtual array is the same as that in the target array.
[0077] Step S23: address mapping and data migration are performed on the target array and the stripes in the virtual array after expansion respectively by means of redirection, so as to complete the expansion of the redundant array of independent disks.
[0078] Step S24: If the disk type of the new disk is different from the type of the disk in the target array, a prompt message indicating that the disk type is different is generated and displayed on the front-end interface.
[0079] In this embodiment, if the disk type of the new disk is different from the type of the disk in the target array array0, a prompt message indicating that the disk type is different is generated and then displayed on the front-end interface.
[0080] Step S25: when receiving the instruction sent by the front-end interface to add a new disk to a new array, the new array is used as the target array, and the process jumps to the step of determining whether the disk type of the new disk is the same as the type of the disk in the target array.
[0081] In this embodiment, when an instruction to add a new disk to a new array is received from the front-end interface, the new array can be used as the target array and the process jumps to step S21, i.e., the step of determining whether the disk type of the new disk is the same as the type of the disk in the target array is executed.
[0082] For more specific processing procedures of the above steps S21 to S23, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be described in detail here.
[0083] It can be seen that in the embodiment of the present application, when an instruction to add a new disk to a target array is received, it is determined whether the disk type of the new disk is the same as the type of the disk in the target array. If the disk type of the new disk is the same as the type of the disk in the target array, the new disk is combined with the disk in the target array to create an expanded virtual array, and the target array and the stripes in the expanded virtual array are respectively address mapped and data migrated by redirection to complete the expansion of the independent disk redundant array; if the disk type of the new disk is different from the type of the disk in the target array, a prompt message of different disk types is generated and the prompt message is displayed on the front-end interface. When an instruction to add a new disk to a new array is received from the front-end interface, the new array is used as the target array, and the process jumps to the step of determining whether the disk type of the new disk is the same as the type of the disk in the target array. In the embodiment of the present application, when the disk type of the new disk is different from the type of the disk in the target array specified by the user, a prompt message of different disk types is generated, and when an instruction to add the new disk to the new array is received, the expansion operation is performed again. It can be seen that when expanding the capacity, it is detected whether the specified disk and the disk in array0 are of the same type of disk, and the expansion process is triggered only when the disk types are the same. Since disks of the same type have the same characteristics, such as the same data blocks and verification blocks, it can be ensured that the stripe width remains unchanged before and after the expansion, so that the array after the expansion is completed still meets the standard spatial distribution, and the array blocks and disk blocks can still use a simple linear mapping relationship without occupying additional metadata space.
[0084] Correspondingly, the present application also discloses a device for expanding redundant array of independent disks, see Fig.11 As shown, the device comprises:
[0085] The judging module 11 is used to judge whether the disk type of the new disk is the same as the type of the disk in the target array when receiving an instruction to add a new disk to the target array; the target array is a disk array obtained by pre-dividing multiple disks in the redundant array of independent disks into blocks and stripes;
[0086] A combining module 12 is used for combining the new disk with the disk in the target array to create an expanded virtual array if the disk type of the new disk is the same as that of the disk in the target array; the number of data blocks and check blocks in the expanded virtual array is the same as that in the target array;
[0087] The expansion module 13 is used to perform address mapping and data migration on the stripes in the target array and the expanded virtual array respectively by means of redirection, so as to complete the expansion of the redundant array of independent disks.
[0088] Among them, the specific working processes of the above-mentioned modules can refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0089] It can be seen that in the embodiment of the present application, when an instruction to add a new disk to a target array is received, it is determined whether the disk type of the new disk is the same as the type of the disk in the target array; the target array is a disk array obtained by pre-dividing multiple disks in an independent disk redundant array into disk blocks and stripes; if the disk type of the new disk is the same as the type of the disk in the target array, the new disk is combined with the disk in the target array to create an expanded virtual array; the number of data blocks and check blocks in the expanded virtual array is the same as that in the target array; and address mapping and data migration are performed on the stripes in the target array and the expanded virtual array respectively by using redirection to complete the expansion of the independent disk redundant array. In the embodiment of the present application, multiple virtual disks in the independent disk redundant array are divided into disk blocks and stripes in advance. When an instruction to add a new disk to a pre-created target array is received, it is first determined whether the disk type of the new disk is the same as the type of the disk in the target array. If they are the same, the new disk is combined with the disk in the target array to create an expanded virtual array based on the target array, and then the stripes in the target array and the expanded virtual array are respectively mapped and migrated by redirection. By expanding the independent disk redundant array in the above manner, the array space and the volume space can be combined. Since the number of data blocks and check blocks before and after the expansion is the same, the stripe width before and after the expansion remains unchanged, so that the expansion still meets the standard space distribution. The volume blocks of the array and the disk blocks of the disk can still use a simple linear mapping relationship without occupying additional metadata space. In addition, by address mapping and data migration of the stripes in the redirection method, the amount of data migration during the expansion process can be reduced, and it is ensured that the independent disk redundant array can still be used normally during the expansion, so that the expansion process has a small impact on the performance of the independent disk redundant array, and the efficiency of the expansion is improved.
[0090] In some specific embodiments, the device for expanding redundant array of independent disks may further include:
[0091] A first adding unit is used to add the new disk to the preset disk list when detecting that a new disk is inserted into the redundant array of independent disks;
[0092] A display unit, used to display the preset disk list on the front-end interface;
[0093] A type acquisition unit, configured to acquire the disk type of the new disk when receiving a status ready instruction for a preset disk list sent by the front-end interface;
[0094] The first determination unit is used to determine whether there is a disk of the same type as the new disk in the preset disk list;
[0095] a second adding unit, configured to add the new disk to a sublist of the preset disk list having the same disk type as the new disk if there is a disk of the same disk type as the new disk in the preset disk list;
[0096] Accordingly, the judgment module 11 may specifically include:
[0097] The second judgment unit is used to judge whether the disk type of the new disk is the same as the type of the disk in the target array when receiving an instruction sent by the front-end interface to add a new disk in the sublist of the preset disk list to the target array.
[0098] In some specific embodiments, the expansion module 13 may specifically include:
[0099] A determination unit, used to determine, from the target array, a target stripe in a volume block having different disk addresses in the target array and the virtual array after capacity expansion;
[0100] An address mapping unit, used to map the address of each disk block in the target stripe with the address of the disk block in the corresponding stripe in the virtual array after the capacity expansion by means of address redirection;
[0101] The first data migration unit is used to migrate the data in the target stripe of the target array to the corresponding stripe in the virtual array after the capacity expansion by means of data redirection.
[0102] In some specific embodiments, the first data migration unit may specifically include:
[0103] A number acquisition unit, used to acquire the number of each stripe located in the target array to obtain the stripe number;
[0104] The second data migration unit is used to migrate the data in each disk block in the target stripe of the target array to the disk block of the corresponding stripe in the expanded virtual array by means of data redirection based on the size of the stripe number.
[0105] In some specific embodiments, the device for expanding redundant array of independent disks may further include:
[0106] A first block determination unit, configured to determine a target disk block to be read when receiving a data read request sent by a user terminal;
[0107] A data acquisition unit is used to acquire data in a disk block corresponding to a target disk block from the target array or the virtual array after expansion according to an address mapping relationship between the target array and each disk block in the virtual array after expansion, so as to obtain target data;
[0108] The data return unit is used to return the target data to the user end.
[0109] In some specific embodiments, after the expansion module 13, the following may also be included:
[0110] The second block acquisition unit is used to acquire the overlapping disk blocks in the target array and the expanded virtual array that are both in idle state from the expanded virtual array when receiving a data write request sent by the user end, and write the data to be written into the overlapping disk blocks.
[0111] In some specific embodiments, the device for expanding redundant array of independent disks may further include:
[0112] a prompt information generating unit, for generating a prompt information indicating that the disk type is different if the disk type of the new disk is different from the type of the disk in the target array;
[0113] An information display unit, used to display prompt information on the front-end interface;
[0114] The jump unit is used for, when receiving the instruction to add a new disk to a new array sent by the front-end interface, taking the new array as the target array and jumping to the step of determining whether the disk type of the new disk is the same as the type of the disk in the target array.
[0115] Furthermore, the present application also discloses an electronic device. Fig.12 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0116] Fig.12 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the independent disk redundant array expansion method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0117] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0118] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0119] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the independent disk redundant array expansion method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0120] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned independent disk redundant array expansion method is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0121] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which implements the steps of the independent disk redundant array expansion method disclosed above when the computer program / instruction is executed by a processor.
[0122] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the 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.
[0123] 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 this application.
[0124] 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.
[0125] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0126] The above is a detailed introduction to a method, device, equipment and medium for expanding a redundant array of independent disks provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, for a person skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for expanding redundant array of independent disks, characterized in that: include: When receiving an instruction to add a new disk to a target array, determining whether the disk type of the new disk is the same as the type of the disks in the target array; the target array is a disk array obtained by pre-dividing multiple disks in a redundant array of independent disks into blocks and stripes; If the disk type of the new disk is the same as the type of the disk in the target array, combining the new disk with the disk in the target array to create an expanded virtual array; The number of data blocks and check blocks in the virtual array after expansion is the same as that in the target array; The target array and the stripes in the expanded virtual array are respectively mapped to addresses and migrated by redirection to complete the expansion of the redundant array of independent disks.
2. The method for expanding redundant array of independent disks according to claim 1, characterized in that: Also includes: When a new disk is detected to be inserted into the independent disk redundant array, the new disk is added to the preset disk list, and the preset disk list is displayed on the front-end interface; When receiving a status ready instruction for the preset disk list sent by the front-end interface, obtaining the disk type of the new disk; Determine whether there is a disk of the same disk type as the new disk in the preset disk list; If there is a disk of the same disk type as the new disk in the preset disk list, adding the new disk to a sublist of the same disk type as the new disk in the preset disk list; Accordingly, when receiving an instruction to add a new disk to a target array, determining whether the disk type of the new disk is the same as the type of the disks in the target array includes: When receiving an instruction sent by the front-end interface to add a new disk in a sublist of a preset disk list to a target array, it is determined whether a disk type of the new disk is the same as a type of a disk in the target array.
3. The method for expanding redundant array of independent disks according to claim 1, characterized in that: The method of performing address mapping and data migration on the stripes in the target array and the expanded virtual array respectively by redirection includes: Determine, from the target array, a target stripe in a volume block having different disk addresses in the target array and the virtual array after expansion, and map the address of each disk block in the target stripe with the address of the disk block in the corresponding stripe in the virtual array after expansion by means of address redirection; The data in the target stripe of the target array is migrated to the corresponding stripe in the expanded virtual array by means of data redirection.
4. The method for expanding redundant array of independent disks according to claim 3, characterized in that: The step of migrating the data in the target stripe of the target array to the corresponding stripe in the expanded virtual array by means of data redirection includes: Acquire the number of each stripe located in the target array to obtain the stripe number; By means of data redirection and based on the size of the stripe number, data in each disk block in the target stripe of the target array is migrated to the disk block of the corresponding stripe in the expanded virtual array.
5. The method for expanding redundant array of independent disks according to claim 1, characterized in that: Also includes: When receiving a data read request sent by a user, determining a target disk block to be read; According to the address mapping relationship between the target array and each disk block in the expanded virtual array, data in the disk block corresponding to the target disk block is obtained from the target array or the expanded virtual array to obtain target data, and the target data is returned to the user end.
6. The method for expanding redundant array of independent disks according to claim 1, characterized in that: After address mapping and data migration are respectively performed on the target array and the stripes in the expanded virtual array by redirection, the method further includes: When a data write request sent by the user is received, the overlapping disk blocks in the target array and the expanded virtual array that are both idle are obtained from the expanded virtual array, and the data to be written is written into the overlapping disk blocks.
7. The method for expanding redundant array of independent disks according to any one of claims 1 to 6, characterized in that: Also includes: If the disk type of the new disk is different from the type of the disk in the target array, a prompt message indicating that the disk type is different is generated and the prompt message is displayed on the front-end interface; When receiving the instruction sent by the front-end interface to add the new disk to the new array, the new array is used as the target array, and the process jumps to the step of determining whether the disk type of the new disk is the same as the type of the disk in the target array.
8. A device for expanding redundant array of independent disks, characterized in that: include: A judgment module, configured to, when receiving an instruction to add a new disk to a target array, judge whether the disk type of the new disk is the same as the type of the disks in the target array; the target array is a disk array obtained by pre-dividing multiple disks in a redundant array of independent disks into blocks and stripes; A combining module, configured to combine the new disk with the disk in the target array to create an expanded virtual array if the disk type of the new disk is the same as the type of the disk in the target array; The number of data blocks and check blocks in the virtual array after expansion is the same as that in the target array; The expansion module is used to perform address mapping and data migration on the stripes in the target array and the expanded virtual array respectively by redirection, so as to complete the expansion of the redundant array of independent disks.
9. An electronic device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the method for expanding the capacity of a redundant array of independent disks as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the method for expanding the capacity of a redundant array of independent disks as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for increasing magnetic disc redundant array redundancy
CN101587425A
Method and device for expanding capacity of independent redundant disk array and medium
CN112114758A
Disk array capacity expansion method and system, storage medium and equipment
CN115599313A
Disk array capacity expansion method and device, storage system and product
CN117234436A
Capacity expansion method for raid, and related apparatuses
WO2024119772A1