A method for responding to raid requests, a data storage system and apparatus

CN122086333BActive Publication Date: 2026-08-07SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
Filing Date
2026-04-23
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0004]本申请提供了一种RAID请求响应方法、数据存储系统及装置,以至少解决相关技术中降低了RAID任务响应速率的问题

Benefits of technology

[0010] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described RAID request-response methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122086333B_ABST
    Figure CN122086333B_ABST
Patent Text Reader

Abstract

The application discloses a RAID request response method, a data storage system and an apparatus, and relates to the technical field of computers. According to the application, the RAID logical space is divided into a foreground region and a background region according to the background task progress, the target response strategy of a to-be-responded RAID request is determined according to the intersection of the target region of the to-be-responded RAID request and the foreground region and the background region, that is, when the to-be-responded RAID request does not conflict with the background task, the target response strategy of the foreground region is used to respond to the to-be-responded RAID request, the setting of a strip lock is omitted, the request response efficiency is improved, when the to-be-responded RAID request conflicts with the background task, it is further judged whether the background task meets preset request splitting conditions, if yes, the background task is split, so that the part of the request which does not conflict with the background task is responded preferentially, and the request response efficiency is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a RAID request-response method, data storage system and apparatus. Background Technology

[0002] Currently, to improve the reliability and performance of Redundant Arrays of Independent Disks (RAID), background tasks are often performed on the RAID, such as initialization, consistency checks, reconstruction, copying back, tier migration, and expansion. Since both background tasks and foreground tasks from users or programs require read and write operations on the RAID, simultaneous access to the same portion of data on the RAID can lead to conflicts.

[0003] In related technologies, stripe locks are typically designed for RAID. When a background or foreground task needs to access data on any stripe of data in the RAID array, that stripe is locked to prevent the foreground or background task from accessing it. However, stripe locks require additional system resources to manage and maintain, and the acquisition, release, and checking of stripe locks are necessary when responding to any foreground or background task, which reduces task response efficiency. Summary of the Invention

[0004] This application provides a RAID request and response method, a data storage system, and an apparatus to at least address the problem of reduced RAID task response rate in related technologies.

[0005] This application provides a RAID request and response method, including: Get pending RAID requests; Based on the target access address of the RAID request to be responded to, locate the target access area of ​​the RAID in the RAID; If the target access area belongs to the foreground area, respond to the pending RAID request according to the target response policy of the foreground area; If there is an overlap between the target access area and the background area, the RAID request to be responded to will be treated as a RAID request to be suspended, and it will be determined whether the background task currently being executed in the background area meets the preset request splitting conditions. If the background task meets the preset request splitting conditions, the pending RAID request will be split into a first request and a second request; wherein, the first request belongs to the foreground area and the second request belongs to the background area. Respond to the first request according to the target response strategy of the front-end area; Suspend the second request until the backend region to which the second request currently belongs becomes the foreground region.

[0006] This application also provides a data storage system, including: a RAID controller and a RAID; RAID consists of multiple disks, which are used for storing data and / or parity codes. The RAID controller responds to RAID requests using any of the RAID request response methods described above.

[0007] This application also provides a RAID request and response apparatus, including: The acquisition module is used to acquire RAID requests that are yet to be responded to. The positioning module is used to locate the target access area of ​​the RAID request in the RAID based on the target access address of the RAID request to be responded to; The first response module is used to respond to the pending RAID request according to the target response policy of the front-end area when the target access area belongs to the front-end area. The judgment module is used to determine whether the background task currently being executed in the background area meets the preset request splitting conditions when there is an intersection between the target access area and the background area, and to treat the RAID request to be responded to as the RAID request to be suspended. The splitting module is used to split a pending RAID request into a first request and a second request when the background task meets the preset request splitting conditions; wherein the first request belongs to the foreground area and the second request belongs to the background area. The second response module is used to respond to the first request according to the target response strategy of the front-end area; The suspend module is used to suspend the second request until the background area to which the second request currently belongs becomes the foreground area.

[0008] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described RAID request-response methods.

[0009] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described RAID request-response methods.

[0010] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described RAID request-response methods.

[0011] By dividing the RAID logical space into a foreground area and a background area according to the progress of background tasks, this application determines the target response strategy for the RAID request to be responded to based on the intersection of the target area of ​​the RAID request to be responded to with the foreground and background areas. That is, when the RAID request to be responded to does not conflict with the background task, the target response strategy of the foreground area is used to respond to the RAID request to be responded to, eliminating the need for striping lock settings and improving request response efficiency. When the RAID request to be responded to conflicts with the background task, it is further determined whether the background task meets the preset request splitting conditions. If it does, it is split to prioritize responding to the part of the request that does not conflict with the background task, further improving request response efficiency. Attached Figure Description

[0012] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating the RAID request-response method provided in an embodiment of this application; Figure 2 A schematic diagram of the original response flow for an exemplary RAID request to be responded to, provided for embodiments of this application; Figure 3 This is a schematic diagram of a RAID structure provided in an embodiment of this application; Figure 4 A schematic diagram of the structure of an exemplary preset waiting list provided for embodiments of this application; Figure 5 This is a schematic diagram of the data structure of RAID information provided in an embodiment of this application; Figure 6 A schematic diagram illustrating an exemplary response flow for a RAID request to be responded to, provided as an embodiment of this application; Figure 7 This is a schematic diagram of the data storage system provided in an embodiment of this application; Figure 8 This is a schematic diagram of the RAID request response device provided in the embodiments of this application; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0015] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0016] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0017] This application provides a RAID request-response method for responding to pending RAID requests initiated by a service provider while RAID processing background tasks are in progress. The execution subject of this application embodiment is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, or other electronic devices that can be used to respond to pending RAID requests initiated by a service provider while RAID processing background tasks are in progress.

