WO2020094134A1 - 磁盘分配方法、装置和可读存储介质 - Google Patents
磁盘分配方法、装置和可读存储介质 Download PDFInfo
- Publication number
- WO2020094134A1 WO2020094134A1 PCT/CN2019/116783 CN2019116783W WO2020094134A1 WO 2020094134 A1 WO2020094134 A1 WO 2020094134A1 CN 2019116783 W CN2019116783 W CN 2019116783W WO 2020094134 A1 WO2020094134 A1 WO 2020094134A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- disk
- disk group
- erasure code
- group
- data
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1008—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
- G06F11/1012—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using codes or arrangements adapted for a specific type of error
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1008—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
- G06F11/1064—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices in cache or content addressable memories
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
Definitions
- This application relates to the field of computer technology, and in particular, to a disk allocation method, device, and readable storage medium.
- erasure codes In the field of large-scale data storage, erasure codes (Erasure Coding, EC) are used to encode data to obtain data blocks and check blocks, that is, erasure code data, to improve the fault tolerance of the data.
- the data blocks and check blocks in the erasure code data can be stored in different disks to further improve the security of the data.
- different types of erasure code data may be stored in different disks, so disk allocation needs to be performed for multiple types of erasure code data.
- the type of erasure code data refers to the type of erasure code used when encoding to obtain erasure code data.
- a distributed storage system is used to store data, and the distributed storage system includes multiple disks.
- an initial disk group is determined from the distributed storage system through a hash algorithm.
- the initial disk group includes multiple storage devices, and each storage device includes multiple disks. Determine the usage heat and reference heat of each storage device in the initial disk group, and allocate the final disk for the erasure code data corresponding to the target data according to the difference between the usage heat and reference heat of each storage device.
- the characteristics of the hash algorithm will result in uneven distribution of the initial disk group distribution among all disks in the entire distributed storage system, resulting in uneven distribution of the final allocated disks among all disks in the entire distributed storage system ; And after the initial disk group is determined, the type of erasure code data that each storage device in the initial disk group can store is also fixed. Therefore, for new types of erasure code data, the erasure code data may not be successfully stored, Therefore, the flexibility of this disk allocation method is poor.
- Embodiments of the present application provide a disk allocation method, device, and readable storage medium to overcome the problem of poor flexibility in the disk allocation manner in the related art.
- the technical solution is as follows:
- a disk allocation method includes:
- the first erasure code is used to encode the target data to obtain erasure code data including a data block and a check block, and different types of erasure codes
- the parameter value corresponding to each type of erasure code is used to indicate the number of data blocks and the number of check blocks coded according to the corresponding erasure code
- a first disk group is allocated in the storage space according to the first erasure code, and there are one or more first disk groups for storing the erasure code data.
- the allocating the first disk group in the storage space according to the first erasure code includes:
- the first disk group is created in the storage space according to the first erasure code
- the second disk group is used to store the erasure code data obtained according to the second erasure code encoding, then according to the first erasure code and the A second erasure code allocates the first disk group in the storage space, wherein the type of the second erasure code is different from the first erasure code.
- the allocating the first disk group in the storage space according to the first erasure code and the second erasure code includes:
- the second disk group is used as the first disk group
- the first disk group is created in the storage space according to the first erasure code
- the first disk group is allocated in the second disk group
- the disk allocation information corresponding to the second erasure code is backed up and redistributed The first disk group and the second disk group.
- the creating the first disk group in the storage space according to the first erasure code includes:
- any first disk group sequentially select the disks in the storage space as one disk in the first disk group, and the number of disks in the first disk group is equal to the data corresponding to the first erasure code
- the sum of the number of blocks and the number of check blocks, at least one disk is spaced between the starting disks of the plurality of first disk groups.
- the allocating the first disk group in the second disk group includes:
- Target disk group is one or more
- the selecting a target disk group from the second disk group includes:
- the overlapping second disk group is the second including any disk included in the previously selected target disk group Disk group.
- the reallocating the first disk group and the second disk group includes:
- the second disk group is allocated according to the disk allocation information corresponding to the second erasure code backup
- the second disk group is allocated in the storage space based on the first disk group and the second erasure code
- the second disk group is allocated according to the disk allocation information corresponding to the second erasure code that is backed up;
- the disk allocation information corresponding to the backed-up erasure codes of the second type is deleted.
- a disk distribution device is also provided.
- the device includes:
- the acquisition module is used to acquire the target data to be stored
- a determining module configured to determine a first erasure code corresponding to the target data, and the first erasure code is used to encode the target data to obtain erasure code data including a data block and a check block, different
- the types of erasure codes correspond to different parameter values, and the parameter values corresponding to each type of erasure codes are used to indicate the number of data blocks and the number of check blocks that are encoded according to the corresponding erasure codes;
- An allocation module configured to allocate a first disk group in a storage space according to the first erasure code, and the first disk group is one or more, used to store the erasure code data.
- the distribution module is used to:
- the first disk group is created in the storage space according to the first erasure code
- the second disk group is used to store the erasure code data obtained according to the second erasure code encoding, then according to the first erasure code and the A second erasure code allocates the first disk group in the storage space, wherein the type of the second erasure code is different from the first erasure code.
- the distribution module is used to:
- the second disk group is used as the first disk group
- the first disk group is created in the storage space according to the first erasure code
- the first disk group is allocated in the second disk group
- the disk allocation information corresponding to the second erasure code is backed up and redistributed The first disk group and the second disk group.
- the allocation module is configured to select, in order for any first disk group, the disks in the storage space as one disk in the first disk group, and the number of disks in the first disk group It is equal to the sum of the number of data blocks and the number of check blocks corresponding to the first erasure code, and there is at least one disk between the starting disks of the plurality of first disk groups.
- the allocation module is configured to select a target disk group from the second disk group, and the target disk group is one or more; select at least one disk from the selected target disk group as A disk in the first disk group.
- the allocation module is configured to skip overlapping second disk groups, and select a target disk group from the remaining second disk groups in sequence, and the overlapping second disk group includes the previously selected target disk The second disk group of any disk included in the group.
- the distribution module is used to:
- the second disk group is allocated according to the disk allocation information corresponding to the second erasure code backup
- the second disk group is allocated in the storage space based on the first disk group and the second erasure code
- the second disk group is allocated according to the disk allocation information corresponding to the second erasure code that is backed up;
- the disk allocation information corresponding to the backed-up erasure codes of the second type is deleted.
- a disk allocation device includes a processor and a memory. At least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement any of the above disk allocations. method.
- a computer-readable storage medium where at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement any of the above-mentioned disk allocation methods.
- the first disk group is allocated in the storage space according to the first erasure code corresponding to the target data, so as to store the target data according to the first erasure code through the disks included in the first disk group Erasure code data obtained by encoding data. Since different types of erasure codes correspond to different parameter values, the parameter values corresponding to each type of erasure codes are used to indicate the number of data blocks and the number of check blocks that are encoded according to the corresponding erasure codes, thus It can be seen that the technical solutions provided by the embodiments of the present application can dynamically adjust the allocated disks according to different types of erasure codes, thereby improving the flexibility of disk allocation.
- FIG. 1 shows an architectural diagram of an object storage system provided by an embodiment of the present application
- FIG. 2 shows a schematic diagram of writing erasure code data written to a disk according to an embodiment of the present application
- FIG. 3 shows a flowchart of a disk allocation method provided by an embodiment of the present application
- FIG. 4 shows a flowchart of a disk allocation method provided by an embodiment of the present application
- FIG. 5 shows a structural block diagram of a disk distribution device provided by an embodiment of the present application
- FIG. 6 shows a structural block diagram of a disk distribution device provided by an embodiment of the present application.
- Erasure coding is a method of processing data in order to protect the data. It divides the data into data blocks and encodes the data blocks to obtain redundant check blocks, so that the correlation between the data is generated to achieve fault tolerance.
- the erasure code includes at least two core parameters, respectively N and M, which means that N data blocks are encoded by the erasure code to obtain M check blocks, thereby obtaining N + M block erasure code data.
- erasure codes correspond to different parameter values, for example, the value of N for the first erasure code is N1, and the value of M for the first erasure code is M1, indicating that N1 data blocks are encoded by the first erasure code M1 check blocks are obtained; the value of N of the second erasure code is N2, and the value of M of the second erasure code is M2, indicating that N2 data blocks are encoded by the second erasure code to obtain M2 check blocks.
- the data block and the check block in the encoded erasure code data can be stored on different disks to prevent the data from being damaged due to damage to one disk.
- different types of erasure code data may be stored in the storage space, for example, erasure code data obtained through second erasure code encoding and erasure code data obtained through first erasure code encoding.
- the disk allocation method of erasure code data involved in the present application can be used for disk allocation in a storage space.
- multiple data blocks and check blocks of erasure coded data can be stored on disks in different object storage devices (Object-based Storage Devices, OSDs) or on the same OSD In different disks.
- OSDs Object-based Storage Devices
- the following describes an example of the method for allocating erasure code data in a disk of the target storage system to store the erasure code data in different disks of the same storage system as an example.
- the object storage system includes at least a metadata server, an object storage server, a client, and multiple disks.
- the client provides a user interaction interface, which can be used to obtain data that has not been processed by erasure coding.
- the object storage server includes a disk distribution component, an EC computing component, and a disk read-write component.
- the object storage server receives the data obtained by the client; the data is processed by the EC computing component to obtain erasure code data; the erasure code data is stored in multiple disks in the form of a stripe.
- a Stripe is composed of N + M stripe blocks, N indicates that there are N data blocks in the Stripe, and M indicates that there are M check blocks in the Stripe ,
- Each data block or parity block can be called a stripe block, the disk allocation component allocates N + M disks for the N + M stripe blocks; the disk read-write component separates the N + M stripe blocks Write to the allocated N + M disks.
- the metadata server generates a stripe information table according to the storage status of Stripe in the object storage server, and stores the stripe information table in the metadata server.
- the Stripe information table includes but is not limited to one or more of the following information: Stripe ID (Stripe Identifier, Stripe ID), the globally unique name (wwn) of the hard disk corresponding to the stripe block, and the type of erasure code. See Table 1, which shows an example of the Stripe information table.
- the data obtained from the client is processed by the EC computing component to obtain four data blocks and a check block, which are data block 1, data block 2, data block 3, data block 4, and check Block 1, to obtain a Stripe
- the Stripe includes stripe block 1, stripe block 2, stripe block 3, stripe block 4 and stripe block 5, respectively corresponding to data block 1, data block 2, data block 3, Data block 4 and parity block 1
- the disk allocation component allocates disk 1, disk 2, disk 3, disk 4, and disk 5 to the stripe
- the disk read-write component combines stripe block 1, stripe block 2, and stripe block 3 , Stripe block 4 and stripe block 5 are written to disk 1, disk 2, disk 3, disk 4 and disk 5, respectively; and store the Stripe Stripe information table in the metadata server.
- FIG. 3 shows a flowchart of a disk allocation method for erasure code data provided by an embodiment of the present application.
- the method will be described below by using an object storage server as an example.
- the method includes:
- Step 301 Obtain target data to be stored.
- the client When there is data to be stored, the client sends the target data to be stored to the object storage server, and the object storage server thus obtains the target data to be stored, and triggers the subsequent disk allocation process.
- Step 302 Determine a first erasure code corresponding to the target data.
- the first erasure code is used to encode the target data to obtain erasure code data including a data block and a check block;
- the target data when storing the target data, the target data is divided into data blocks, and the erasure codes are used to encode the data blocks to obtain redundant check blocks, so that the correlation between the data is generated to achieve fault tolerance the goal of.
- the storage of the target data is achieved by storing the data block and the check block.
- the erasure code since the erasure code is used when encoding the data block, the erasure code is different, and the check block obtained by the encoding is also different. Therefore, in order to achieve subsequent disk allocation, the method provided in the embodiment of the present application needs to first determine the corresponding The determination method of the first erasure code may be limited according to the actual situation, which is not limited in the embodiments of the present application.
- Step 303 Allocate a first disk group in the storage space according to the first erasure code, and the first disk group is one or more for storing erasure code data.
- the method provided by the embodiment of the present application includes, but is not limited to, the following two cases when allocating the first disk group in the storage space according to the first erasure code:
- the first case if there is no allocated disk group in the storage space, the first disk group is created in the storage space according to the first erasure code;
- the second case if there is an allocated second disk group in the storage space, and the second disk group is used to store the erasure code data obtained according to the second erasure code encoding, then according to the first erasure code and the second correction
- the erasure code allocates the first disk group in the storage space, where the type of the second erasure code is different from the first erasure code.
- allocating the first disk group in the storage space according to the first erasure code and the second erasure code includes any one of the following four processing methods:
- the first way if the number of check blocks corresponding to the first erasure code is equal to the number of check blocks corresponding to the second erasure code, and the number of data blocks corresponding to the first erasure code is equal to the second The number of data blocks corresponding to the erasure code, the second disk group is used as the first disk group;
- the first disk group is created in the storage space according to the first erasure code
- creating the first disk group in the storage space according to the first erasure code includes:
- any first disk group select the disks in the storage space in turn as a disk in the first disk group.
- the number of disks in the first disk group is equal to the number of data blocks corresponding to the first erasure code and the calibration
- Third method If the number of check blocks corresponding to the first erasure code is greater than the number of check blocks corresponding to the second erasure code, the first disk group is allocated in the second disk group;
- Target disk group from the second disk group, the target disk group is one or more;
- selecting the target disk group from the second disk group includes:
- the overlapping second disk group is the second disk group including any disks included in the first selected target disk group .
- Fourth method If the number of check blocks corresponding to the first erasure code is less than the number of check blocks corresponding to the second erasure code, then back up the disk allocation information corresponding to the second erasure code and reallocate the first One disk group and the second disk group.
- Reassign the first disk group and the second disk group including:
- the second disk group is allocated according to the disk allocation information corresponding to the backup second erasure code
- the second disk group is allocated in the storage space based on the first disk group and the second erasure code
- the second disk group is allocated according to the disk allocation information corresponding to the backup second erasure code
- the disk allocation information corresponding to the backup type 2 erasure code is deleted.
- the first disk group is allocated in the storage space according to the first erasure code corresponding to the target data, so as to store the target data according to the first erasure code through the disks included in the first disk group Erasure code data obtained by encoding data. Since different types of erasure codes correspond to different parameter values, the parameter values corresponding to each type of erasure codes are used to indicate the number of data blocks and the number of check blocks that are encoded according to the corresponding erasure codes, thus It can be seen that the technical solutions provided by the embodiments of the present application can dynamically adjust the allocated disks according to different types of erasure codes, thereby improving the flexibility of disk allocation.
- the data blocks and check blocks corresponding to the erasure code data can be stored relatively evenly in the disks in the storage space, which improves the utilization of the storage space.
- FIG. 4 shows a flowchart of a disk allocation method provided by an embodiment of the present application.
- the method will be described below by using an object storage server as an example.
- Step 401 Allocate a second disk group corresponding to the second erasure code in the storage space.
- the storage space includes X disks; the second erasure code is used to generate M2 check blocks based on N2 data blocks; the second disk group is used to store N2 data blocks obtained by encoding the second erasure code and M2 parity blocks, the storage space includes at least one second disk group, each second disk group includes N2 + M2 disks out of X disks in the storage space, X, N2, and M2 are positive integers, and X Not less than N2 + M2.
- step 401 includes:
- a plurality of second disk groups are allocated according to this sequential selection method, where the starting disks of the plurality of second disk groups are separated by K1 disks, K1 is a non-negative integer, and K1 is less than X.
- the disks included in the second disk group are: the X-1th disk Disk, the Xth disk, the first disk, ..., the N2 + M2-2 disk.
- one of the foregoing OSDs includes 12 disks, that is, the value of X is 12, and the disk numbers are D1 to D12; the value of N2 of the second erasure code is 2, and the value of M2 is 1, according to the above
- the disks included in the multiple second disk groups allocated in the implementation manner are shown in Table 2.
- There is one disk between the first disk that is, the value of K1 is 1.
- Step 402 Obtain target data to be stored, determine a first erasure code corresponding to the target data, and allocate a first disk group in the storage space according to the first erasure code.
- the first disk group is used to store data blocks and check blocks in the erasure code data obtained by encoding the target data according to the first erasure code, for example, the first erasure code is used to generate based on N1 data blocks M1 check blocks.
- the storage space includes at least one first disk group, and each first disk group includes N1 + M1 disks out of X disks in the storage space, N1 and M1 are positive integers, and X is not less than N1 + M1. Optionally, if X is less than N1 + M1, the allocation of the first disk group fails.
- the first disk group is allocated based on the disk groups already allocated in the storage space, and if there are multiple disk groups corresponding to multiple erasure codes in the storage space, the multiple erasure codes may be selected The erasure code whose parameter M is the smallest and (N + M) is the smallest, and the first disk group is allocated based on the disk group corresponding to the erasure code.
- the following takes the second disk group corresponding to the second erasure code in the storage space and assigns the first disk group based on the second disk group as an example for description.
- the parameters of the first erasure code and the second erasure code May include the following.
- assigning a first disk group includes the following steps:
- Step A Select a disk in a second disk group as a base disk (baseDisk), the number of the baseDisk in the storage space is Db, and use the baseDisk as the first disk in the first disk group. For example, the disk with the number 1 can be selected as the baseDisk of the first disk group. If M2 is less than 2, step A ends; if M2 is not less than 2, then in the second disk group where baseDisk is located, select the M2-1 disks numbered Db + 1 to Db + M2-1 after baseDisk in sequence As the second to M2th disks in the first disk group, step A ends. Repeat step B until the number of disks in the first disk group is M1 + N1.
- Step B Select the disk with the disk number Db + N2 + M2 as the M2 + 1th disk in the first disk group. If M2 is less than 2, step B ends; if M2 is not less than 2, then sequentially select the disks numbered Db + N2 + M2 + 1 to Db + N2 + 2 * M2-1 as the disks in the first disk group, Step B ends. Where, if any of the numbers Db + N2 + M2 + 1 to Db + N2 + 2 * M2-1 is greater than X, the value greater than X is subtracted from X, and the updated number value is selected Disk.
- step B if the number of disks in the first disk group reaches M1 + N1, step B ends.
- a first disk group is allocated through steps A and B, and other first disk groups can also be acquired through steps A and B.
- the selected baseDisk and The baseDisks of one or more first disk groups that have been allocated are different. For example, you can select the disk with the number 2 as the baseDisk of the other first disk group, and perform steps A and B in sequence to obtain the other first disk group.
- a first disk group allocated through steps A and B includes four disks numbered 4, 7, 10, and 1, and the first disk group has been allocated with a first disk group (including the number 1 , 4, 7 and 10 disks) are the same, the allocation of the first disk group ends.
- assigning a first disk group includes the following steps:
- Step 1 In the process of allocating disks for a first disk group, first select a second disk group from the second disk group corresponding to the second erasure code, and then select the next second disk group in sequence. If a second disk group is an overlapping second disk group, the overlapping second disk group is skipped, and the second disk group continues to be selected after the overlapping second disk group until P second disk groups are obtained.
- the overlapping second disk group is a second disk group including any disk included in the second disk group selected first.
- the second disk group numbered 1 in Table 2 has been selected, and the second disk group including the disks with disk numbers D1, D2, or D3 is skipped, that is, skipped For the second disk group numbered 2 and 3, continue to allocate the first disk group from the second disk group numbered 4.
- Step 2 Select M2 disks from the plurality of second disk groups that have been selected in step 1, as a disk in the first disk group, until the first disk group includes N1 + M1 disks.
- M2 disks are selected in sequence from the selected second disk group.
- the starting disk in the selection process is the H1th disk, and H1 is a non-negative integer.
- H1 is a non-negative integer.
- the value of the starting disk number H1 may be the same or different.
- step 1 and step 2 you can assign a disk to a first disk group.
- M2 disks are used as disks in the other first disk group until the first disk group includes N1 + M1 disks, and the other M2 disks do not overlap with the M2 disks selected in step two. For example, select M2 disks in sequence from the selected second disk group.
- the starting disk in the selection process is the H2th disk, H2 is a non-negative integer, the value of H2 is different from the value of H1, and the value of H2 and H1
- the difference is M2 to ensure that the other M2 disks do not overlap with the M2 disks selected in step two.
- the 4 disks are selected from the second disk groups in Table 2 and selected from the 4 second disks.
- Select M2 1 disk in the group, so as to obtain 4 disks that make up a first disk group.
- the second disk group numbered 1 is preferred, and the disk numbered D1 is selected as the first disk group numbered 1 One disk; because the second disk group numbered 1 also includes disks numbered D2 and D3, skip the second disk group numbers 2 and 3 that include disks numbered D1, D2, or D3, and select the number Is the second disk group of 4, and selects the disk with the number D4 as the second disk of the first disk group with the number 1; and so on, and assigns multiple first disk groups. It can be seen that the disks of the first disk group and the second disk group are more evenly distributed in the storage space, so that the data of the second erasure code and the data of the first erasure code can be more evenly distributed in the storage space, improving storage Space utilization
- step one selects the disks from the selected multiple second disk groups and assign the first disk group, if the selected multiple second disk groups The disks of are selected as the disks in multiple first disk groups, then look for the second disk group in the storage space that is not assigned as the first disk group, starting with the second disk group, repeat steps one and step Second, assign other first disk groups.
- the storage space includes 48 disks, including 48 second disk groups
- three first disk groups are obtained based on the first 12 second disk groups.
- the first 12 second disk groups All of the disks are assigned as the first disk group, you can start from the 13th second disk group and continue to allocate the 4th first disk group.
- Case 4 If M1 is less than M2, the disk allocation information corresponding to the second erasure code is backed up, and the first disk group and the second disk group are reallocated.
- the second disk group if the first disk group is allocated successfully, then the second disk group is allocated based on the first disk group according to the method shown in case one in step 402, and if the second disk group fails to be allocated, then the second disk group is allocated
- the disk allocation information corresponding to the erasure code restores the second disk group among the X disks in the storage space; if the allocation of the second disk group is successful, the disk allocation information corresponding to the backup second erasure code is deleted.
- the failure to allocate the first disk group may be due to X being less than N1 + M1; the failure to allocate the second disk group may be due to X being less than N2 + M2.
- the metadata server may also generate a Stripe information table according to the first disk group and the second disk group allocated by the object storage server in steps 401 and 402, respectively. And store the Stripe information table generated in the metadata server.
- the first disk group is allocated in the storage space according to the first erasure code corresponding to the target data, so as to store the target data according to the first erasure code through the disks included in the first disk group Erasure code data obtained by encoding data. Since different types of erasure codes correspond to different parameter values, the parameter values corresponding to each type of erasure codes are used to indicate the number of data blocks and the number of check blocks that are encoded according to the corresponding erasure codes, thus It can be seen that the technical solutions provided by the embodiments of the present application can dynamically adjust the allocated disks according to different types of erasure codes, thereby improving the flexibility of disk allocation.
- the data blocks and check blocks corresponding to the erasure code data can be stored relatively evenly in the disks in the storage space, which improves the utilization of the storage space.
- FIG. 5 shows a structural block diagram of a disk distribution device 500 for erasure code data provided by an embodiment of the present application.
- the device includes: an acquisition module 510, a determination module 520, and an allocation module 530.
- the obtaining module 510 is used to obtain target data to be stored.
- the determination module 520 is used to determine the first erasure code corresponding to the target data.
- the first erasure code is used to encode the target data to obtain erasure code data including a data block and a check block.
- Different types of erasure codes The codes correspond to different parameter values, and the parameter values corresponding to each type of erasure codes are used to indicate the number of data blocks and the number of check blocks that are encoded according to the corresponding erasure codes.
- the allocation module 530 is configured to allocate a first disk group in the storage space according to the first erasure code, and the first disk group is one or more, used to store erasure code data.
- the distribution module 530 is used to:
- the first disk group is created in the storage space according to the first erasure code
- the second disk group is used to store the erasure code data obtained according to the second erasure code encoding, then the first erasure code and the second erasure code are stored in the storage space
- the first disk group is allocated in, where the type of the second erasure code is different from the first erasure code.
- the distribution module 530 is used to:
- the number of check blocks corresponding to the first erasure code is equal to the number of check blocks corresponding to the second erasure code
- the number of data blocks corresponding to the first erasure code is equal to that corresponding to the second erasure code
- the number of check blocks corresponding to the first erasure code is equal to the number of check blocks corresponding to the second erasure code, and the number of data blocks corresponding to the first erasure code is not equal to that corresponding to the second erasure code
- the number of data blocks then create the first disk group in the storage space according to the first erasure code
- the first disk group is allocated in the second disk group
- the disk allocation information corresponding to the second erasure code is backed up, and the first disk group and the first Two disk groups.
- the distribution module 530 is used to:
- any first disk group select the disks in the storage space in turn as a disk in the first disk group.
- the number of disks in the first disk group is equal to the number of data blocks corresponding to the first erasure code and the calibration
- the distribution module 530 is used to:
- Select the target disk group from the second disk group, the target disk group is one or more; select at least one disk from the selected target disk group as a disk in the first disk group.
- the distribution module 530 is used to:
- the overlapping second disk group is the second disk including any disk included in the first selected target disk group group.
- the distribution module 530 is used to:
- the second disk group is allocated according to the disk allocation information corresponding to the backup second erasure code
- the second disk group is allocated in the storage space based on the first disk group and the second erasure code
- the second disk group is allocated according to the disk allocation information corresponding to the backup second erasure code
- the disk allocation information corresponding to the backup type 2 erasure code is deleted.
- the data blocks and check blocks corresponding to the erasure code data can be stored relatively evenly in the disks in the storage space, which improves the utilization of the storage space.
- FIG. 6 shows a schematic structural diagram of a disk distribution device provided by an embodiment of the present application.
- the device may be a server or a terminal, specifically:
- the computing system 600 includes a central processing unit (CPU) 601, a system memory 604 including a random access memory (RAM) 602 and a read only memory (ROM) 603, and a system bus 605 connecting the system memory 604 and the central processing unit 601.
- the computing system 600 also includes a basic input / output system (I / O system) 606 that helps transfer information between various devices in the computer, and a mass storage device for storing the operating system 613, application programs 614, and other program modules 615 607.
- I / O system basic input / output system
- the basic input / output system 606 includes a display 608 for displaying information and an input device 609 such as a mouse and a keyboard for a user to input information.
- the display 608 and the input device 609 are both connected to the central processing unit 601 through the input and output controller 610 connected to the system bus 605.
- the basic input / output system 606 may also include an input-output controller 610 for receiving and processing input from a number of other devices such as a keyboard, mouse, or electronic stylus.
- the input output controller 610 also provides output to a display screen, printer, or other type of output device.
- the mass storage device 607 is connected to the central processing unit 601 through a mass storage controller (not shown) connected to the system bus 605.
- Mass storage device 607 and its associated computer-readable medium provide non-volatile storage for computing system 600. That is, the mass storage device 607 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM drive.
- Computer-readable media may include computer storage media and communication media.
- Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data.
- Computer storage media include RAM, ROM, EPROM, EEPROM, flash memory, or other solid-state storage technologies, CD-ROM, DVD, or other optical storage, tape cassettes, magnetic tape, magnetic disk storage, or other magnetic storage devices.
- RAM random access memory
- ROM read-only memory
- EPROM Erasable programmable read-only memory
- EEPROM electrically erasable programmable read-only memory
- flash memory or other solid-state storage technologies
- CD-ROM, DVD or other optical storage
- tape cassettes magnetic tape
- magnetic disk storage or other magnetic storage devices.
- computer storage medium is not limited to the above types.
- the above-mentioned system memory 604 and mass storage device 607 may be collectively referred to as a memory.
- the computing system 600 may also be operated by a remote computer connected to the network through a network such as the Internet. That is, the computing system 600 can be connected to the network 612 through the network interface unit 611 connected to the system bus 605, or the network interface unit 611 can also be used to connect to other types of networks or remote computer systems (not shown).
- the above memory also includes one or more programs.
- One or more programs are stored in the memory and configured to be executed by the CPU.
- the one or more programs include instructions for performing a disk allocation method for erasure code data provided in any of FIGS. 3 and 4.
- An embodiment of the present application also provides a non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by the processor of the computing system, the computing system can execute any of the provided in FIG. 3 and FIG. 4 Disk allocation method for erasure code data.
- a computer program product containing instructions that, when run on a computer, causes the computer to execute instructions for performing a disk allocation method for erasure code data provided in any of FIGS. 3 and 4.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Human Computer Interaction (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
Description
Claims (16)
- 一种磁盘分配方法,其特征在于,所述方法包括:获取待存储的目标数据;确定所述目标数据对应的第一纠删码,所述第一纠删码用于对所述目标数据进行编码,得到包括数据块和校验块的纠删码数据,不同类型的纠删码对应不同的参数值,每种类型的纠删码对应的参数值用于指示按照相应纠删码编码得到的数据块的个数和校验块的个数;根据所述第一纠删码在存储空间中分配第一磁盘组,所述第一磁盘组为一个或者多个,用于存储所述纠删码数据。
- 根据权利要求1所述的方法,其特征在于,所述根据所述第一纠删码在存储空间中分配第一磁盘组,包括:若所述存储空间中不存在已分配的磁盘组,则根据所述第一纠删码在所述存储空间中创建所述第一磁盘组;若所述存储空间中存在已分配的第二磁盘组,所述第二磁盘组用于存储根据第二纠删码编码得到的纠删码数据,则根据所述第一纠删码及所述第二纠删码在所述存储空间中分配所述第一磁盘组,其中,所述第二纠删码的类型不同于所述第一纠删码。
- 根据权利要求2所述的方法,其特征在于,所述根据所述第一纠删码及所述第二纠删码在所述存储空间中分配所述第一磁盘组,包括:若所述第一纠删码对应的校验块的个数等于所述第二纠删码对应的校验块的个数,且所述第一纠删码对应的数据块的个数等于所述第二纠删码对应的数据块的个数,则将所述第二磁盘组作为所述第一磁盘组;若所述第一纠删码对应的校验块的个数等于所述第二纠删码对应的校验块的个数,且所述第一纠删码对应的数据块的个数不等于所述第二纠删码对应的数据块的个数,则根据所述第一纠删码在所述存储空间中创建所述第一磁盘组;若所述第一纠删码对应的校验块的个数大于所述第二纠删码对应的校验块的个数,则基于所述第二磁盘组分配所述第一磁盘组;若所述第一纠删码对应的校验块的个数小于所述第二纠删码对应的校验块 的个数,则备份所述第二纠删码对应的磁盘分配信息,重新分配所述第一磁盘组和所述第二磁盘组。
- 根据权利要求2或3所述的方法,其特征在于,所述根据所述第一纠删码在所述存储空间中创建所述第一磁盘组,包括:对于任一第一磁盘组,依次选择存储空间中的磁盘作为所述第一磁盘组中的一个磁盘,所述第一磁盘组中的磁盘的个数等于所述第一纠删码对应的数据块的个数和校验块的个数之和,多个所述第一磁盘组的起始磁盘之间至少间隔有一个磁盘。
- 根据权利要求3所述的方法,其特征在于,所述基于所述第二磁盘组分配所述第一磁盘组,包括:从所述第二磁盘组中选择目标磁盘组,所述目标磁盘组为一个或多个;从所选择的目标磁盘组中分别选择至少一个磁盘,作为一个第一磁盘组中的磁盘。
- 根据权利要求5所述的方法,其特征在于,所述从所述第二磁盘组中选择目标磁盘组,包括:跳过重叠的第二磁盘组,从剩余的第二磁盘组中依次选择所述目标磁盘组,所述重叠的第二磁盘组是包括在先选择的目标磁盘组中所包括的任一磁盘的第二磁盘组。
- 根据权利要求3所述的方法,其特征在于,所述重新分配所述第一磁盘组和所述第二磁盘组,包括:在所述存储空间中分配所述第一磁盘组;若分配所述第一磁盘组失败,则根据备份的所述第二纠删码对应的磁盘分配信息分配第二磁盘组;若分配所述第一磁盘组成功,则基于所述第一磁盘组和所述第二纠删码,在所述存储空间中分配所述第二磁盘组;若分配所述第二磁盘组失败,则根据备份的所述第二纠删码对应的磁盘分 配信息分配第二磁盘组;若分配所述第二磁盘组成功,则删除备份的所述第二类型纠删码对应的磁盘分配信息。
- 一种磁盘分配装置,其特征在于,所述装置包括:获取模块,用于获取待存储的目标数据;确定模块,用于确定所述目标数据对应的第一纠删码,所述第一纠删码用于对所述目标数据进行编码,得到包括数据块和校验块的纠删码数据,不同类型的纠删码对应不同的参数值,每种类型的纠删码对应的参数值用于指示按照相应纠删码编码得到的数据块的个数和校验块的个数;分配模块,用于根据所述第一纠删码在存储空间中分配第一磁盘组,所述第一磁盘组为一个或者多个,用于存储所述纠删码数据。
- 根据权利要求8所述的装置,其特征在于,所述分配模块,用于:若所述存储空间中不存在已分配的磁盘组,则根据所述第一纠删码在所述存储空间中创建所述第一磁盘组;若所述存储空间中存在已分配的第二磁盘组,所述第二磁盘组用于存储根据第二纠删码编码得到的纠删码数据,则根据所述第一纠删码及所述第二纠删码在所述存储空间中分配所述第一磁盘组,其中,所述第二纠删码的类型不同于所述第一纠删码。
- 根据权利要求9所述的装置,其特征在于,所述分配模块,用于:若所述第一纠删码对应的校验块的个数等于所述第二纠删码对应的校验块的个数,且所述第一纠删码对应的数据块的个数等于所述第二纠删码对应的数据块的个数,则将所述第二磁盘组作为所述第一磁盘组;若所述第一纠删码对应的校验块的个数等于所述第二纠删码对应的校验块的个数,且所述第一纠删码对应的数据块的个数不等于所述第二纠删码对应的数据块的个数,则根据所述第一纠删码在所述存储空间中创建所述第一磁盘组;若所述第一纠删码对应的校验块的个数大于所述第二纠删码对应的校验块的个数,则在所述第二磁盘组中分配所述第一磁盘组;若所述第一纠删码对应的校验块的个数小于所述第二纠删码对应的校验块的个数,则备份所述第二纠删码对应的磁盘分配信息,重新分配所述第一磁盘组和所述第二磁盘组。
- 根据权利要求9或10所述的装置,其特征在于,所述分配模块,用于对于任一第一磁盘组,依次选择存储空间中的磁盘作为所述第一磁盘组中的一个磁盘,所述第一磁盘组中的磁盘的个数等于所述第一纠删码对应的数据块的个数和校验块的个数之和,多个所述第一磁盘组的起始磁盘之间至少间隔有一个磁盘。
- 根据权利要求10所述的装置,其特征在于,所述分配模块,用于从所述第二磁盘组中选择目标磁盘组,所述目标磁盘组为一个或多个;从所选择的目标磁盘组中分别选择至少一个磁盘,作为一个第一磁盘组中的磁盘。
- 根据权利要求12所述的装置,其特征在于,所述分配模块,用于跳过重叠的第二磁盘组,从剩余的第二磁盘组中依次选择所述目标磁盘组,所述重叠的第二磁盘组是包括在先选择的目标磁盘组中所包括的任一磁盘的第二磁盘组。
- 根据权利要求10所述的装置,其特征在于,所述分配模块,用于:在所述存储空间中分配所述第一磁盘组;若分配所述第一磁盘组失败,则根据备份的所述第二纠删码对应的磁盘分配信息分配第二磁盘组;若分配所述第一磁盘组成功,则基于所述第一磁盘组和所述第二纠删码,在所述存储空间中分配所述第二磁盘组;若分配所述第二磁盘组失败,则根据备份的所述第二纠删码对应的磁盘分配信息分配第二磁盘组;若分配所述第二磁盘组成功,则删除备份的所述第二类型纠删码对应的磁盘分配信息。
- 一种磁盘分配装置,其特征在于,所述装置包括处理器和存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如权利要求1至7任一项所述的磁盘分配方法。
- 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如权利要求1至7任一项所述的磁盘分配方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811332967.4A CN111176880B (zh) | 2018-11-09 | 2018-11-09 | 磁盘分配方法、装置和可读存储介质 |
CN201811332967.4 | 2018-11-09 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020094134A1 true WO2020094134A1 (zh) | 2020-05-14 |
Family
ID=70611685
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/116783 WO2020094134A1 (zh) | 2018-11-09 | 2019-11-08 | 磁盘分配方法、装置和可读存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111176880B (zh) |
WO (1) | WO2020094134A1 (zh) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113918378A (zh) * | 2020-07-10 | 2022-01-11 | 华为技术有限公司 | 数据存储方法、存储系统、存储设备及存储介质 |
CN113093996B (zh) * | 2021-04-13 | 2024-05-31 | 中国工商银行股份有限公司 | 存储分配方法、装置、计算机设备及可读存储介质 |
CN113626649A (zh) * | 2021-08-02 | 2021-11-09 | Oppo广东移动通信有限公司 | 数据存储方法、装置、存储介质以及电子设备 |
CN116010160A (zh) * | 2023-03-09 | 2023-04-25 | 安超云软件有限公司 | 分布式文件系统的纠删码数据分布的方法及应用 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140040702A1 (en) * | 2012-07-31 | 2014-02-06 | International Business Machines Corporation | Managing a storage array |
CN104598162A (zh) * | 2013-10-31 | 2015-05-06 | 国际商业机器公司 | 用于跨存储设备写入数据的方法和系统 |
CN106708651A (zh) * | 2016-11-16 | 2017-05-24 | 北京三快在线科技有限公司 | 基于纠删码的部分写入方法及装置、存储介质、设备 |
CN107943421A (zh) * | 2017-11-30 | 2018-04-20 | 成都华为技术有限公司 | 一种基于分布式存储系统的分区划分方法及装置 |
CN108334419A (zh) * | 2017-12-25 | 2018-07-27 | 华为技术有限公司 | 一种数据恢复的方法和装置 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104503706B (zh) * | 2014-12-23 | 2017-10-10 | 中国科学院计算技术研究所 | 一种基于磁盘阵列的数据存储及读取方法 |
WO2016058289A1 (zh) * | 2015-01-20 | 2016-04-21 | 北京大学深圳研究生院 | 一种能修复多个节点失效的mds纠删码 |
-
2018
- 2018-11-09 CN CN201811332967.4A patent/CN111176880B/zh active Active
-
2019
- 2019-11-08 WO PCT/CN2019/116783 patent/WO2020094134A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140040702A1 (en) * | 2012-07-31 | 2014-02-06 | International Business Machines Corporation | Managing a storage array |
CN104598162A (zh) * | 2013-10-31 | 2015-05-06 | 国际商业机器公司 | 用于跨存储设备写入数据的方法和系统 |
CN106708651A (zh) * | 2016-11-16 | 2017-05-24 | 北京三快在线科技有限公司 | 基于纠删码的部分写入方法及装置、存储介质、设备 |
CN107943421A (zh) * | 2017-11-30 | 2018-04-20 | 成都华为技术有限公司 | 一种基于分布式存储系统的分区划分方法及装置 |
CN108334419A (zh) * | 2017-12-25 | 2018-07-27 | 华为技术有限公司 | 一种数据恢复的方法和装置 |
Also Published As
Publication number | Publication date |
---|---|
CN111176880B (zh) | 2021-08-13 |
CN111176880A (zh) | 2020-05-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020094134A1 (zh) | 磁盘分配方法、装置和可读存储介质 | |
US11048416B2 (en) | Method, apparatus and computer program product for managing storage system | |
US10146624B1 (en) | Disk extent rebalancing in mapped RAID storage arrays | |
EP3208714B1 (en) | Data reconstruction method, apparatus and system in distributed storage system | |
CN107807794B (zh) | 一种数据存储方法和装置 | |
US9772906B2 (en) | Disaster recovery systems and methods | |
WO2020000817A1 (zh) | 一种归置组所属硬盘分配方法、系统、装置及存储介质 | |
US10664392B2 (en) | Method and device for managing storage system | |
CN112764661B (zh) | 用于管理存储系统的方法、设备和计算机程序产品 | |
JP2015503156A (ja) | ディスク記憶に消去符号化データを割り当てるための方法および装置 | |
CN110096218B (zh) | 用于为存储对象提供raid数据保护的方法、系统和介质 | |
US11074130B2 (en) | Reducing rebuild time in a computing storage environment | |
US10761761B2 (en) | Method and device for managing storage system | |
CN113126890B (zh) | 用于存储的方法、设备和计算机程序产品 | |
US20190347165A1 (en) | Apparatus and method for recovering distributed file system | |
CN112732168B (zh) | 用于管理存储系统的方法、设备和计算机程序产品 | |
CN109213429B (zh) | 存储管理方法和设备 | |
CN110442298A (zh) | 存储设备异常检测方法及装置、分布式存储系统 | |
US10168937B2 (en) | Storage space allocation | |
CN111857535B (zh) | 用于存储管理的方法、电子设备和计算机可读存储介质 | |
US20230179423A1 (en) | Method and apparatus for storing blockchain transaction data and distributed storage system using the same | |
EP3846017A1 (en) | Resource allocation method and device for hard disks in distributed storage system | |
WO2015085802A1 (zh) | 数据存储方法及存储装置 | |
CN112732167B (zh) | 用于管理存储系统的方法、设备 | |
CN113986846A (zh) | 数据处理方法、系统、设备及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19881572 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19881572 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19881572 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03.02.2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19881572 Country of ref document: EP Kind code of ref document: A1 |