RAID reconstruction methods, devices, electronic equipment, and storage media
Patent Information
- Application Number
- CN202511160737.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2045-08-18
AI Technical Summary
这种“缓存转发”机制存在显著问题:它不仅需要大量的内存资源来临时存放所有待传输的数据块,还因额外的数据缓存步骤和串行的命令执行方式(读操作完成后方能发起写操作)而增加了数据传输的路径和时间,最终导致整体重建效率低下
[0009]本申请实施例提出一种“边读边写”的RAID重建机制。具体而言,方案对RAID重建过程中源磁盘的读操作与目标磁盘的写操作进行解耦,摒弃传统“数据先缓存再转发”方案中读操作与写操作必须严格串行执行的限制,仅需确保读命令与写命令的发送时间差小于源磁盘完成全部重建数据读取所需的时间;基于此,通过源磁盘至目标磁盘的点对点数据通道,以非缓存直通模式将源磁盘实时读取的重建数据直接传输(跳过任何中间缓存环节)至目标磁盘进行写入,可实现读操作与写操作在时间上至少部分重叠执行,从而大幅提升重建效率,同时由于传输过程中不需要进行缓存,也避免了对缓存资源容量与性能的依赖,进而降低了RAID重建对硬件配置的要求。
Smart Images

Figure CN121166016B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technology, and in particular to a RAID reconstruction method, apparatus, electronic device and storage medium. Background Technology
[0002] Redundant Array of Independent Disks (RAID) technology combines multiple physical disks into a single logical unit, providing data redundancy and / or performance enhancement to improve the reliability and availability of storage systems. When a disk in a RAID array fails, data needs to be copied from the intact disk (source disk) to a new replacement disk (target disk); this process is called RAID rebuild.
[0003] Currently, traditional RAID reconstruction mechanisms generally adopt a "read-before-write" mode: during the reconstruction process, the system first reads data blocks (reconstruction data) from the intact source disk and caches these data blocks in the controller's memory; subsequently, the system writes the data blocks from this memory to the target disk. This "cache-forward" mechanism has significant problems: it not only requires a large amount of memory resources to temporarily store all the data blocks to be transmitted, but also increases the data transmission path and time due to the additional data caching steps and the serial command execution method (write operations can only be initiated after the read operation is completed), ultimately leading to low overall reconstruction efficiency. Summary of the Invention
[0004] The purpose of this application is to provide a RAID reconstruction method, apparatus, electronic device, and storage medium that can improve RAID reconstruction efficiency and reduce resource consumption.
[0005] To achieve the above objectives, this application is implemented as follows: Firstly, a RAID reconstruction method is provided, including: A read command is sent to the source disk of the RAID to cause the source disk to initiate a read operation on the reconstructed data of the RAID; and a write command is sent to the target disk to cause the target disk to initiate a write operation on the data received from the outside; wherein the timing difference between the sending of the read command and the write command is less than the time required for the source disk to read all the reconstructed data of the RAID; The reconstructed data read from the source disk is transmitted to the target disk via a point-to-point data channel from the source disk to the target disk in a non-cached pass-through mode.
[0006] Secondly, a RAID reconstruction device is provided, comprising: The instruction sending module is configured to send a read command to the source disk of the RAID to cause the source disk to initiate a read operation for the reconstructed data of the RAID; and to send a write command to the target disk to cause the target disk to initiate a write operation for data received from the outside; wherein the timing difference between the sending of the read command and the write command is less than the time required for the source disk to read all the reconstructed data of the RAID; The data transmission module is used to transmit the reconstructed data read from the source disk to the target disk in a non-cached pass-through mode via a point-to-point data channel from the source disk to the target disk.
[0007] Thirdly, an electronic device is provided, comprising: a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the method of the first aspect.
[0008] Fourthly, a computer-readable storage medium is provided that stores one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method described in the first aspect.
[0009] This application proposes a "read-while-writing" RAID reconstruction mechanism. Specifically, the scheme decouples the read operations of the source disk from the write operations of the target disk during the RAID reconstruction process. It abandons the limitation of the traditional "data caching before forwarding" scheme, which requires read and write operations to be executed strictly serially. It only needs to ensure that the time difference between sending read and write commands is less than the time required for the source disk to complete reading all the reconstruction data. Based on this, the reconstruction data read in real time from the source disk is directly transmitted to the target disk in a non-cached pass-through mode through a point-to-point data channel from the source disk to the target disk (skipping any intermediate caching steps) for writing. This allows read and write operations to overlap at least partially in time, thereby significantly improving reconstruction efficiency. At the same time, since no caching is required during transmission, it also avoids dependence on cache resource capacity and performance, thus reducing the hardware configuration requirements for RAID reconstruction. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings used in the description of the embodiment or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram of the first process of a traditional RAID reconstruction scheme.
[0012] Figure 2 This is a schematic diagram of the second process for a traditional RAID reconstruction scheme.
[0013] Figure 3 This is a schematic diagram of the first process of the RAID reconstruction method provided in the embodiments of this application.
[0014] Figure 4 This is a schematic diagram of the architecture of the RAID reconstruction method provided in the embodiments of this application.
[0015] Figure 5 This is a first timing diagram of the RAID reconstruction method provided in the embodiments of this application.
[0016] Figure 6 This is a second timing diagram of the RAID reconstruction method provided in the embodiments of this application.
[0017] Figure 7 This is a third timing diagram of the RAID reconstruction method provided in the embodiments of this application.
[0018] Figure 8 This is a schematic diagram of the RAID reconstruction device provided in an embodiment of this application.
[0019] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] The terms "first," "second," etc., used in this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, "and / or" in this application indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship. It should be noted that all data involved in this application was obtained with the user's authorization.
[0022] Traditional RAID reconstruction schemes generally employ a "read-then-write" approach. In this process, the system first reads the reconstruction data (data blocks) from the intact source disk and caches this reconstruction data in the controller's memory. Subsequently, the system writes the cached reconstruction data from memory to the target disk.
[0023] in, Figure 1 This example illustrates a traditional rebuild process performed by a RAID controller, including the following steps: ① The rebuild engine sends a read command to disk A; ② Disk A transmits the reconstruction data to the reconstruction engine and stores it in memory; ③ The rebuild engine sends a write command to disk B; ④ The reconstructed data in memory is finally transferred to disk B to complete the writing process.
[0024] Correspondingly, Figure 2 The timing diagram for RAID reconstruction is shown, where read commands are sent first, followed by write commands, and data is stored before being forwarded. The specific process is as follows: During the data reading phase of data reconstruction: TR1 time: The controller sends a read command to disk A.
[0025] TR2 time: Disk A responds to the controller's read command, begins reading and sending reconstruction data, and the controller caches the reconstruction data in memory.
[0026] TR3 time: Data transfer on disk A has ended.
[0027] TR4 time: Disk A returns a read response.
[0028] During the data reconstruction writing phase: TW1 time: The controller sends a write command to disk B.
[0029] TW2 time: Disk B returns a write data request.
[0030] TW3 time: The controller retrieves the reconstructed data from the cache and sends it to disk B.
[0031] TW4 time: The process of sending reconstruction data to disk B is complete.
[0032] TW5 time: Disk B returns write response.
[0033] It can be seen that the above-mentioned "cache-forwarding" reconstruction scheme has two main problems: First, it requires a large amount of memory resources to temporarily store all the reconstruction data to be transmitted. Second, the additional data caching steps and commands must be executed serially (i.e., a write operation can only be initiated after a read operation is completed), which not only prolongs the data transmission path but also increases the data transmission time, thereby reducing the overall reconstruction efficiency.
[0034] Therefore, this application proposes a RAID reconstruction method, apparatus, electronic device, and storage medium, aiming to improve RAID reconstruction efficiency and reduce resource consumption.
[0035] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0036] One embodiment of this application provides a RAID reconstruction method. Figure 3 This is a flowchart illustrating the RAID reconstruction method, which includes the following steps: S101, a read command is sent to the source disk of the RAID to cause the source disk to start a read operation for the RAID reconstruction data; and a write command is sent to the target disk to cause the target disk to start a write operation for the data received from the outside; wherein the timing difference between sending the read command and the write command is less than the time required for the source disk to read all the RAID reconstruction data.
[0037] In this embodiment, the read operation of the source disk for RAID reconstruction data is decoupled from the write operation of the target disk for externally received data. Therefore, there is no strict requirement for the order in which read and write commands are sent, and any of the following methods can be used: 1) Read commands are sent first: that is, the timing of reading commands is earlier than that of writing commands.
[0038] 2) Write commands are sent first: that is, read commands are sent later than write commands.
[0039] 3) Read and write commands are sent simultaneously: that is, the timing of reading and writing commands is the same.
[0040] The timing difference between sending read and write commands must be less than the time required for the source disk to read all the reconstructed RAID data. This is to ensure that the target disk can start writing some of the reconstructed data before the source disk reads all the reconstructed data, thus achieving the effect of "reading and writing simultaneously".
[0041] Specifically, the transmission timing difference Based on the total amount of reconstructed data and the sustained read rate of the source disk The data relationships can be flexibly configured and expressed using the following formula:
[0042] S102 transmits the reconstructed data read from the source disk to the target disk in a non-cached pass-through mode via a point-to-point data channel from the source disk to the target disk.
[0043] In this embodiment, the point-to-point data channel directly connects the data read buffer of the source disk and the data write buffer of the target disk via a physical link. Specifically, the reconstructed data read from the disk medium on the source disk side is first stored in its local data read buffer, and then sent to the target disk through the point-to-point channel; while on the target disk side, the received reconstructed data is temporarily stored in its local data write buffer, awaiting final writing to the disk medium. This design ensures that the reconstructed data no longer passes through... Figure 1 The controller's memory is used, thus eliminating the traditional "cache forwarding" model.
[0044] Based on this design, to further improve the reliability of data transmission and avoid data congestion caused by the target disk not being ready to write after the reconstructed data arrives, this embodiment introduces a response mechanism to establish a point-to-point data channel after sending the write command. Specifically, this embodiment does not immediately establish a point-to-point channel, but first waits for the target disk to complete the necessary write preparation work. When the target disk receives the write command, it performs internal preparations (such as addressing, buffer preparation, etc.), and when it is ready to write data, it actively sends a write data request. Accordingly, after receiving this write data request from the target disk, this embodiment triggers and establishes a point-to-point data channel from the source disk to the target disk.
[0045] Furthermore, considering the potential timeout risk in the response mechanism (to avoid indefinite waiting for a response to a write data request), this embodiment starts a timing window (the duration of which is less than the transmission timing difference) after successfully sending a write command to the target disk. If no write data request is received from the target disk within the preset time frame of this timing window, it is considered an abnormal situation, and a rebuild exception message will be automatically generated and issued. This rebuild exception message is intended to promptly notify maintenance personnel to intervene, check the status of the target disk, troubleshoot the fault, and ensure that the rebuild process is completed in a timely manner.
[0046] Through the non-cached pass-through mode of the point-to-point data channel described above, whenever the source disk successfully reads the reconstructed data of a data block, that data block can be immediately sent directly to the target disk via the point-to-point channel. Upon receiving the data block, the target disk can independently begin writing it to the storage medium. This mechanism completely avoids the serial execution method of traditional solutions, which requires waiting for all data to be read before initiating the write operation, thus achieving true parallel read and write processing.
[0047] Under this parallel read / write processing mechanism, the source disk completes all reconstructed data read operations earlier than the target disk completes all reconstructed data write operations. Therefore, after receiving a reconstructed data read completion response from the source disk, if a data write completion response is further received from the target disk, the reconstruction process can be considered complete. At this point, the point-to-point data channel can be terminated and related resources can be reclaimed. In other words, this embodiment achieves true decoupling between target disk writing and source disk reading: the target disk writes all received external data according to the write command, without distinguishing whether it is reconstructed data, thus making it impossible to determine whether all reconstructed data has been written. However, after the source disk finishes reading the last reconstructed data block and sends it to the target disk via the point-to-point channel, if the target disk responds with a data write completion response (not a reconstructed data write completion response), it can be determined that all reconstructed data blocks have been written to the target disk, thereby ending the reconstruction process.
[0048] Furthermore, to ensure the accuracy and reliability of the reconstructed data and prevent silent errors during transmission, this embodiment introduces a mandatory data verification step after confirming that both read and write operations have been completed (i.e., receiving the reconstructed data read completion response and data write end response). The specific verification process is as follows: First, a first checksum is requested and obtained from the source disk, and a second checksum is requested and obtained from the target disk. The first checksum is generated by the source disk based on all the reconstructed data it actually reads; for example, by hashing the data digest of all the reconstructed data. The second checksum is generated by the target disk based on all the reconstructed data content it ultimately writes to the storage medium (also by calculating the data digest).
[0049] Next, the first checksum and the second checksum are compared. If the first checksum and the second checksum match, it indicates that the target disk has successfully and accurately synchronized all the reconstruction data of the source disk. At this time, a reconstruction success message is generated and issued, marking the completion of this reconstruction task. If the first checksum and the second checksum do not match, it indicates that an error occurred during data transmission or writing, and the data on the target disk failed to synchronize the data on the source disk correctly. At this time, a reconstruction failure message is generated and issued to alert the administrator to intervene and investigate the cause (such as channel failure, bad blocks on the disk, etc.) to assist in decision-making on appropriate measures (such as re-initiating the reconstruction, replacing the disk, etc.).
[0050] In summary, this embodiment implements a "read-while-writing" RAID reconstruction mechanism. Specifically, the scheme decouples the read operations of the source disk from the write operations of the target disk during RAID reconstruction, abandoning the limitation of the traditional "data caching before forwarding" scheme that requires read and write operations to be executed strictly serially. It only needs to ensure that the time difference between sending read and write commands is less than the time required for the source disk to complete reading all the reconstruction data. Based on this, through the point-to-point data channel from the source disk to the target disk, the reconstruction data read in real time from the source disk is directly transmitted to the target disk in a non-cached pass-through mode (skipping any intermediate caching steps) for writing. This allows read and write operations to overlap at least partially in time, thereby significantly improving reconstruction efficiency. At the same time, since no caching is required during transmission, it also avoids dependence on cache resource capacity and performance, thus reducing the hardware configuration requirements for RAID reconstruction.
[0051] In practical applications, the RAID reconstruction method of this embodiment can be implemented through the RAID controller. For detailed procedures, please refer to [reference needed]. Figure 4 As shown, at the instruction level: the reconstruction engine in the controller simultaneously sends read commands to the source disk (e.g., disk A) and write commands to the target disk (e.g., disk B), or sends a write command to the target disk first and then a read command to the source disk, or vice versa. At the data level: a direct data channel is established through the intelligent data processing module, directly transferring the data read from the source disk to the target disk, skipping the cache transfer step. Taking the quasi-parallel mode of write-then-read as an example, the specific process is as follows: ① The reconstruction engine sends a write command to the target disk (disk B); ② Subsequently, it sends a read command to the source disk (disk A); ③ A direct channel from disk A to disk B is established through the intelligent processing module; ④ Data is directly transferred from disk A to disk B to complete the write operation.
[0052] The timing relationship of the RAID reconstruction method in this embodiment will be illustrated below with examples of different implementation methods.
[0053] Implementation Method 1 refer to Figure 5 As shown, this implementation adopts a write-then-read direct data reconstruction mode, and the corresponding timing relationship of the process includes: NTW1 time: The controller sends a write command to disk B; NTW2 time: Disk B sends a write data request to the controller in response; NTR1 time: The controller sends a read command to disk A; NTR2 time: Disk A responds to the controller's read command and begins reading the reconstruction data; NTW3 time: The controller's reconstruction engine establishes a point-to-point data channel through the data intelligent processing module, and disk B officially begins writing data, performing write operations on the reconstruction data transmitted from the point-to-point data channel; NTR3 time: Data reading of disk A has ended; NTR4 time: Disk A feedback read response (i.e., the response indicating that the reconstruction data read is complete); NTW4 time: Data writing to disk B is complete; NTW5 time: Disk B returns a write response (i.e., a data write completion response), and the controller's rebuild engine cancels the point-to-point data channel.
[0054] Implementation Method Two refer to Figure 6 As shown, this implementation adopts a read-write concurrent direct data reconstruction mode, and the corresponding timing relationship of the process includes: NTW1 time: The controller sends a write command to disk B, and at the same time, the controller sends a read command to disk A; NTW2 time: Disk B responds to the controller with a write data request; NTR2 time: Disk A responds to the controller's read command and begins reading the reconstruction data; NTW3 time: The controller's reconstruction engine establishes a point-to-point data channel through the data intelligent processing module, and disk B officially begins writing data, performing write operations on the reconstruction data transmitted from the point-to-point data channel; NTR3 time: Data reading of disk A has ended; NTW4 time: Data writing to disk B is complete; NTR4 time: Disk A feedback read response (i.e., the response indicating that the reconstruction data read is complete); NTW5 time: Disk B feedback write response (i.e., data write completion response), the controller's rebuild engine cancels the point-to-point data channel.
[0055] Implementation Method 3 refer to Figure 7 As shown, this implementation adopts a read-then-write direct data reconstruction mode, and the corresponding timing relationship of the process includes: NTR1 time: The controller sends a read command to disk A; NTR2 time: Disk A responds to the controller's read command and begins reading the reconstruction data; NTW1 time: The controller sends a write command to disk B; NTW2 time: Disk B sends a write data request to the controller in response; NTW3 time: The controller's reconstruction engine establishes a point-to-point data channel through the data intelligent processing module, and disk B officially begins writing data, performing write operations on the reconstruction data transmitted from the point-to-point data channel; NTR3 time: Data reading of disk A has ended; NTW4 time: Data writing to disk B is complete; NTR4 time: Disk A feedback read response (i.e., the response indicating that the reconstruction data read is complete); NTW5 time: Disk B returns a write response (i.e., a data write completion response), and the controller's rebuild engine cancels the point-to-point data channel.
[0056] Furthermore, another embodiment of this application provides a RAID reconstruction apparatus. Wherein, Figure 8 This is a schematic diagram of the RAID reconstruction device, including: The instruction sending module 810 is configured to send a read command to the source disk of the RAID to cause the source disk to initiate a read operation for the reconstructed data of the RAID; and to send a write command to the target disk to cause the target disk to initiate a write operation for data received from the outside; wherein the timing difference between the sending of the read command and the write command is less than the time required for the source disk to read all the reconstructed data of the RAID.
[0057] The data transmission module 820 is used to transmit the reconstructed data read from the source disk to the target disk in a non-cached pass-through mode through the point-to-point data channel from the source disk to the target disk.
[0058] This embodiment implements a "read-while-writing" RAID reconstruction mechanism. Specifically, the scheme decouples the read operations of the source disk from the write operations of the target disk during the RAID reconstruction process. It abandons the limitation of the traditional "data caching before forwarding" scheme, which requires read and write operations to be executed strictly serially. It only needs to ensure that the time difference between sending read and write commands is less than the time required for the source disk to complete reading all the reconstruction data. Based on this, through the point-to-point data channel from the source disk to the target disk, the reconstruction data read in real time from the source disk is directly transmitted to the target disk in a non-cached pass-through mode (skipping any intermediate caching steps) for writing. This allows read and write operations to overlap at least partially in time, thereby significantly improving reconstruction efficiency. At the same time, since no caching is required during transmission, it also avoids dependence on cache resource capacity and performance, thus reducing the hardware configuration requirements for RAID reconstruction.
[0059] Optionally, the timing of sending the read command and the write command satisfies any of the following conditions: the timing of sending the read command is earlier than the timing of sending the write command; the timing of sending the read command is later than the timing of sending the write command; the timing of sending the read command and the write command is the same.
[0060] Optionally, before transmitting the reconstructed data read from the source disk to the target disk via the point-to-point data channel from the source disk to the target disk in a non-cached pass-through mode, the data transmission module 820 is further configured to: receive a write data request triggered by the target disk after completing write preparation based on the write command; and in response to the write data request, establish a point-to-point data channel from the source disk to the target disk.
[0061] Optionally, the data transmission module 820 is further configured to: generate a reconstruction error message if the write data request is not received within a preset time after the instruction sending module 810 sends the write command to the target disk.
[0062] Optionally, the data transmission module 820 is further configured to: after receiving the reconstruction data read completion response from the source disk, if it further receives the data write completion response from the target disk, then cancel the point-to-point data channel.
[0063] Optionally, the data transmission module 820 is further configured to: after receiving the reconstruction data read completion response from the source disk and the data write completion response from the target disk, obtain a first verification code from the source disk and a second verification code from the target disk; wherein, the first verification code is generated by the source disk based on the read reconstruction data, and the second verification code is generated by the target disk based on the written reconstruction data; if the first verification code and the second verification code are consistent, a reconstruction success message is generated; if the first verification code and the second verification code are inconsistent, a reconstruction failure message is generated.
[0064] It should be understood that the RAID reconstruction device in this embodiment can be used as... Figure 1 The execution body of the method shown is therefore able to achieve... Figure 1 The steps and functions in the method shown.
[0065] Figure 9 This is a schematic diagram of the structure of an electronic device according to one embodiment of this specification. Please refer to it. Figure 9 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0066] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0067] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0068] The processor reads the corresponding computer program from non-volatile memory into memory and then executes it, forming the aforementioned RAID reconstruction device at the logical level. Correspondingly, the processor executes the program stored in memory and specifically performs the following operations: A read command is sent to the source disk of the RAID to cause the source disk to initiate a read operation on the reconstructed data of the RAID; and a write command is sent to the target disk to cause the target disk to initiate a write operation on the data received from the outside; wherein the timing difference between the sending of the read command and the write command is less than the time required for the source disk to read all the reconstructed data of the RAID; The reconstructed data read from the source disk is transmitted to the target disk via a point-to-point data channel from the source disk to the target disk in a non-cached pass-through mode.
[0069] The electronic device in this embodiment implements a "read-while-writing" RAID reconstruction mechanism. Specifically, the scheme decouples the read operations of the source disk and the write operations of the target disk during the RAID reconstruction process. It abandons the limitation of the traditional "data caching before forwarding" scheme, which requires read and write operations to be executed strictly serially. It only needs to ensure that the time difference between sending read and write commands is less than the time required for the source disk to complete reading all the reconstruction data. Based on this, through the point-to-point data channel from the source disk to the target disk, the reconstruction data read in real time from the source disk is directly transmitted to the target disk in a non-cached pass-through mode (skipping any intermediate caching links) for writing. This allows read and write operations to overlap at least partially in time, thereby significantly improving reconstruction efficiency. At the same time, since no caching is required during transmission, it also avoids dependence on cache resource capacity and performance, thus reducing the hardware configuration requirements for RAID reconstruction.
[0070] The above is as described in this instruction manual. Figure 1 The methods disclosed in the illustrated embodiments can be applied to and implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in this embodiment. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in this embodiment can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0071] It should be understood that the electronic equipment in this embodiment can enable the RAID reconstruction device to achieve the corresponding Figure 1The steps and functions of the method shown are not repeated here as the principle is the same.
[0072] Of course, in addition to software implementation, the electronic device described in this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0073] Furthermore, this embodiment also proposes a computer-readable storage medium that stores one or more programs, the one or more programs including instructions.
[0074] When the aforementioned instructions are executed by a portable electronic device that includes multiple applications, they enable the portable electronic device to perform... Figure 1 The steps of the method shown include: A read command is sent to the source disk of the RAID to cause the source disk to initiate a read operation on the reconstructed data of the RAID; and a write command is sent to the target disk to cause the target disk to initiate a write operation on the data received from the outside; wherein the timing difference between the sending of the read command and the write command is less than the time required for the source disk to read all the reconstructed data of the RAID; The reconstructed data read from the source disk is transmitted to the target disk via a point-to-point data channel from the source disk to the target disk in a non-cached pass-through mode.
[0075] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0076] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0077] The above are merely embodiments of this specification and are not intended to limit the scope of this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification. Furthermore, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of this document.
Claims
1. A method for rebuilding a redundant array of independent disks (RAID), characterized in that, include: Send a read command to the source disk of the RAID to cause the source disk to initiate a read operation to rebuild data for the RAID; In addition, a write command is sent to the target disk to cause the target disk to initiate a write operation on the data received from the outside; wherein the timing difference between the sending of the read command and the write command is less than the time required for the source disk to read all the RAID reconstruction data; The reconstructed data read from the source disk is transmitted to the target disk via a point-to-point data channel from the source disk to the target disk in a non-controller cache pass-through mode; the point-to-point data channel is directly connected to the data read buffer of the source disk and the data write buffer of the target disk.
2. The method according to claim 1, characterized in that, The timing of sending the read command and the write command satisfies any of the following conditions: The timing of sending the read command is earlier than the timing of sending the write command; The timing of sending the read command is later than the timing of sending the write command; The read command and the write command are sent in the same timing sequence.
3. The method according to claim 1, characterized in that, Before transmitting the reconstructed data read from the source disk to the target disk in a non-cached pass-through mode via the point-to-point data channel from the source disk to the target disk, the method further includes: Receive the write data request triggered by the target disk after it has completed the write preparation based on the write command; In response to the write data request, a point-to-point data channel is established between the source disk and the target disk.
4. The method according to claim 3, characterized in that, Also includes: If no write data request is received within a preset time after the write command is sent to the target disk, a rebuild error message is generated.
5. The method according to any one of claims 1 to 4, characterized in that, Also includes: If, after receiving a response indicating that the reconstruction data read is complete from the source disk, a response indicating that the data write is complete from the target disk is further received, then the point-to-point data channel is cancelled.
6. The method according to any one of claims 1 to 4, characterized in that, Also includes: After receiving the reconstruction data read completion response from the source disk and the data write completion response from the target disk, a first checksum is obtained from the source disk and a second checksum is obtained from the target disk; wherein, the first checksum is generated by the source disk based on the read reconstruction data, and the second checksum is generated by the target disk based on the written reconstruction data; If the first verification code matches the second verification code, a message indicating successful reconstruction is generated. If the first verification code and the second verification code are inconsistent, a reconstruction failure message will be generated.
7. A RAID reconstruction device, characterized in that, include: The instruction sending module is used to send a read command to the source disk of the RAID, so that the source disk initiates a read operation for rebuilding data for the RAID; In addition, a write command is sent to the target disk to cause the target disk to initiate a write operation on the data received from the outside; wherein the timing difference between the sending of the read command and the write command is less than the time required for the source disk to read all the RAID reconstruction data; The data transmission module is used to transmit the reconstructed data read from the source disk to the target disk through a point-to-point data channel from the source disk to the target disk in a non-controller cache pass-through mode; the point-to-point data channel is directly connected to the data read buffer of the source disk and the data write buffer of the target disk.
8. An electronic device, comprising: processor; And a memory arranged to store computer-executable instructions, characterized in that, when executed, the executable instructions cause the processor to perform the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for data reconstruction of disk array, and disk array system
CN105183583A
RAID model, data reading and writing and reconstruction method thereof
CN106227463A