[0018] like Figure 1 The diagram shown is a flowchart illustrating a RAID request-response method provided in an embodiment of this application. The method includes: Step 101: Obtain the RAID request to be responded to.

[0019] Among them, the RAID request to be responded to is the input / output (I / O) request received by the RAID controller from the service side such as the host. This request is actually initiated by the user or application and is used to read or write the stored data in the RAID.

[0020] Step 102: Locate the target access area of ​​the RAID request in the RAID according to the target access address of the RAID request to be responded to.

[0021] The target access address refers to the location of the data to be accessed by the IO request in the RAID logical space, which can be determined based on the starting logical block address (slba) and the number of logical blocks (nlb) included in the request. The target access region represents the specific area of ​​the RAID logical space in which the target access address is located, and this region consists of at least one stripe.

[0022] Step 103: If the target access area belongs to the foreground area, respond to the pending RAID request according to the target response policy of the foreground area.

[0023] It should be noted that background tasks are executed in stripes, in the order of the stripes. The foreground area indicates at least one strip where no background task is currently being executed, meaning that foreground tasks and background tasks are not conflicting when executed in the foreground area.

[0024] Specifically, the target response strategy can be determined based on the current RAID information of the current foreground area, and then the RAID request to be responded to can be responded to according to the target response strategy. The target response strategy includes at least an address translation strategy and a data processing strategy.

[0025] For example, if the background task is a RAID level migration, migrating RAID5 to RAID6, if the current foreground area is RAID5, then the pending RAID request is responded to according to the address translation strategy and data processing strategy represented by the RAID information of RAID5; if the current foreground area is RAID6, then the pending RAID request is responded to according to the address translation strategy and data processing strategy represented by the RAID information of RAID6.

[0026] Step 104: If there is an intersection between the target access area and the background area, treat the RAID request to be responded to as the RAID request to be suspended, and determine whether the background task currently being executed in the background area meets the preset request splitting conditions.

[0027] Specifically, if the target access area and the background area overlap, it indicates that the RAID request to be responded to requests access to the stripe (background area) that is currently performing a background task. Therefore, the RAID request to be responded to cannot be responded to directly at present, and it needs to be treated as a pending RAID request.

[0028] Furthermore, based on the task type of the background task, it is determined whether the execution of the background task affects the change in the stripes contained in the target access area. For example, if the background task is to expand the RAID from 3 disks to 4 disks, according to the RAID information before the expansion, the target access area involves 2 stripes, and after the expansion, the target access area will only involve 1 stripe. In this case, request splitting will lead to an error in the final response result of the request. Therefore, if it is determined that the background task is to expand or otherwise affect the change in the stripes of the target access area, it is determined that the background task currently being executed in the background area does not meet the preset request splitting condition; otherwise, it does.

[0029] Step 105: If the background task meets the preset request splitting conditions, split the pending RAID request into the first request and the second request.

[0030] The first request belongs to the front-end area, and the second request belongs to the back-end area. The method of request splitting is not limited in this embodiment.

[0031] Step 106: Respond to the first request according to the target response strategy of the front-end area.

[0032] The response method for the first request is the same as that for the aforementioned RAID request to be responded to.

[0033] Step 107: Suspend the second request until the backend region to which the second request currently belongs becomes the foreground region.

[0034] Specifically, the second request can be suspended in a pre-defined waiting list to pause processing. As the background task executes, the previous background task in progress area (background area) transforms into the completion area (foreground area) after the background task is completed. At this point, the previously suspended second request can be popped from the pre-defined waiting list to respond to the second request.

[0035] Accordingly, in one embodiment, if the background task does not meet the preset request splitting conditions, the RAID request to be suspended can be suspended until the target access area of ​​the RAID request to be suspended belongs to the foreground area.

[0036] Specifically, the suspension method for pending RAID requests is the same as that for the second request. Both are suspended in the order of requests and added to a preset waiting list, waiting for the target access area of ​​the subsequent pending RAID requests to be in the foreground area before responding.

[0037] Based on the above embodiments, as one implementable approach, in one embodiment, locating the target access region of the RAID request to be responded to in the RAID according to the target access address of the RAID request to be responded to includes: Step 1021: Determine the stripe to be accessed for the RAID request based on the target access address of the RAID request to be responded to; Step 1022: Based on the stripe to be accessed in the RAID request to be responded to, locate the target access area in the RAID.

[0038] The target access area includes the strip to be accessed.

[0039] Specifically, the RAID request to be responded to issued by the service is based on the contiguous address (LBA) of the entire RAID logical volume, but the data inside the RAID is stored on multiple member disks in units of stripes. Therefore, the first step in processing any RAID request to be responded to is to translate it into operations on specific stripes and disks, that is, to determine the stripe to be accessed in the RAID request to be responded to, and then to determine the target access area based on the region to which the stripe to be accessed belongs.

[0040] Based on the above embodiments, as an implementable approach, in one embodiment, when the target access area belongs to the foreground area, responding to the pending RAID request according to the target response policy of the foreground area includes: Step 1031: If the target access area belongs to the foreground area, determine whether the foreground area is a background task waiting area or a background task completion area. Step 1032: If the foreground area is a background task waiting area, respond to the pending RAID request according to the original response strategy. Step 1033: If the foreground area is the background task completion area, respond to the pending RAID request according to the new response strategy after the RAID background task is completed.

[0041] The target response strategy includes the original response strategy and the new response strategy.

[0042] It should be noted that the background task waiting area includes at least one stripe that has not yet executed a background task, and the background task completion area includes at least one stripe that has completed a background task. The original response policy can be determined based on the original RAID information before the background task was executed, and the new response policy can be determined based on the new RAID information after the background task was executed.

[0043] Specifically, two sets of RAID information can be maintained for a RAID array performing a background task. From the perspective of the foreground I / O processing flow, it is necessary to determine the physical location of the data within the RAID array and calculate redundant data (checksums), i.e., perform address translation operations on the foreground I / O. Since the address translation algorithms differ for different RAID structures, and the RAID structures corresponding to the unstarted (waiting) and completed areas of the background task are not entirely identical. Specifically, the unstarted area corresponds to the old RAID structure before the background task begins, while the completed area corresponds to the new RAID structure after the background task ends.

[0044] For example, during the migration from RAID 5 to RAID 6, the RAID structure corresponding to the unstarted area remains RAID 5, while the RAID structure corresponding to the completed area becomes RAID 6. Similarly, when a RAID 5 array composed of disks 1, 2, 3, and 4 is reconstructed into a RAID 5 array composed of disks 1, 2, 3, and 5, the unstarted area corresponds to the original RAID 5 structure of disks 1, 2, 3, and 4, while the completed area corresponds to the new RAID 5 structure of disks 1, 2, 3, and 5. However, for background tasks such as initialization or consistency checks, there are no RAID changes in the unstarted and completed areas due to additional storage redundancy, nor are there any changes in the number of disks or the disks themselves. Therefore, the corresponding RAID structures remain consistent, and the two sets of RAID information are also consistent. If there are no background tasks, there are also no influencing factors such as changes in additional storage redundancy or disk changes; in this case, the two sets of RAID information also remain consistent.

[0045] For example, such as Figure 2The diagram illustrates an exemplary initial response flow for a pending RAID request provided in this embodiment of the application. For example, when an application on the host needs to access data stored on the RAID, it first issues a foreground I / O request (the pending RAID request). The operating system then translates the foreground I / O request into standard storage protocol I / O instructions that the storage device can understand. These I / O instructions contain key information such as the logical block start address (slba) and logical block size (nlb) of the data to be read or written, used to locate the physical location of the data within the RAID. Upon receiving the host I / O instruction, the RAID controller performs address translation on the host I / O based on the information such as the start logical block address (slba) and logical block size (nlb) in the instruction, thus determining the physical location (target access area) of the data to be operated on within the RAID array. This process involves RAID algorithms, as RAID arrays provide performance and data redundancy by distributing data across multiple disks. For example, in RAID5 mode, data is striped across multiple disks, and parity information is also stored to achieve data redundancy. The controller needs to calculate the actual physical disk addresses and data distribution based on these algorithms. Finally, depending on the request type, write and read operations are performed. During write operations, redundant data is calculated based on RAID information. Data synchronization and result return to the host are then completed. In read operations, after receiving data from the disk, the RAID controller returns the data to the host via the host interface, completing the entire read I / O process. In write operations, once data is successfully written to the disk (or written to the cache and the cache policy allows for a successful write signal), the RAID controller sends a successful write signal to the host.

[0046] Based on the above embodiments, as an implementable approach, in one embodiment, the method further includes: Step 201: Obtain the location information of the first marker and the second marker of the RAID; wherein, the first marker is located between the background task waiting area and the background area, and the second marker is located between the background area and the background task completion area. Step 202: Determine whether the target access area belongs to the foreground area based on the range of the target access area, the location information of the first marker, and the location information of the second marker.

[0047] For example, such as Figure 3The diagram shown is a schematic of the RAID structure provided in this application embodiment. To enable the RAID to handle foreground I / O normally while performing background tasks, two markers are introduced: HLM (High Mark) and LLM (Low Mark). The High Mark is also called the first marker, and the Low Mark is also called the second marker. HLM and LLM divide the RAID's logical storage space into three regions: the completion region, which is below the LLM region, where the RAID data has completed background task operations and the data organization structure is the RAID data organization structure after the background task; the progress region, located between LLM and HLM, which consists of several consecutive stripes currently performing background tasks; and the waiting region, which is above the HLM region, where the RAID data organization structure is the RAID data organization structure before the background task.

[0048] Specifically, in one embodiment, if the target access area belongs to the foreground area, it can be determined whether the range of the target access area is higher than the first mark; if the range of the target access area is higher than the first mark, the foreground area to which the target access area belongs is determined to be the background task waiting area.

[0049] Similarly, in one embodiment, if the target access area is a foreground area, it is determined whether the range of the target access area is lower than the second marker; if the range of the target access area is lower than the second marker, the foreground area to which the target access area belongs is determined to be the background task completion area.

[0050] Specifically, to facilitate differentiation, this application's embodiments introduce a VID (Validation ID, where 0 represents the waiting area, 1 represents the completed area, and 2 represents the in-process area) field in the foreground I / O processing flow. The RAID controller compares the foreground I / O's slba (starting logical block address) and nlb (number of blocks) with HLM (high mark) and LLM (low mark). For foreground I / O whose target access area is entirely located in the waiting area, its VID is assigned a value of 0. When performing address translation on the foreground I / O, the RAID information corresponding to the waiting area is used to complete the address translation before performing read / write operations. For foreground I / O that is entirely located in the completed area, its VID is assigned a value of 1. In this case, the RAID information corresponding to the completed area is used for address translation, and then read / write operations are performed.

[0051] Correspondingly, for other foreground I / Os in the progress area, their VID is assigned 2. The address conversion and read / write disk operations can be temporarily not performed on them. Instead, these foreground I / Os are suspended to the suspension list. When the background task moves the high and low flags to coincide, at this time, only the completed area and the unstarted area exist in the RAID, and there is no longer a progress area. Then, the foreground I / Os are popped out from the suspension list, and the foreground I / Os can continue to perform address conversion and read / write disk operations according to the RAID information corresponding to the unstarted area or the completed area, thereby achieving the purpose of solving the conflict between the foreground I / O and the background I / O.

[0052] Specifically, in one embodiment, when the background task meets the preset request splitting condition, the pending RAID request is split into a first request and a second request according to the position information of the first marker or the position information of the second marker.

