CN116466881A - RAID stripe remapping method, system, equipment and storage medium - Google Patents

RAID stripe remapping method, system, equipment and storage medium Download PDF

Info

Publication number
CN116466881A
CN116466881A CN202310352763.1A CN202310352763A CN116466881A CN 116466881 A CN116466881 A CN 116466881A CN 202310352763 A CN202310352763 A CN 202310352763A CN 116466881 A CN116466881 A CN 116466881A
Authority
CN
China
Prior art keywords
pointer
counter
list
value
stripe
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310352763.1A
Other languages
Chinese (zh)
Inventor
史琪
邵海波
朱雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202310352763.1A priority Critical patent/CN116466881A/en
Publication of CN116466881A publication Critical patent/CN116466881A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0689Disk arrays, e.g. RAID, JBOD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a RAID stripe remapping method, which comprises the following steps: obtaining a stripe to be remapped and a corresponding first pointer list and determining the type of the stripe, wherein the stripe to be remapped comprises a plurality of sub-stripes, and the first pointer list comprises a plurality of pointer areas; initializing a first counter and a second counter according to the type of the strip, wherein the first counter is used for recording the serial number of the sub-strip which is currently remapped, and the second counter is used for recording the number of discs to be processed; and remapping pointers in the first pointer list into a second pointer list according to the sequence of the sub-stripes. The invention also discloses a system, computer equipment and a readable storage medium. The scheme provided by the invention avoids fragmented reading by remapping the pointers in the first pointer list into the second list.

Description