[0053] Exemplarily, when the address range [slba, slba + nlb] of an I / O request intersects with the progress area [LLM, HLM], its relative position relationship includes the following multiple situations: 1. Crossing the completed area and the progress area. That is, slba < LLM and slba + nlb > LLM. At this time, LLM is the boundary between the completed part and the in-progress part of this request. When splitting, with LLM as the boundary, the address range of the first request after request splitting is [slba, LLM), belonging to the completed area, and the address range of the second request is [LLM, slba + nlb), belonging to the progress area.

[0054] 2. Crossing the progress area and the waiting area. That is, slba < HLM and slba + nlb > HLM. At this time, HLM is the boundary. The address range of the first request after request splitting is [HLM, slba + nlb), belonging to the waiting area, and the address range of the second request is [slba, HLM), belonging to the progress area.

[0055] 3. Entirely located within the progress area. At this time, it cannot be split, and only the request can be suspended as a whole.

[0056] Specifically, through the splitting of the request, the part (the first request) that can be immediately processed is separated from the I / O request that originally needed to wait for the background task to complete before being processed. This enables the request initiator to receive partial data or complete partial write operations faster, improving the request response efficiency.

[0057] Further, in one embodiment, when the background area completes the background task, the first marker and the second marker are moved according to the range of the background area to update the position information of the first marker and the position information of the second marker.

[0058] Before the RAID executes background tasks, the first and second markers coincide in the lowest stripe of the RAID. After all stripes of the RAID have completed the execution of background tasks, the first and second markers coincide in the highest stripe of the RAID.

[0059] When the background task begins (before the RAID executes its background task), the entire RAID area is a waiting area. At this time, the high and low markers are the same, i.e., HLM = LLM, and it is located at the beginning of the RAID (the lowest stripe of the RAID). The operation on the first process area involves the following steps: a) Shift the HLM by one process area size; b) Move the data in the process area to the RAID controller cache; c) Calculate the parity data (checksum) of the data in the cache according to the RAID data organization structure after the background task; d) Write the data to disk according to the new RAID data organization structure; e) Shift the LLM by one process area size. After the operation on the first process area is completed, the other areas in the RAID are operated on sequentially, with the operation steps the same as the first process area. When all areas in the RAID have completed the background task operations, the entire RAID is now a completed area, with the high and low markers the same, and it is located at the end of the RAID (the highest stripe of the RAID).

[0060] For example, such as Figure 4 As shown, this is a schematic diagram of the structure of an exemplary preset waiting list provided in an embodiment of this application. When moving the first marker and the second marker, the second marker is moved first, and then the first marker is moved. When the high and low markers of the background task coincide (the first marker and the second marker coincide), the I / O in the suspended preset waiting list is popped from the list, and the VID is recalculated and the corresponding request response strategy is selected to perform related read and write operations.

[0061] Specifically, in one embodiment, when the foreground area is a background task waiting area, it can be determined whether the RAID request to be responded to is a RAID read request; if the RAID request to be responded to is a RAID read request, the disk to be read is determined according to the original response strategy and the read demand represented by the RAID request to be responded to; a corresponding disk read request is sent to the disk to be read so that the disk to be read responds to the disk read request and returns the target read data.

[0062] Specifically, the RAID controller can determine whether the RAID request to be responded to is a RAID read request based on the operation type of the RAID request to be responded to. If it is a RAID read request, the RAID controller sends a read request to the corresponding disk based on the determined physical disk address (the disk to be read). After receiving the read request, the disk to be read sends the data back to the RAID controller through its internal data channel, that is, returns the target read data.

[0063] The read requirement includes at least slba (starting logical block address) and nlb (number of logical blocks) to determine the logical range of data to be read, and thus determine the corresponding disk to be read.

[0064] Similarly, in one embodiment, if the foreground area is a background task waiting area, it can be determined whether the RAID request to be responded to is a RAID write request; if the RAID request to be responded to is a RAID write request, the data disk to be written, the parity disk, and the target checksum are determined according to the original response strategy and the write requirement represented by the RAID request to be responded to; a corresponding disk data write request is sent to the data disk to be written to write the data to be written to the data disk to be written; a corresponding checksum write request is sent to the parity disk to write the target checksum to the parity disk.

[0065] The write requirement includes at least slba (starting logical block address), nlb (number of logical blocks), and the data to be written. slba and nlb are used to determine the logical range of the data to be written, and thus determine the corresponding disk to be written. The check disk and checksum can be further determined in combination with the current RAID information.

[0066] Specifically, for write operations, the RAID controller first moves the data to an internal cache to calculate redundant data or writes the data sent directly from the host to the corresponding disk location. In RAID1 (mirroring) mode, data needs to be written to two disks simultaneously; in RAID5 mode, in addition to writing to the data disk, the disk containing the redundant data (checksum) also needs to be updated (parity disk).

[0067] Specifically, the updated check value of the stripe can be recalculated based on the check algorithm defined in the original response strategy, combined with the data to be written and (for partial write operations) the old data read from other data disks in the same stripe, thus determining the target check code.

[0068] In the foreground area, which is the background task completion area, the read and write operations are implemented in the same way as in the above embodiment when responding to pending RAID requests according to the new response strategy, and will not be described again.

[0069] Specifically, in one embodiment, before sending a corresponding disk read request to the disk to be read so that the disk to be read returns the target read data in response to the disk read request, the latest RAID information can be obtained; based on the latest RAID information, the latest process check code is determined; it is determined whether the latest process check code is consistent with the original process check code before responding to the RAID request; if the latest process check code and the original process check code are consistent, the step of sending a corresponding disk read request to the disk to be read so that the disk to be read returns the target read data in response to the disk read request is executed.

[0070] The latest RAID information includes at least the RAID number, RAID type, number of disks, disk list, number of data disks, number of parity disks, number of bad disks, bad disk list, and latest process check code. The original process check code is determined by reading the RAID information at the beginning of the current read or write request processing flow.

[0071] Accordingly, in one embodiment, if the latest process check code and the original process check code are inconsistent, it is re-determined whether the foreground area is a background task waiting area or a background task completion area; if the background area is changed to a background task completion area, the disk to be read is re-determined according to the new response strategy and the read demand represented by the pending RAID request.

[0072] Specifically, to ensure the consistency of RAID information during foreground I / O, this application introduces the concept of FCC (FlowCheck Code). When a background task starts, ends, or the disk changes during a background task, the FCC of the RAID information is incremented by 1. Before processing foreground I / O, the flow check code FCC_A (original flow check code) corresponding to the RAID information is read. After the foreground I / O address translation is completed (after determining whether the disk to be read or written is being determined), the flow check code FCC_B (latest flow check code) corresponding to the RAID information is read again. If FCC_A and FCC_B are not equal, it indicates that the RAID information has changed during foreground I / O processing. In this case, the RAID information is unreliable, and the foreground I / O needs to be re-executed. That is, the foreground area must be re-determined to determine whether it is a background task waiting area or a background task completion area, and then the disk to be read or written must be re-determined. If FCC_A and FCC_B are equal, it indicates that the RAID information has not changed during foreground I / O processing, the foreground I / O address translation is accurate, and normal disk read / write operations can then be performed.

[0073] Specifically, a process check code can also be generated by encoding data or information using mathematical functions. A process check code is a unique identifier that reflects the initial state of the data. When the data changes, the recalculated check code differs from the initial check code, thus detecting the data change. FCC process check codes are used to ensure the integrity and consistency of data during transmission, storage, or processing. There are various ways to implement process check codes, including based on hash functions, checksums, and incrementing counters. This embodiment uses an incrementing counter to implement the process check code. Whenever the data changes, the value of the incrementing counter increases by a fixed value. Finally, by comparing the initial value and the current value of the incrementing counter, it can be determined whether the data has changed.

[0074] Specifically, before performing address translation on the front-end I / O, the FCC value in the corresponding RAID_INFO is read and recorded as FCC_A. After completing the address translation operation for the front-end I / O, the FCC value in the corresponding RAID_INFO is read again and recorded as FCC_B. By comparing FCC_A and FCC_B, if they are not equal, it indicates that the RAID information has changed during the address translation process. In this case, the front-end I / O needs to be reprocessed to avoid address translation errors caused by incorrectly using the changed RAID information, thus ensuring the accuracy and reliability of data read and write operations.

[0075] In this embodiment, FCC verification is used to detect changes in RAID information during the request response process. If the verification fails, the address translation result already performed is discarded, triggering a re-response to the request. This fundamentally avoids reading erroneous data or performing erroneous write operations, thereby improving RAID data security.

[0076] Furthermore, in one embodiment, when the background area completes a background task, the RAID information is updated according to the execution status of the background task; and a new response strategy is determined based on the updated RAID information.

[0077] Specifically, if an anomaly occurs during task execution, such as a disk failure, the number of failed disks and the list of failed disks in the RAID information need to be updated to reflect the latest disk health status. For example, if disk 3 fails during task execution, the number of failed disks and the list of failed disks in the RAID information will be updated to 1 and 3, respectively. Furthermore, updating the RAID information will trigger the incrementing of the Flow Check Code (FCC). The updated RAID information includes key information from both the new RAID information and the original RAID information, thereby determining the new response strategy corresponding to the updated RAID information, so that subsequent I / O requests can be responded to based on the new strategy.

[0078] Furthermore, such as Figure 5The diagram shows the data structure of RAID information provided in this application embodiment. Since two sets of RAID information are maintained in the RAID, namely the original RAID information (RAID_INFO[0]) and the new RAID information (RAID_INFO[1]), RAID_INFO[0] and RAID_INFO[1] remain consistent before the background task starts, both being RAID information of the original RAID organization structure before the background task starts. For example, in the case of RAID5 composed of 3 disks (disk 0 / 1 / 2) with RAID number 0, the key information corresponding to RAID_INFO[0] and RAID_INFO[1] are 0, RAID5, 3, 0 / 1 / 2, 2, 1, 0, empty, 0 respectively. After the background task starts, RAID_INFO[1] is updated to the RAID information of the target RAID organization structure after the background task ends. Taking the migration of RAID5 with RAID numbers 0 and 3 (disks 0 / 1 / 2) to RAID6 with RAID numbers 0 and 4 (disks 0 / 1 / 2 / 3) as an example, the key information in RAID_INFO[1] is 0, RAID6, 4, 0 / 1 / 2 / 3, 2, 2, 0, empty, 1. In RAID_INFO[0], except for the process checksum which increments by 1, the other information remains unchanged, and the key information is 0, RAID5, 3, 0 / 1 / 2, 2, 1, 0, empty, 1.

[0079] If a disk failure (disk drop) occurs during the background task execution, the number of bad disks in the RAID information should be updated in time, and the corresponding disk should be recorded in the bad disk list. Taking the example of migrating from RAID5 to RAID6, if disk 3 fails during the task execution, the number of bad disks and the bad disk list in RAID_INFO[1] will be updated to 1 and 3, respectively. At this time, the key information of RAID_INFO[1] will be 0, RAID6, 4, 0 / 1 / 2 / 3, 2, 2, 1, 3, 2. In contrast, the information in RAID_INFO[0] remains unchanged except that the process check code increments by 1 to 2 again. The key information is 0, RAID5, 3, 0 / 1 / 2, 2, 1, 0, empty, 2.

[0080] After the background task is completed, RAID_INFO[0] is updated with the RAID information of the new RAID organization structure after the background task is completed. At this time, the key information in RAID_INFO[0] is 0, RAID6, 4, 0 / 1 / 2 / 3, 2, 2, 1, 3, 3, and RAID_INFO[1] is the same, with the key information also being 0, RAID6, 4, 0 / 1 / 2 / 3, 2, 2, 1, 3, 3.

[0081] By updating the RAID information, the RAID request-response logic is kept consistent with the disk status, ensuring the reliability of the request-response results.

[0082] For example, such as Figure 6 The diagram shown is an exemplary response flow diagram of a RAID request to be responded to provided in an embodiment of this application, and is similar to... Figure 2 Compared to the response flow shown, this embodiment not only adds a mechanism to handle foreground I / O by using two sets of RAID information and an I / O suspension and recovery mechanism, but also specifically introduces a Flow Check Code (FCC) to handle conflicts caused by changes in RAID information. For example, Figure 2 The process shown is as follows Figure 1 The illustrated process is an exemplary implementation, and the two implementations are based on the same principle, so they will not be described again.

[0083] The RAID request-response method provided in this application divides the RAID logical space into a foreground area and a background area according to the progress of background tasks. Based on the intersection of the target area of ​​the RAID request to be responded to with the foreground and background areas, a target response strategy for the RAID request to be responded to is determined. That is, when the RAID request to be responded to does not conflict with a background task, the target response strategy of the foreground area is used to respond to the RAID request, omitting the striping lock setting and improving request response efficiency. When the RAID request to be responded to conflicts with a background task, it is further determined whether the background task meets the preset request splitting conditions. If it does, it is split to prioritize responding to the part of the request that does not conflict with the background task, further improving request response efficiency. Furthermore, by maintaining two sets of RAID information, instead of the traditional method of maintaining only one set of RAID information, it can be compatible with various background tasks, effectively solving the complexity of RAID information during background tasks. In addition, the addition of a process check code can not only resolve RAID information access conflicts when foreground and background I / O are performed simultaneously, but also in scenarios such as when there are no background tasks or disk changes, providing a more flexible design without the need for additional complex logic.

[0084] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0085] Embodiments of this application also provide a data storage system for executing the RAID request-response method provided in the above embodiments.

[0086] like Figure 7 The diagram shown is a structural schematic of a data storage system provided in an embodiment of this application. The system includes a RAID controller and a RAID array.

[0087] The RAID consists of multiple disks, which are used for data storage and / or checksum storage; the RAID controller responds to RAID requests using the RAID request-response method provided in the above embodiments.

[0088] For a description of the features in the embodiment corresponding to the data storage system, please refer to the relevant description of the embodiment corresponding to the RAID request-response method, which will not be repeated here.

[0089] Embodiments of this application also provide a RAID request response apparatus for executing the RAID request response method provided in the above embodiments.

[0090] like Figure 8 The diagram shown is a structural schematic of a RAID request response device provided in an embodiment of this application. The RAID request response device 80 includes: an acquisition module 801, a positioning module 802, a first response module 803, a judgment module 804, a splitting module 805, a second response module 806, and a suspending module 807.

[0091] The system comprises the following modules: an acquisition module for acquiring RAID requests to be responded to; a location module for locating the target access area of ​​the RAID request within the RAID array based on the target access address of the RAID request; a first response module for responding to the RAID request according to the target response policy of the foreground area when the target access area belongs to the foreground area; a judgment module for determining whether the background task currently being executed in the background area meets the preset request splitting conditions when there is an intersection between the target access area and the background area, treating the RAID request to be responded to as a RAID request to be suspended; a splitting module for splitting the RAID request to be suspended into a first request and a second request when the background task meets the preset request splitting conditions, wherein the first request belongs to the foreground area and the second request belongs to the background area; a second response module for responding to the first request according to the target response policy of the foreground area; and a suspension module for suspending the second request until the background area to which the second request currently belongs becomes the foreground area.

[0092] Specifically, in one embodiment, the positioning module is specifically used for: Determine the stripe to be accessed based on the target access address of the RAID request to be responded to; Based on the stripe to be accessed in the RAID request to be responded to, locate the target access area in the RAID to be responded to; The target access area includes the strip to be accessed.

[0093] Specifically, in one embodiment, the first response module is specifically used for: If the target access area is a foreground area, determine whether the foreground area is a background task waiting area or a background task completion area. When the foreground area is a background task waiting area, respond to pending RAID requests according to the original response strategy. When the foreground area is the background task completion area, respond to pending RAID requests according to the new response strategy after the RAID background task is completed. The target response strategy includes the original response strategy and the new response strategy.

[0094] Specifically, in one embodiment, the system further includes: The area identification module is used to obtain the location information of the first marker and the second marker of the RAID; wherein, the first marker is located between the background task waiting area and the background area, and the second marker is located between the background area and the background task completion area; based on the range of the target access area, the location information of the first marker and the location information of the second marker, it is determined whether the target access area belongs to the foreground area.

[0095] Specifically, in one embodiment, the determination module is specifically used for: If the target access area is within the foreground area, determine whether the range of the target access area is higher than the first marker; If the target access area is higher than the first marker, the foreground area to which the target access area belongs is determined to be the background task waiting area.

[0096] Specifically, in one embodiment, the determination module is specifically used for: If the target access area is within the foreground area, determine whether the range of the target access area is below the second marker; If the target access area is less than the second marker, the foreground area to which the target access area belongs is determined as the background task completion area.

[0097] Specifically, in one embodiment, the region identification module is further configured to: When the background area completes the background task, the first and second markers are moved according to the range of the background area to update the position information of the first and second markers; Before the RAID executes background tasks, the first and second markers coincide in the lowest stripe of the RAID. After all stripes of the RAID have completed the execution of background tasks, the first and second markers coincide in the highest stripe of the RAID.

[0098] Specifically, in one embodiment, the first response module is specifically used for: When the foreground area is a background task waiting area, determine whether the RAID request to be responded to is a RAID read request. If the RAID request to be responded to is a RAID read request, the disk to be read is determined based on the original response strategy and the read requirement represented by the RAID request to be responded to; Send the corresponding disk read request to the disk to be read, so that the disk to be read responds to the disk read request and returns the target read data.

[0099] Specifically, in one embodiment, the first response module is specifically used for: When the foreground area is a background task waiting area, determine whether the RAID request to be responded to is a RAID write request. When the RAID request to be responded to is a RAID write request, the disk to be written, the parity disk, and the target checksum are determined based on the original response policy and the write requirements represented by the RAID request to be responded to. Send the corresponding disk data write request to the disk to be written, so as to write the data to be written to the disk to be written; Send the corresponding checksum write request to the checksum disk to write the target checksum to the checksum disk.

[0100] Specifically, in one embodiment, the split module is specifically used for: If the background task meets the preset request splitting conditions, the pending RAID request is split into a first request and a second request according to the location information of the first marker or the location information of the second marker.

[0101] Specifically, in one embodiment, the system further includes: The update module is used to update RAID information based on the execution status of background tasks when the background area completes the background tasks; and to determine a new response strategy based on the updated RAID information.

[0102] Specifically, in one embodiment, the second response module is further configured to: If the background task does not meet the preset request splitting conditions, the pending RAID request will be suspended until the target access area of ​​the pending RAID request belongs to the foreground area.

[0103] Specifically, in one embodiment, the first response module is further configured to: Before sending the corresponding disk read request to the disk to be read, so that the disk to be read can respond to the disk read request and return the target read data, obtain the latest RAID information; Determine the latest process checksum based on the latest RAID information; Determine whether the latest process check code is consistent with the original process check code before responding to the pending RAID request; If the latest process check code and the original process check code are consistent, execute the step of sending the corresponding disk read request to the disk to be read, so that the disk to be read responds to the disk read request and returns the target read data.

[0104] Specifically, in one embodiment, the first response module is further configured to: If the latest process verification code and the original process verification code are inconsistent, re-determine whether the relevant front-end area is a background task waiting area or a background task completion area. If the background area is changed to the background task completion area, the disk to be read will be re-determined based on the new response strategy and the read demand represented by the pending RAID request.

[0105] Specifically, in one embodiment, the latest RAID information includes at least the RAID number, RAID type, number of disks, disk list, number of data disks, number of parity disks, number of faulty disks, faulty disk list, and latest process check code.

[0106] For a description of the features in the embodiment corresponding to the RAID request and response device, please refer to the relevant description in the embodiment corresponding to the RAID request and response method, which will not be repeated here.

[0107] Embodiments of this application also provide an electronic device, such as... Figure 9 The diagram shown is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, including a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any of the above-described RAID request-response method embodiments.

[0108] Embodiments of this application also provide a computer-readable storage medium storing a computer program configured to execute the steps in any of the above-described RAID request-response method embodiments at runtime.

[0109] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0110] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the RAID request-response method embodiments described above.

[0111] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the RAID request-response method embodiments described above.

[0112] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0113] The RAID request-response method, data storage system, and apparatus provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A RAID request-response method, characterized in that, include: Get pending RAID requests; Based on the target access address of the RAID request to be responded to, locate the target access area of ​​the RAID request to be responded to in the RAID; If the target access area belongs to the foreground area, the pending RAID request shall be responded to according to the target response policy of the foreground area; If the target access area and the background area overlap, the RAID request to be responded to is treated as a RAID request to be suspended, and it is determined whether the background task currently being executed in the background area meets the preset request splitting conditions. If the background task meets the preset request splitting conditions, the RAID request to be suspended is split into a first request and a second request; wherein the first request belongs to the foreground area and the second request belongs to the background area. Respond to the first request according to the target response strategy of the front-end area; Suspend the second request until the backend region to which the second request currently belongs becomes the foreground region; When the target access area belongs to the foreground area, responding to the pending RAID request according to the target response policy of the foreground area includes: If the target access area belongs to the foreground area, determine whether the foreground area is a background task waiting area or a background task completion area. If the foreground area is a background task waiting area, the pending RAID request shall be responded to according to the original response policy. If the foreground area is a background task completion area, the pending RAID request is responded to according to the new response strategy after the RAID completes the background task; The target response strategy includes the original response strategy and the new response strategy; When the foreground area is a background task waiting area, responding to the pending RAID request according to the original response strategy includes: If the foreground area is a background task waiting area, determine whether the RAID request to be responded to is a RAID read request; If the RAID request to be responded to is a RAID read request, the disk to be read is determined according to the original response strategy and the read requirement represented by the RAID request to be responded to; Send a corresponding disk read request to the disk to be read, so that the disk to be read responds to the disk read request and returns the target read data; Before sending a corresponding disk read request to the disk to be read, so that the disk to be read returns the target read data in response to the disk read request, the method further includes: Get the latest RAID information; Based on the latest RAID information, determine the latest process checksum; Determine whether the latest process check code is consistent with the original process check code before responding to the pending RAID request; If the latest process check code and the original process check code are consistent, the step of sending the corresponding disk read request to the disk to be read, so that the disk to be read responds to the disk read request and returns the target read data.

2. The RAID request-response method according to claim 1, characterized in that, The step of locating the target access region of the RAID request in the RAID based on the target access address of the RAID request to be responded to includes: Based on the target access address of the RAID request to be responded to, determine the stripe to be accessed for the RAID request to be responded to; Based on the stripe to be accessed in the RAID request to be responded to, locate the target access area of ​​the RAID request to be responded to in the RAID; The target access area includes the strip to be accessed.

3. The RAID request-response method according to claim 1, characterized in that, The method further includes: Obtain the location information of the first marker and the second marker of the RAID; wherein, the first marker is located between the background task waiting area and the background area, and the second marker is located between the background area and the background task completion area; Based on the range of the target access area, the location information of the first marker, and the location information of the second marker, it is determined whether the target access area belongs to the foreground area.

4. The RAID request-response method according to claim 3, characterized in that, When the target access area belongs to the foreground area, determining whether the foreground area is a background task waiting area or a background task completion area includes: If the target access area is a foreground area, determine whether the range of the target access area is higher than the first marker; If the range of the target access area is higher than the first marker, the foreground area to which the target access area belongs is determined to be the background task waiting area.

5. The RAID request-response method according to claim 3, characterized in that, When the target access area belongs to the foreground area, determining whether the foreground area is a background task waiting area or a background task completion area includes: If the target access area is a foreground area, determine whether the range of the target access area is lower than the second marker; If the range of the target access area is lower than the second marker, the foreground area to which the target access area belongs is determined to be the background task completion area.

6. The RAID request-response method according to claim 3, characterized in that, The method further includes: When the background area completes the background task, the first marker and the second marker are moved according to the range of the background area to update the position information of the first marker and the position information of the second marker. Specifically, before the RAID executes the background task, the first marker and the second marker coincide in the lowest stripe of the RAID; after all stripes of the RAID have completed the execution of the background task, the first marker and the second marker coincide in the highest stripe of the RAID.

7. The RAID request-response method according to claim 1, characterized in that, When the foreground area is a background task waiting area, responding to the pending RAID request according to the original response strategy includes: If the foreground area is a background task waiting area, determine whether the RAID request to be responded to is a RAID write request; If the RAID request to be responded to is a RAID write request, the disk to be written, the parity disk, and the target checksum are determined according to the original response strategy and the write requirement represented by the RAID request to be responded to. Send a corresponding disk data write request to the disk to be written, so as to write the data to be written to the disk to be written; Send a corresponding verification code write request to the verification disk to write the target verification code to the verification disk.

8. The RAID request-response method according to claim 3, characterized in that, When the background task meets the preset request splitting conditions, the RAID request to be suspended is split into a first request and a second request, including: If the background task meets the preset request splitting conditions, the RAID request to be suspended is split into a first request and a second request according to the location information of the first marker or the location information of the second marker.

9. The RAID request-response method according to claim 1, characterized in that, The method further includes: When the background area completes the background task, the RAID information is updated according to the execution status of the background task; The new response strategy is determined based on the updated RAID information.

10. The RAID request-response method according to claim 1, characterized in that, The method further includes: If the background task does not meet the preset request splitting conditions, the pending RAID request will be suspended until the target access area of ​​the pending RAID request belongs to the foreground area.

11. The RAID request-response method according to claim 1, characterized in that, The method further includes: If the latest process verification code and the original process verification code are inconsistent, re-determine whether the foreground area to which it belongs is a background task waiting area or a background task completion area. If the background area is changed to the background task completion area, the disk to be read is re-determined according to the new response strategy and the read demand represented by the RAID request to be responded to.

12. The RAID request-response method according to claim 1, characterized in that, The latest RAID information includes at least the RAID number, RAID type, number of disks, disk list, number of data disks, number of parity disks, number of faulty disks, faulty disk list, and latest process checksum.

13. A data storage system, characterized in that, include: RAID controllers and RAID; The RAID consists of multiple disks, which are used for storing data and / or storing checksums. The RAID controller responds to RAID requests using the RAID request response method as described in any one of claims 1 to 12.

14. A RAID request-response device, characterized in that, include: The acquisition module is used to acquire RAID requests that are yet to be responded to. The positioning module is used to locate the target access area of ​​the RAID request in the RAID according to the target access address of the RAID request to be responded to; The first response module is used to respond to the RAID request to be responded to, according to the target response policy of the front-end area, when the target access area belongs to the front-end area. The judgment module is used to, when there is an intersection between the target access area and the background area, treat the RAID request to be responded to as a RAID request to be suspended, and determine whether the background task currently being executed in the background area meets the preset request splitting conditions. The splitting module is used to split the RAID request to be suspended into a first request and a second request when the background task meets the preset request splitting conditions; wherein the first request belongs to the foreground area and the second request belongs to the background area. The second response module is used to respond to the first request according to the target response strategy of the front-end area; The suspension module is used to suspend the second request until the background area to which the second request currently belongs becomes the foreground area; The judgment module is specifically used for: If the target access area belongs to the foreground area, determine whether the foreground area is a background task waiting area or a background task completion area. If the foreground area is a background task waiting area, the pending RAID request shall be responded to according to the original response policy. If the foreground area is a background task completion area, the pending RAID request is responded to according to the new response strategy after the RAID completes the background task; The target response strategy includes the original response strategy and the new response strategy; The first response module is specifically used for: If the foreground area is a background task waiting area, determine whether the RAID request to be responded to is a RAID read request; If the RAID request to be responded to is a RAID read request, the disk to be read is determined according to the original response strategy and the read requirement represented by the RAID request to be responded to; Send a corresponding disk read request to the disk to be read, so that the disk to be read responds to the disk read request and returns the target read data; The first response module is further configured to: Before sending a corresponding disk read request to the disk to be read, so that the disk to be read returns the target read data in response to the disk read request, the latest RAID information is obtained; Based on the latest RAID information, determine the latest process checksum; Determine whether the latest process check code is consistent with the original process check code before responding to the pending RAID request; If the latest process check code and the original process check code are consistent, the step of sending the corresponding disk read request to the disk to be read, so that the disk to be read responds to the disk read request and returns the target read data.

15. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the RAID request-response method as described in any one of claims 1 to 12 when executing the computer program.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the RAID request-response method as described in any one of claims 1 to 12.

17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the RAID request-response method as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Method and device for processing foreground task of disk array, equipment and medium

    CN120295549A

  • Command execution method and device, equipment and medium

    CN120653200A