RAID stripe remapping method, system, equipment and storage medium
Technical Field
The present invention relates to the field of storage, and in particular, to a RAID stripe remapping method, system, device, and storage medium.
Background
RAID, also known as redundant array of independent disks, is a storage solution that combines multiple independent disks to form a large logical array. RAID technology has the advantages of improving data reliability and I/O performance, and can provide high-performance storage with moderate cost and high reliability for a host. The method is mainly used for providing high-end storage functions and redundant data security for the large server. Data is distributed to the respective hard disks in units of blocks. The basic functions are as follows: 1) Striping the disk data to realize data block access; 2) By storing parity information, data redundancy protection is realized; RAID has different levels, for example RAID 5: RAID5 requires at least 3 hard disks, wherein one hard disk is used for storing check codes, and if one hard disk is damaged, the data on the damaged hard disk can be recovered through the data and the check codes uniformly distributed in each hard disk. When a host issues an IO request, how to map to the storage space of the physical hard disk of the group RAID needs to be defined.
The data in RAID disk is divided into a plurality of data blocks according to 4KB as a unit, each data block corresponds to a pointer index with 32 bit width, and the pointer indexes are stored in a memory pool in the form of list page pages according to a certain rule. The list arranged according to the IO sequence presented by the SOC to the host is called an A_list (absolute list), and in order to facilitate the raid acceleration engine to process data, the data in the stripes need to be integrated according to the rule oriented to the "striphead", so that pointers in the A_list need to be reordered according to the rule oriented to the "striphead" to form an H_list (horizontal list).
If a_list is a list that is continuous by column, h_list is a list that is continuous by row. If the list ordered by row is directly output, a large interval, fragmented read A_list will result. If the A_list is read continuously, the H_list output is caused to be in a state of large interval and fragmentation. Both of the above accesses are very hostile to DRAM.
Disclosure of Invention
In view of this, in order to overcome at least one aspect of the above-mentioned problems, an embodiment of the present invention provides a RAID stripe remapping method, including the following steps:
obtaining a stripe to be remapped and a corresponding first pointer list and determining the type of the stripe, wherein the stripe to be remapped comprises a plurality of sub-stripes, and the first pointer list comprises a plurality of pointer areas;
initializing a first counter and a second counter according to the type of the strip, wherein the first counter is used for recording the serial number of the sub-strip which is currently remapped, and the second counter is used for recording the number of discs to be processed;
remapping pointers in the first list of pointers into a second list of pointers in the order of the sub-stripes, wherein the remapping of the first list of pointers based on each of the sub-stripes performs the steps of:
determining an initial value of a third counter according to the value of the first counter and updating the third counter by taking the number of the sub-stripes as a stepping value, wherein the third counter records the current position of the first pointer list;
and subtracting 1 from the value of the second counter after updating the third counter each time until the value of the second counter is reduced to 0 and the updating of the third counter is stopped, analyzing the value of each third counter, and taking out the corresponding pointer from the corresponding pointer area of the first pointer list according to the analysis result and putting the corresponding pointer into the second pointer list.
In some embodiments, further comprising:
when the stripes are not full stripes, determining that the remapping sequence is an original data pointer, a pointer of original check data corresponding to the original data, a new data pointer and a pointer of new check data corresponding to the new data based on the remapping of each sub-stripe;
and when the stripes are in pseudo-full stripes, and the first pointer list is remapped based on each sub-stripe, determining that the remapping sequence is an original data pointer, a new data pointer, a pointer of new check data corresponding to the new data and a checksum pointer.
In some embodiments, determining the initial value of the third counter from the value of the first counter further comprises:
in response to the stripe being a non-full stripe and when either an original data pointer or a new data pointer is currently remapped, an initial value of the third counter is a value of the first counter minus an offset unit offset of the stripe;
in response to the stripe being a non-full stripe and when remapping is currently performed on a pointer of original check data or a pointer of new check data, subtracting the stripe unit offset from the value of the first counter, if the difference is less than 0, adding the stripe unit size to the difference as an initial value of the third counter, and if the difference is greater than 0, directly taking the difference as the initial value of the third counter;
responding to the fact that the stripe is a pseudo-full stripe and when the original data pointer, the new data pointer or the pointer corresponding to the checksum is remapped currently, the initial value of the third counter is the value of the first counter;
in response to the stripe being a pseudo-full stripe and the pointer to new parity data being currently remapped, an initial value of the third counter is a value of the first counter plus a parity offset.
In some embodiments, resolving the value of each third counter, and according to the resolving result, taking out the corresponding pointer from the corresponding pointer region of the first pointer list and putting the corresponding pointer into the second pointer list, further including:
acquiring the current value of the third counter;
judging whether the value of the third counter is smaller than 0 or not when the stripe is not full and the original data pointer or the new data pointer is remapped currently;
filling an invalid pointer into the second pointer list in response to being smaller than 0;
and in response to being greater than 0, placing a pointer shifted from a start position of an original data pointer region or a new data pointer region of the first pointer list by a value of the third counter into the second pointer list.
In some embodiments, resolving the value of each third counter, and according to the resolving result, taking out the corresponding pointer from the corresponding region of the first pointer list and putting the pointer into the second pointer list, further including:
acquiring the current value of the third counter;
and when the stripe is not full and the pointer of the original check data or the pointer of the new check data is currently remapped, placing the pointer which is shifted from the initial position of the original check data pointer area or the new check data pointer area of the first pointer list by the value of the third counter into the second pointer list.
In some embodiments, resolving the value of each third counter, and according to the resolving result, taking out the corresponding pointer from the corresponding region of the first pointer list and putting the pointer into the second pointer list, further including:
acquiring the current value of the third counter, putting the original data, the new data pointer area and the check pointer area in the first pointer list into a first buffer, putting the check sum pointer area into a second buffer, and acquiring the initial position and the end position of the new data pointer recorded in the first pointer list;
if the value of the third counter falls between the starting position and the ending position when the stripe is a pseudo full stripe and the original data pointer is currently remapped, filling an invalid pointer into the second pointer list; if the value of the third counter does not fall between the starting position and the ending position, placing a pointer which is shifted from the starting position of the original data pointer area and the new data pointer area in the first cache by the value of the third counter into the second pointer list;
when the stripe is a pseudo full stripe and the new data pointer is currently remapped, if the value of a third counter falls between the starting position and the ending position, placing the pointer which is shifted from the starting position of the original data and the new data pointer area in the first cache by the value of the third counter into the second pointer list; and if the value of the third counter does not fall between the starting position and the ending position, filling an invalid pointer into the second pointer list.
In some embodiments, resolving the value of each third counter, and according to the resolving result, taking out the corresponding pointer from the corresponding region of the first pointer list and putting the pointer into the second pointer list, further including:
acquiring the current value of the third counter, and placing the original data and new data pointer areas and the check pointer areas in the first pointer list into a first cache, and placing the check sum pointer areas into a second cache;
when the stripe is a pseudo full stripe and the pointer of the new check data is remapped currently, placing the pointer which is shifted from the initial position of the pointer area of the original data and the new data in the first cache by the value of the third counter into the second pointer list;
and in response to the stripe being a pseudo-full stripe and when the checksum pointer is currently remapped, placing a pointer in the second pointer list after shifting the value of the third counter from the starting position of the checksum pointer region in the second cache.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a RAID stripe remapping system, including:
an acquisition module configured to acquire a stripe to be remapped and a corresponding first pointer list and determine a type of the stripe, wherein the stripe to be remapped comprises a plurality of sub-stripes, and the first pointer list comprises a plurality of pointer areas;
the initialization module is configured to initialize a first counter and a second counter according to the type of the strip, wherein the first counter is used for recording the serial number of the sub-strip which is currently remapped, and the second counter is used for recording the number of discs to be processed;
a remapping module configured to remap pointers in the first list of pointers into a second list of pointers in the order of the sub-stripes, wherein the remapping of the first list of pointers on a per sub-stripe basis performs the steps of:
determining an initial value of a third counter according to the value of the first counter and updating the third counter by taking the number of the sub-stripes as a stepping value, wherein the third counter records the current position of the first pointer list;
and subtracting 1 from the value of the second counter after updating the third counter each time until the value of the second counter is reduced to 0 and the updating of the third counter is stopped, analyzing the value of each third counter, and taking out the corresponding pointer from the corresponding pointer area of the first pointer list according to the analysis result and putting the corresponding pointer into the second pointer list.
Based on the same inventive concept, according to another aspect of the present invention, an embodiment of the present invention further provides a computer apparatus, including:
at least one processor; and
a memory storing a computer program executable on the processor, the processor executing steps of any one of the RAID stripe remapping methods described above.
Based on the same inventive concept, according to another aspect of the present invention, there is also provided a computer readable storage medium storing a computer program which, when executed by a processor, performs the steps of any of the RAID stripe remapping methods described above.
The invention has one of the following beneficial technical effects: the scheme provided by the invention avoids fragmented reading by remapping the pointers in the first pointer list into the second list.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other embodiments may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating a RAID stripe remapping method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of data distribution of a non-full stripe RAID disk according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a pointer distribution of a first list corresponding to FIG. 2 according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of data distribution of a full stripe RAID disk according to an embodiment of the present invention;
FIG. 5 is a diagram of a pointer distribution of a first list corresponding to FIG. 3 according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a RAID stripe remapping system according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a computer device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention will be described in further detail with reference to the accompanying drawings.
It should be noted that, in the embodiments of the present invention, all the expressions "first" and "second" are used to distinguish two entities with the same name but different entities or different parameters, and it is noted that the "first" and "second" are only used for convenience of expression, and should not be construed as limiting the embodiments of the present invention, and the following embodiments are not described one by one.
According to an aspect of the present invention, an embodiment of the present invention proposes a RAID stripe remapping method, as shown in fig. 1, which may include the steps of:
s1, obtaining a stripe to be remapped and a corresponding first pointer list and determining the type of the stripe, wherein the stripe to be remapped comprises a plurality of sub-stripes, and the first pointer list comprises a plurality of pointer areas;
s2, initializing a first counter and a second counter according to the type of the strip, wherein the first counter is used for recording the serial number of the sub-strip which is currently remapped, and the second counter is used for recording the number of discs to be processed;
s3, remapping pointers in the first pointer list into a second pointer list according to the sequence of the sub-stripes, wherein when the first pointer list is remapped based on each sub-stripe, the following steps are executed:
determining an initial value of a third counter according to the value of the first counter and updating the third counter by taking the number of the sub-stripes as a stepping value, wherein the third counter records the current position of the first pointer list;
and subtracting 1 from the value of the second counter after updating the third counter each time until the value of the second counter is reduced to 0 and the updating of the third counter is stopped, analyzing the value of each third counter, and taking out the corresponding pointer from the corresponding pointer area of the first pointer list according to the analysis result and putting the corresponding pointer into the second pointer list.
The scheme provided by the invention avoids fragmented reading by remapping the pointers in the first pointer list into the second list.
In some embodiments, a non-full scene refers to data to be written to disk that does not cover the entire stripe. A pseudo-full scene refers to data to be written to disk that does not cover the entire stripe, but reads old data from uncovered data blocks in disk, filling the entire stripe. The data distribution of the non-full stripe RAID disk is shown in FIG. 2, the pointer distribution of the corresponding first list is shown in FIG. 3, the data distribution of the pseudo-full stripe RAID disk is shown in FIG. 4, and the pointer distribution of the corresponding first list is shown in FIG. 5.
It should be noted that D represents an original data pointer, D 'represents a new data pointer, P/Q/R is an original check data pointer corresponding to the original data, P'/Q '/R' is a new check data pointer corresponding to the new data, and PPL-P/PPL-Q/PPL-R is a checksum pointer. B represents empty.
In some embodiments, further comprising:
when the stripes are not full stripes, determining that the remapping sequence is an original data pointer, a pointer of original check data corresponding to the original data, a new data pointer and a pointer of new check data corresponding to the new data based on the remapping of each sub-stripe;
and when the stripes are in pseudo-full stripes, and the first pointer list is remapped based on each sub-stripe, determining that the remapping sequence is an original data pointer, a new data pointer, a pointer of new check data corresponding to the new data and a checksum pointer.
In some embodiments, determining the initial value of the third counter from the value of the first counter further comprises:
in response to the stripe being a non-full stripe and when either an original data pointer or a new data pointer is currently remapped, an initial value of the third counter is a value of the first counter minus an offset unit offset of the stripe;
in response to the stripe being a non-full stripe and when remapping is currently performed on a pointer of original check data or a pointer of new check data, subtracting the stripe unit offset from the value of the first counter, if the difference is less than 0, adding the stripe unit size to the difference as an initial value of the third counter, and if the difference is greater than 0, directly taking the difference as the initial value of the third counter;
responding to the fact that the stripe is a pseudo-full stripe and when the original data pointer, the new data pointer or the pointer corresponding to the checksum is remapped currently, the initial value of the third counter is the value of the first counter;
in response to the stripe being a pseudo-full stripe and the pointer to new parity data being currently remapped, an initial value of the third counter is a value of the first counter plus a parity offset.
In some embodiments, resolving the value of each third counter, and according to the resolving result, taking out the corresponding pointer from the corresponding pointer region of the first pointer list and putting the corresponding pointer into the second pointer list, further including:
acquiring the current value of the third counter;
judging whether the value of the third counter is smaller than 0 or not when the stripe is not full and the original data pointer or the new data pointer is remapped currently;
filling an invalid pointer into the second pointer list in response to being smaller than 0;
and in response to being greater than 0, placing a pointer shifted from a start position of an original data pointer region or a new data pointer region of the first pointer list by a value of the third counter into the second pointer list.
In some embodiments, resolving the value of each third counter, and according to the resolving result, taking out the corresponding pointer from the corresponding region of the first pointer list and putting the pointer into the second pointer list, further including:
acquiring the current value of the third counter;
and when the stripe is not full and the pointer of the original check data or the pointer of the new check data is currently remapped, placing the pointer which is shifted from the initial position of the original check data pointer area or the new check data pointer area of the first pointer list by the value of the third counter into the second pointer list.
In some embodiments, resolving the value of each third counter, and according to the resolving result, taking out the corresponding pointer from the corresponding region of the first pointer list and putting the pointer into the second pointer list, further including:
acquiring the current value of the third counter, putting the original data, the new data pointer area and the check pointer area in the first pointer list into a first buffer, putting the check sum pointer area into a second buffer, and acquiring the initial position and the end position of the new data pointer recorded in the first pointer list;
if the value of the third counter falls between the starting position and the ending position when the stripe is a pseudo full stripe and the original data pointer is currently remapped, filling an invalid pointer into the second pointer list; if the value of the third counter does not fall between the starting position and the ending position, placing a pointer which is shifted from the starting position of the original data pointer area and the new data pointer area in the first cache by the value of the third counter into the second pointer list;
when the stripe is a pseudo full stripe and the new data pointer is currently remapped, if the value of a third counter falls between the starting position and the ending position, placing the pointer which is shifted from the starting position of the original data and the new data pointer area in the first cache by the value of the third counter into the second pointer list; and if the value of the third counter does not fall between the starting position and the ending position, filling an invalid pointer into the second pointer list.
In some embodiments, resolving the value of each third counter, and according to the resolving result, taking out the corresponding pointer from the corresponding region of the first pointer list and putting the pointer into the second pointer list, further including:
acquiring the current value of the third counter, and placing the original data and new data pointer areas and the check pointer areas in the first pointer list into a first cache, and placing the check sum pointer areas into a second cache;
when the stripe is a pseudo full stripe and the pointer of the new check data is remapped currently, placing the pointer which is shifted from the initial position of the pointer area of the original data and the new data in the first cache by the value of the third counter into the second pointer list;
and in response to the stripe being a pseudo-full stripe and when the checksum pointer is currently remapped, placing a pointer in the second pointer list after shifting the value of the third counter from the starting position of the checksum pointer region in the second cache.
Specifically, firstly, the pointer is read in the format of a_list, and the read pointer is stored in different buffers according to whether the pointer indicates the data of the check disk, the data of the data disk or the PPL data. By controlling a plurality of counters, corresponding pointers are taken out from different positions of the buffer and organized into H_list. The pointers in each sub_list of the h_list are pointers of all data blocks required for calculating check data in one strip head, and the mapping strategy of each mode is specifically as follows:
1) Non-full stripe mode:
the organization format (remapping order) of each sub_list in the non-full stripe H_list is D, P, Q, R, D ', P', Q ', R', PPL-P, PPL-R, PPL-Q.
The non-full stripe mapping process requires control of three counters: cnt1, cnt2, cnt3. These three counters are associated with the RAID disks, cnt1 is used to record the number of sub-stripes processed, cnt2 is used to record the number of disks to be processed, and cnt3 is used to record the pointer position of the current process.
The type D pointer organization strategy is as follows:
a. initializing cnt2 into the number of data disks which need to be processed by one IO minus 1;
cnt1 is the current line number of the process, and each process line is increased by 1;
cnt3 is initialized to the value corresponding to cnt1 minus chunk offset;
d. the value of cnt3 is resolved in the form of a complement. cnt3 is less than 0, filling an invalid pointer into the H_list; cnt3 is 0 or more, and the corresponding pointer is taken out from the initial position offset cnt3 of the D_buffer (the area where the D type pointer is recorded), and H_list is filled.
e. Self-incrementing the cnt3 counter step_num;
if cnt2 decreases to 0, the next pointer type is processed. Otherwise, jumping back to the step d.
The P/Q/R type (different raid has different types of check data) pointer organization policy is as follows:
a. initializing cnt2 as the number of check disks needing to be processed by one IO minus 1;
cnt1 is the currently processed line number;
c. record cnt1 minus chunk offset. If the result is less than 0, the value is added with the chunk_size to be used as the initial value of cnt 3; if the result is 0 or more, the result is set as the cnt3 initial value.
d. The pointer fill h_list is taken from the position of the p_buffer (the region where the P pointer type is recorded) offset cnt3 counter value.
Cnt3 self-increasing step_num;
f. if cnt2 is 0, skipping to process the pointer of the next type or if there is no pointer of the next type, remapping the first pointer list based on the next sub-stripe, otherwise cnt2 is decremented by 1, and skipping back to step d.
The D 'type pointer organizes the strategy with the D type pointer, and the P'/Q '/R' type pointer organizes the strategy with the P/Q/R type pointer.
2) Pseudo-full stripe mode:
the organization format (remapping order) of each sub_list in the pseudo-full stripe h_list is: D. d ', P', Q ', R', PPL-P, PPL-Q, PPL-R. And placing the original data, the new data pointer area and the check pointer area in the first pointer list into buffer0 (first buffer), and placing the check sum pointer area into buffer1 (second buffer). Pointers are read from the buffer0 and buffer1, respectively, to constitute h_list. Before organizing the h_list, it is necessary to record the start position D ' start and end position D ' end of the D ' pointer in buffer0, and determine whether to insert an invalid pointer in the h_list according to the positions. As with the non-full stripe mode, the pseudo-full stripe mode also requires maintaining three counters: cnt1, cnt2, cnt3.
Type D pointer organization policy:
a. initializing cnt2 into the number of data disks which need to be processed by one IO minus 1;
cnt1 is the current line number of the process, and each process line is increased by 1;
c. and taking the line number as the initial value of the cnt3, outputting an invalid pointer if the cnt3 falls in the range of [ D 'start: D' end ], and filling the value of the corresponding position of the buffer0 into the H_list if the cnt3 does not fall in the range. cnt3 is self-incremented by a step value corresponding to the number of strip heads contained in the current A_list block.
d. If cnt2 is 0, jumping out to carry out the subsequent step, otherwise, reducing cnt2 by 1, and jumping back to the step c.
The D 'type pointer organization strategy is similar to the D type pointer organization strategy, and the difference is that in the step c, the cnt3 of the D' type pointer falls on [ D 'start: D' end ], the value of the corresponding position of buffer0 is filled into H_list, otherwise, an invalid pointer is output.
P '/Q '/R ' type pointer organization strategy:
a. initializing cnt2 as the number of check disks needing to be processed by one IO minus 1;
and b, adding a line number to the Party_offset to serve as an initial value of cnt3, wherein Party_offset is the position of the first pointer of the check disk in buffer 0.
c. The pointer fill h_list is taken from the position of buffer0 offset cnt3 counter value.
The cnt3 counter self-increments by a step value corresponding to the number of strip heads contained in the current a_list block.
e. If cnt2 is 0, jumping out to carry out the subsequent step, otherwise, reducing cnt2 by 1, and jumping back to the step c.
The PPL-P/PPL-Q/PPL-R type pointer organization strategy is identical to the P '/Q'/R 'type pointer, except that the P'/Q '/R' type pointer is from buffer1 and its cnt3 initial value is the line number.
The scheme provided by the invention avoids fragmented reading by remapping the pointers in the first pointer list into the second list.
Based on the same inventive concept, according to another aspect of the present invention, there is further provided a RAID stripe remapping system 400, as shown in fig. 6, including:
an obtaining module 401 configured to obtain a stripe to be remapped and a corresponding first pointer list and determine a type of the stripe, wherein the stripe to be remapped comprises a plurality of sub-stripes, and the first pointer list comprises a plurality of pointer areas;
an initialization module 402, configured to initialize a first counter and a second counter according to the type of the stripe, where the first counter is used to record the number of the sub-stripe that is currently remapped, and the second counter records the number of disks to be processed;
a remapping module 403 configured to remap pointers in the first list of pointers into a second list of pointers in the order of the sub-stripes, wherein the remapping of the first list of pointers on a per sub-stripe basis performs the following steps:
determining an initial value of a third counter according to the value of the first counter and updating the third counter by taking the number of the sub-stripes as a stepping value, wherein the third counter records the current position of the first pointer list;
and subtracting 1 from the value of the second counter after updating the third counter each time until the value of the second counter is reduced to 0 and the updating of the third counter is stopped, analyzing the value of each third counter, and taking out the corresponding pointer from the corresponding pointer area of the first pointer list according to the analysis result and putting the corresponding pointer into the second pointer list.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 7, an embodiment of the present invention further provides a computer apparatus 501, including:
at least one processor 520; and
the memory 510, the memory 510 stores a computer program 511 executable on a processor, and the processor 520 performs any of the steps of the RAID stripe remapping method described above when executing the program.
According to another aspect of the present invention, as shown in fig. 8, based on the same inventive concept, an embodiment of the present invention further provides a computer readable storage medium 601, where the computer readable storage medium 601 stores a computer program 610, and the computer program 610 performs the steps of any of the RAID stripe remapping methods described above when executed by a processor.
Finally, it should be noted that, as will be appreciated by those skilled in the art, all or part of the procedures in implementing the methods of the embodiments described above may be implemented by a computer program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, and the program may include the procedures of the embodiments of the methods described above when executed.
Further, it should be appreciated that the computer-readable storage medium (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that as used herein, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The foregoing embodiment of the present invention has been disclosed with reference to the number of embodiments for the purpose of description only, and does not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, and the program may be stored in a computer readable storage medium, where the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will appreciate that: the above discussion of any embodiment is merely exemplary and is not intended to imply that the scope of the disclosure of embodiments of the invention, including the claims, is limited to such examples; combinations of features of the above embodiments or in different embodiments are also possible within the idea of an embodiment of the invention, and many other variations of the different aspects of the embodiments of the invention as described above exist, which are not provided in detail for the sake of brevity. Therefore, any omission, modification, equivalent replacement, improvement, etc. of the embodiments should be included in the protection scope of the embodiments of the present invention.

Claims (10)

1. A method for remapping RAID stripes, comprising the steps of:
obtaining a stripe to be remapped and a corresponding first pointer list and determining the type of the stripe, wherein the stripe to be remapped comprises a plurality of sub-stripes, and the first pointer list comprises a plurality of pointer areas;
initializing a first counter and a second counter according to the type of the strip, wherein the first counter is used for recording the serial number of the sub-strip which is currently remapped, and the second counter is used for recording the number of discs to be processed;
remapping pointers in the first list of pointers into a second list of pointers in the order of the sub-stripes, wherein the remapping of the first list of pointers based on each of the sub-stripes performs the steps of:
determining an initial value of a third counter according to the value of the first counter and updating the third counter by taking the number of the sub-stripes as a stepping value, wherein the third counter records the current position of the first pointer list;
and subtracting 1 from the value of the second counter after updating the third counter each time until the value of the second counter is reduced to 0 and the updating of the third counter is stopped, analyzing the value of each third counter, and taking out the corresponding pointer from the corresponding pointer area of the first pointer list according to the analysis result and putting the corresponding pointer into the second pointer list.
2. The method as recited in claim 1, further comprising:
when the stripes are not full stripes, determining that the remapping sequence is an original data pointer, a pointer of original check data corresponding to the original data, a new data pointer and a pointer of new check data corresponding to the new data based on the remapping of each sub-stripe;
and when the stripes are in pseudo-full stripes, and the first pointer list is remapped based on each sub-stripe, determining that the remapping sequence is an original data pointer, a new data pointer, a pointer of new check data corresponding to the new data and a checksum pointer.
3. The method of claim 2, wherein determining an initial value of a third counter from the value of the first counter further comprises:
in response to the stripe being a non-full stripe and when either an original data pointer or a new data pointer is currently remapped, an initial value of the third counter is a value of the first counter minus an offset unit offset of the stripe;
in response to the stripe being a non-full stripe and when remapping is currently performed on a pointer of original check data or a pointer of new check data, subtracting the stripe unit offset from the value of the first counter, if the difference is less than 0, adding the stripe unit size to the difference as an initial value of the third counter, and if the difference is greater than 0, directly taking the difference as the initial value of the third counter;
responding to the fact that the stripe is a pseudo-full stripe and when the original data pointer, the new data pointer or the pointer corresponding to the checksum is remapped currently, the initial value of the third counter is the value of the first counter;
in response to the stripe being a pseudo-full stripe and the pointer to new parity data being currently remapped, an initial value of the third counter is a value of the first counter plus a parity offset.
4. The method of claim 3, wherein resolving the value of each of the third counters and retrieving a corresponding pointer from a corresponding pointer region of the first pointer list and placing the corresponding pointer into the second pointer list according to a resolving result, further comprising:
acquiring the current value of the third counter;
judging whether the value of the third counter is smaller than 0 or not when the stripe is not full and the original data pointer or the new data pointer is remapped currently;
filling an invalid pointer into the second pointer list in response to being smaller than 0;
and in response to being greater than 0, placing a pointer shifted from a start position of an original data pointer region or a new data pointer region of the first pointer list by a value of the third counter into the second pointer list.
5. The method of claim 3, wherein resolving the value of each of the third counters and retrieving a corresponding pointer from a corresponding region of the first pointer list and placing the corresponding pointer into the second pointer list according to a resolving result, further comprising:
acquiring the current value of the third counter;
and when the stripe is not full and the pointer of the original check data or the pointer of the new check data is currently remapped, placing the pointer which is shifted from the initial position of the original check data pointer area or the new check data pointer area of the first pointer list by the value of the third counter into the second pointer list.
6. The method of claim 3, wherein resolving the value of each of the third counters and retrieving a corresponding pointer from a corresponding region of the first pointer list and placing the corresponding pointer into the second pointer list according to a resolving result, further comprising:
acquiring the current value of the third counter, putting the original data, the new data pointer area and the check pointer area in the first pointer list into a first buffer, putting the check sum pointer area into a second buffer, and acquiring the initial position and the end position of the new data pointer recorded in the first pointer list;
if the value of the third counter falls between the starting position and the ending position when the stripe is a pseudo full stripe and the original data pointer is currently remapped, filling an invalid pointer into the second pointer list; if the value of the third counter does not fall between the starting position and the ending position, placing a pointer which is shifted from the starting position of the original data pointer area and the new data pointer area in the first cache by the value of the third counter into the second pointer list;
when the stripe is a pseudo full stripe and the new data pointer is currently remapped, if the value of a third counter falls between the starting position and the ending position, placing the pointer which is shifted from the starting position of the original data and the new data pointer area in the first cache by the value of the third counter into the second pointer list; and if the value of the third counter does not fall between the starting position and the ending position, filling an invalid pointer into the second pointer list.
7. The method of claim 3, wherein resolving the value of each of the third counters and retrieving a corresponding pointer from a corresponding region of the first pointer list and placing the corresponding pointer into the second pointer list according to a resolving result, further comprising:
acquiring the current value of the third counter, and placing the original data and new data pointer areas and the check pointer areas in the first pointer list into a first cache, and placing the check sum pointer areas into a second cache;
when the stripe is a pseudo full stripe and the pointer of the new check data is remapped currently, placing the pointer which is shifted from the initial position of the pointer area of the original data and the new data in the first cache by the value of the third counter into the second pointer list;
and in response to the stripe being a pseudo-full stripe and when the checksum pointer is currently remapped, placing a pointer in the second pointer list after shifting the value of the third counter from the starting position of the checksum pointer region in the second cache.
8. A RAID stripe remapping system, comprising:
an acquisition module configured to acquire a stripe to be remapped and a corresponding first pointer list and determine a type of the stripe, wherein the stripe to be remapped comprises a plurality of sub-stripes, and the first pointer list comprises a plurality of pointer areas;
the initialization module is configured to initialize a first counter and a second counter according to the type of the strip, wherein the first counter is used for recording the serial number of the sub-strip which is currently remapped, and the second counter is used for recording the number of discs to be processed;
a remapping module configured to remap pointers in the first list of pointers into a second list of pointers in the order of the sub-stripes, wherein the remapping of the first list of pointers on a per sub-stripe basis performs the steps of:
determining an initial value of a third counter according to the value of the first counter and updating the third counter by taking the number of the sub-stripes as a stepping value, wherein the third counter records the current position of the first pointer list;
and subtracting 1 from the value of the second counter after updating the third counter each time until the value of the second counter is reduced to 0 and the updating of the third counter is stopped, analyzing the value of each third counter, and taking out the corresponding pointer from the corresponding pointer area of the first pointer list according to the analysis result and putting the corresponding pointer into the second pointer list.
9. A computer device, comprising:
at least one processor; and
a memory storing a computer program executable on the processor, wherein the processor performs the steps of the method of any one of claims 1-7 when the program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor performs the steps of the method according to any one of claims 1-7.
CN202310352763.1A 2023-03-30 2023-03-30 RAID stripe remapping method, system, equipment and storage medium Pending CN116466881A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310352763.1A CN116466881A (en) 2023-03-30 2023-03-30 RAID stripe remapping method, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310352763.1A CN116466881A (en) 2023-03-30 2023-03-30 RAID stripe remapping method, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116466881A true CN116466881A (en) 2023-07-21

Family

ID=87174498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310352763.1A Pending CN116466881A (en) 2023-03-30 2023-03-30 RAID stripe remapping method, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116466881A (en)

Similar Documents

Publication Publication Date Title
US7051152B1 (en) Method and system of improving disk access time by compression
US6219752B1 (en) Disk storage data updating method and disk storage controller
US5764880A (en) Method and system for rebuilding log-structured arrays
US5864655A (en) Managing removable media in raid and rail environments
US6745284B1 (en) Data storage subsystem including a storage disk array employing dynamic data striping
US6904498B2 (en) Raid controller disk write mask
US6785836B2 (en) In-place data transformation for fault-tolerant disk storage systems
US5860090A (en) Append-only storage in a disk array using striping and parity caching
US7281089B2 (en) System and method for reorganizing data in a raid storage system
US7533330B2 (en) Redundancy for storage data structures
GB2404830A (en) Data with multiple sets of error correction codes
JPH0736143B2 (en) Record update method, single-pass access guarantee method, and system
EP1241577A2 (en) Methods and arrangements for improved parity-stripe processing
US5644791A (en) System for storing pointers to initial sectors of variable length n units and storing second pointers within the initial sector of the n unit
KR100854954B1 (en) Method and devices for storing and reading data on a storage medium and storage medium
JP3407628B2 (en) Computer system
CN101526885A (en) Method for improving capability of redundant array of independent disk and controller therefor
CN105808378B (en) Metadata restorative procedure and device
US6279134B1 (en) Storage device and storage subsystem for efficiently writing error correcting code
US20040088640A1 (en) Data encoding method and system
US20050132134A1 (en) [raid storage device]
CN116382582A (en) RAID remapping method, system, equipment and storage medium
CN116466881A (en) RAID stripe remapping method, system, equipment and storage medium
US10338850B2 (en) Split-page queue buffer management for solid state storage drives
US6021517A (en) Storage device and storage subsystem for efficiently writing error correcting code

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination