A read-write request processing method, device, equipment, medium and product
By monitoring and differentiating the hard drive reconstruction areas in a RAID system, direct read and write operations are allowed for completed areas, while requests for incomplete areas are suspended. This solves the write amplification problem during hard drive reconstruction, improving I/O performance and hard drive lifespan.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
- Filing Date
- 2024-11-08
- Publication Date
- 2026-07-10
AI Technical Summary
During hard drive rebuilding in a RAID system, traditional methods lead to write amplification, increasing hard drive wear and reducing effective I/O bandwidth.
By monitoring the physical address range of hard drive reconstruction, the system distinguishes between completed and incomplete reconstruction areas, allowing direct read and write operations for completed areas and suspending requests for incomplete areas, thereby reducing write amplification operations.
It reduces the number of write amplification I/Os, increases the effective I/O bandwidth of the hard drive, extends the lifespan of the hard drive, and improves read and write performance.
Smart Images

Figure CN119473152B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of I / O data processing technology, and specifically to a read / write request processing method, apparatus, device, medium, and product. Background Technology
[0002] RAID (Redundant Array of Independent Disks) technology is a method to improve data storage performance, reliability, and fault tolerance by distributing data across multiple hard drives. In a RAID 1 / 5 / 6 disk group (DG), when a hard drive fails and redundant disks exist, data can be recovered from the failed drive through a disk rebuild operation. During disk rebuilding, simultaneous service I / O transmission is allowed. When a service I / O operation hits the failed drive, the disk control system "thinks" the failed drive is unreadable and writes it, and uses write amplification to enable service I / O transmission. Write amplification has two typical scenarios: write I / O and read I / O. During write I / O, data from non-failed disks is read, and the parity disk data is recalculated and written to the disk array along with the service I / O. During read I / O, data from non-failed disks is read, and the required I / O data is calculated. During disk rebuilding, the data from the failed disk is recovered using the parity disk data.
[0003] In traditional hard drive reconstruction methods, when I / O hits the hard drive reconstruction disk, the system considers the hard drive unreadable and writable, and can only update the verification data (write I / O) or recover the data (read I / O). This usually introduces write amplification behavior, which not only increases hard drive wear, but also reduces the effective I / O bandwidth. Summary of the Invention
[0004] In view of this, the present invention provides a read / write request processing method, apparatus, device, medium, and product to reduce the number of write amplification I / Os during hard drive rebuilding in a RAID system and improve read / write I / O performance.
[0005] In a first aspect, the present invention provides a read / write request processing method, the method comprising: monitoring the currently reconstructed physical address range of the target hard disk; distinguishing between reconstructed and incomplete reconstructed areas in the target hard disk based on the currently reconstructed physical address range; allowing direct read / write operations for I / O requests when an I / O request hits a reconstructed area; and suspending the I / O request when an I / O request hits an incomplete reconstructed area.
[0006] In one optional implementation, suspending an I / O request when it hits an incomplete reconstruction region includes: the incomplete reconstruction region includes a region that is being reconstructed and a region that has not yet started reconstruction; suspending an I / O request when it hits a region that is being reconstructed; and determining whether to perform a write amplification operation based on the system state when an I / O request hits an incomplete reconstruction region.
[0007] In one alternative implementation, suspending an I / O request when it hits a region being rebuilt includes: establishing a mutex information table; the mutex information table includes an information validity index, a virtual hard disk ID number, a subgroup ID number, a data fragment ID number, and a data fragment quantity; suspending an I / O request when it hits the mutex information table; the mutex information table represents a region being rebuilt.
[0008] In one alternative implementation, after an I / O request hits the mutex information table and is suspended, the process includes: releasing the mutex information table after the target hard disk is rebuilt; and releasing the suspended I / O request and executing it.
[0009] In an optional implementation, the method further includes: if the minimum physical address of the I / O request is less than the currently reconstructed physical address, then the I / O request hits the reconstructed region; if the minimum physical address of the I / O request is greater than or equal to the currently reconstructed physical address, then the I / O request hits the incompletely reconstructed region.
[0010] Secondly, the present invention provides a read / write request processing device, comprising: a hard disk monitoring module for monitoring the currently reconstructed physical address range of the target hard disk; a region differentiation module for differentiating between reconstructed and incomplete reconstructed regions in the target hard disk based on the currently reconstructed physical address range; an I / O read / write module for allowing direct read / write operations when an I / O request hits a reconstructed region; and an I / O suspension module for suspending the I / O request when an I / O request hits an incomplete reconstructed region.
[0011] In one optional implementation, the I / O suspend module is further configured to: include the incomplete reconstruction area as a reconstruction area and the area not yet started in reconstruction; suspend the I / O request when it hits the reconstruction area; and determine whether to perform a write amplification operation based on the system state when the I / O request hits the area not yet started in reconstruction.
[0012] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform a read / write request processing method of the first aspect or any corresponding embodiment described above.
[0013] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute a read / write request processing method according to the first aspect or any corresponding embodiment described above.
[0014] Fifthly, the present invention provides a computer program product, including computer instructions, which are used to cause a computer to execute a read / write request processing method according to the first aspect above or any corresponding embodiment thereof.
[0015] The technical solution provided in this application may include the following beneficial effects:
[0016] Monitoring the current physical address range of the target hard drive during reconstruction allows for real-time acquisition of the specific physical address range where reconstruction is currently underway, providing data support for subsequent region partitioning. Based on the current reconstruction physical address range, the system distinguishes between completed and incomplete reconstruction areas on the target hard drive and implements different processing measures for each area. When an I / O request hits a completed reconstruction area, direct read / write operations are allowed, avoiding write amplification. When an I / O request hits an incomplete reconstruction area, the I / O request is suspended, preventing direct read / write operations. This solution, by differentiating hard drive regions and applying different strategies to different regions, reduces the number of write-amplified I / O operations, increases the effective I / O bandwidth of the hard drive, and improves read / write I / O performance. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a read / write request processing method according to an embodiment of the present invention;
[0019] Figure 2 This is a flowchart illustrating the I / O request suspension and release method according to an embodiment of the present invention;
[0020] Figure 3 This is a flowchart illustrating the current physical address update method according to an embodiment of the present invention;
[0021] Figure 4 This is a structural block diagram of a read / write request processing device according to an embodiment of the present invention;
[0022] Figure 5 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] According to an embodiment of the present invention, a read / write request processing method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0025] This embodiment provides a method for processing read and write requests. Figure 1 This is a flowchart of a read / write request processing method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0026] Step S101: Monitor the current physical address range of the target hard disk to be rebuilt.
[0027] The system monitors in real-time the physical address range currently undergoing reconstruction of the target hard drive. A physical address range refers to a contiguous address space on the hard drive, from a starting physical address to an ending physical address. This space contains multiple physical blocks (such as sectors or blocks), each with a unique physical address, used in this invention to subsequently distinguish read and write areas of the hard drive. Optionally, the system records the physical address range currently undergoing reconstruction, updating this range as the hard drive reconstruction progress changes.
[0028] Step S102: Based on the current reconstructed physical address range, distinguish between the reconstructed and incomplete reconstructed areas in the target hard disk.
[0029] Using physical addresses as the partitioning basis, the hard drive's data space is divided into different regions. By comparing the physical address of the I / O request with the physical address range of the hard drive undergoing reconstruction, it is determined whether the I / O request hits a region that has completed reconstruction or a region that has not yet completed reconstruction. A region that has completed reconstruction refers to the range of physical addresses on the hard drive where data recovery has been successfully completed and is now usable during the reconstruction process. A region that has not yet completed reconstruction refers to the range of physical addresses on the hard drive where data recovery has not yet been completed during the reconstruction process.
[0030] Optionally, as the hard disk reconstruction process progresses, the boundaries of the address ranges of completed and incomplete regions are dynamically updated to ensure the accuracy of the partitioning results.
[0031] Step S103: When an I / O request hits a region that has been rebuilt, the I / O request is allowed to perform direct read and write operations.
[0032] If the physical address of the I / O request is located within the rebuilt region, it indicates that the hard disk reconstruction process has been completed for this part of the I / O request. In this case, the I / O request is allowed to directly perform read and write operations on the hard disk, reducing unnecessary write amplification operations.
[0033] Step S104: When an I / O request hits an area that has not been rebuilt, the I / O request is suspended.
[0034] If the physical address of an I / O request is located in an area that has not yet been rebuilt, this part of the I / O request may be incomplete or unavailable. Directly performing read and write operations may result in data corruption or loss. Therefore, the I / O request is suspended and processed after the area is rebuilt.
[0035] In summary, the read / write request processing method provided in this embodiment effectively reduces the number of write amplification I / O operations through region partitioning and I / O request processing strategies, thereby increasing the effective I / O bandwidth of the hard disk and improving read / write I / O performance.
[0036] Further, step S104 above includes:
[0037] Step S1041: The areas that have not been rebuilt include areas that are being rebuilt and areas that have not yet started rebuilding.
[0038] The incomplete rebuild area refers to the data space on a RAID hard drive that is not yet fully rebuilt. Depending on the rebuild progress, it is further subdivided into the rebuilding area and the non-rebuild area. The rebuilding area refers to the physical address range where the rebuilding operation is in progress, while the non-rebuild area refers to the physical address range where the rebuilding operation has not yet begun.
[0039] Step S1042: When an I / O request hits a region that is being rebuilt, suspend the I / O request.
[0040] When an I / O request's physical address falls within a region that is being rebuilt, the data in that region is being rebuilt and is in an inconsistent or unavailable state, making it impossible for the hard drive to read or write. To avoid introducing write amplification, the I / O request is suspended, that is, temporarily stored in an I / O suspending device to wait. I / O suspending refers to implementing I / O suspending in the RAID controller or I / O scheduler to temporarily store and process I / O requests that hit the region being rebuilt.
[0041] Step S1043: When an I / O request hits a region that has not yet started rebuilding, determine whether to perform a write amplification operation based on the system status.
[0042] When the physical address of an I / O request falls within an area where reconstruction has not yet begun, the system needs to determine whether to perform a write amplification operation based on the current system state. Data in this area has not yet been rebuilt, so direct reading and writing may lead to data inconsistency or corruption. However, under certain circumstances, to ensure business continuity and data availability, a write amplification operation will be performed, i.e., by reading data from the non-faulty disk and recalculating the parity data to satisfy the I / O request. Optionally, when I / O load is low and reconstruction progress is fast, a write amplification operation may not be performed to reduce hard drive wear and improve performance; conversely, when I / O load is high and reconstruction progress is slow, a write amplification operation will be performed to ensure business continuity.
[0043] Further, step S1042 above includes:
[0044] Step a11: Establish a mutual exclusion information table; the mutual exclusion information table includes information validity indicators, virtual hard disk ID number, subgroup ID number, data shard ID number, and number of data shards.
[0045] A mutex table is a data structure used to represent the mutex space, that is, the data space on the hard drives in a RAID system where a rebuild operation is in progress. The mutex table uses data stripes as its basic unit and includes:
[0046] Information Validity Index (VLD): Characterizes the validity of information in mutually exclusive spaces.
[0047] Virtual Disk ID (VID): In a RAID system, each virtual hard disk has a unique ID number to identify its identity and location.
[0048] Span ID: In some RAID implementations, virtual hard disks are further divided into multiple spans for better data management and performance optimization. The span ID is used to identify the span.
[0049] Stripe ID: A stripe is the basic unit of data organization in a RAID system. It typically represents a segment of data stored contiguously on a physical hard drive. The stripe ID is used to uniquely identify these stripes.
[0050] Number of data stripes (StripeNum): Represents the number of stripes of size contained in the mutual exclusion space.
[0051] The mutex information table can indicate which data blocks in the RAID system are being rebuilt, providing a basis for subsequent I / O request processing.
[0052] Step a12: When an I / O request hits the mutex information table, the I / O request is suspended; the mutex information table indicates the region being rebuilt.
[0053] In a RAID system, if an I / O request hits the mutex information table, the I / O request is suspended, that is, temporarily stored in the I / O suspension device and waits until the reconstruction process is completed and the mutex information is released before continuing to perform read and write operations.
[0054] Furthermore, following step a12 above, the following steps are also included:
[0055] Step b11: After the target hard drive is rebuilt, release the mutex information table.
[0056] After the target hard drive in the RAID system has been rebuilt, the system needs to release the mutex table to reclaim the occupied memory or resources. Releasing the mutex table can be done by deleting it from memory or marking it as invalid. This ensures that subsequent I / O request hits will not refer to the already rebuilt hard drive area, allowing the system to accurately determine the hit area of I / O requests and ensuring data consistency and integrity.
[0057] Step b12: Release the pending I / O requests and execute.
[0058] After the target hard drive completes its reconstruction process and releases the mutex table, I / O requests that were suspended due to mutex table hits can begin execution. The wait queue in the I / O suspension device is traversed, and suspended I / O requests are released and sent to the corresponding devices for read / write operations. Optionally, the execution order of requests can be determined based on factors such as I / O request priority and waiting time, ensuring that high-priority or long-waiting requests are processed first, improving system efficiency.
[0059] In embodiments of the present invention, such as Figure 2 As shown, a virtual disk (VD) comprises multiple physical disks (PDs), with stripes representing subgroups and spans representing data shards. A mutex table is created in the I / O-inaccessible mutex space of the disk. IO A and IO C, if they hit the mutex table, are suspended; IO B, if it doesn't hit the mutex table, is sent directly. After the target disk is rebuilt, the mutex table is released, and the suspended IO A and IO C are sent again.
[0060] In one optional implementation, a read / write request processing method further includes:
[0061] In step S201A, if the minimum physical address of the I / O request is less than the currently reconstructed physical address, then the I / O request hits the already reconstructed region.
[0062] The system determines the relationship between the minimum physical address (Min_PBA) of the I / O request and the currently rebuilt physical address (Rebuild PBA). If the minimum physical address of the I / O request is less than the currently rebuilt physical address, it indicates that the target data for the I / O request is located in an area that has already been rebuilt. In this case, the RAID system can allow the I / O request to directly perform read and write operations.
[0063] Step S201B: If the minimum physical address of the I / O request is greater than or equal to the currently reconstructed physical address, then the I / O request hits the incomplete reconstruction region.
[0064] If the minimum physical address of the I / O request is greater than or equal to the currently rebuilt physical address, it indicates that the target data for the I / O request is located in a region where reconstruction has not yet begun. In this case, it is necessary to determine whether to perform a write amplification operation based on the system state.
[0065] Through steps S201A and S201B, the RAID system can more accurately determine the location of I / O requests and take corresponding processing strategies, thereby optimizing read and write I / O performance during the hard drive rebuilding process.
[0066] Optionally, after the current data space is reconstructed, the currently reconstructed physical address is updated, and then the mutual exclusion information for the next data space is updated. In embodiments of the present invention, such as... Figure 3 As shown, physical addresses on the hard drive are numbered from PBA0 to PBAn. The current physical address being rebuilt (Rebuild PBA) is PBAx. At this point, the area from PBA0 to PBAx is the data space that has been rebuilt. The area starting from PBAx is the data space that is being rebuilt, and the remaining space is the data space that has not yet started rebuilding. Once this data space is rebuilt, Rebuild PBA is updated to PBAy, corresponding to the update of the data space that is being rebuilt.
[0067] In embodiments of the present invention, when I / O hits a data space that has already been rebuilt, the number of I / O operations compared to the conventional method is as follows:
[0068]
[0069] In summary, full striping reduces common write amplification issues, lowers the write operation burden on the hard drive, and extends its lifespan. By reducing the number of write-amplified I / Os, the effective I / O bandwidth of the hard drive is increased, thereby improving system performance when handling concurrent I / O operations. This method reduces penalty data storage, improves resource utilization, and reduces resource consumption during data recovery. It is suitable for various environments using RAID 1 / 5 / 6 systems, benefiting data centers, enterprise storage, and personal high-performance storage solutions. The method can dynamically adjust based on mutex table resources and the rebuild process to adapt to changing workloads and environmental conditions.
[0070] This embodiment also provides a read / write request processing device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0071] This embodiment provides a read / write request processing device, such as... Figure 4 As shown, it includes:
[0072] The hard disk monitoring module 401 is used to monitor the current physical address range of the target hard disk being rebuilt.
[0073] The region differentiation module 402 is used to differentiate between regions that have been rebuilt and regions that have not been rebuilt in the target hard disk based on the current reconstructed physical address range.
[0074] I / O read / write module 403 is used to allow I / O requests to directly read and write when an I / O request hits a reconstructed area;
[0075] I / O suspend module 404 is used to suspend I / O requests when an I / O request hits an incomplete reconstruction area.
[0076] In an alternative implementation, the I / O suspend module 404 is further configured to:
[0077] The first I / O suspend unit is used for areas that have not been rebuilt, including areas that are being rebuilt and areas that have not yet started rebuilding.
[0078] The second I / O suspend unit is used to suspend I / O requests when an I / O request hits a region that is being rebuilt.
[0079] The third I / O suspend unit is used to determine whether to perform a write amplification operation based on the system status when an I / O request hits a region that has not yet started rebuilding.
[0080] In one optional implementation, the second I / O suspend unit includes:
[0081] The first mutual exclusion information table unit is used to establish the mutual exclusion information table; the mutual exclusion information table includes information validity indicators, virtual hard disk ID number, subgroup ID number, data fragment ID number, and number of data fragments.
[0082] The second mutex information table unit is used to suspend the I / O request when the I / O request hits the mutex information table; the mutex information table represents the region being rebuilt.
[0083] In one optional embodiment, the device further includes:
[0084] The first suspend release unit is used to release the mutex information table after the target hard disk is rebuilt.
[0085] The second suspend release unit is used to release suspended I / O requests and execute them.
[0086] In one optional embodiment, the device further includes:
[0087] The first region determination unit is used to determine if the minimum physical address of the I / O request is less than the currently reconstructed physical address, in which case the I / O request hits the already reconstructed region.
[0088] The second region determination unit is used to determine if the minimum physical address of the I / O request is greater than or equal to the currently reconstructed physical address, in which case the I / O request hits the region that has not been reconstructed.
[0089] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0090] In this embodiment, a read / write request processing device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application-On Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0091] This invention also provides a computer device having the above-described features. Figure 4 The above describes a read / write request processing device.
[0092] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 5As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 5 Take a processor 10 as an example.
[0093] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0094] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0095] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0096] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0097] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.
[0098] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.
[0099] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0100] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0101] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A method for processing read / write requests, characterized in that, The method includes: Monitor the current physical address range of the target hard drive being rebuilt; Based on the currently reconstructed physical address range, distinguish between the reconstructed and incomplete reconstructed areas in the target hard disk; When an I / O request hits the reconstructed region, the I / O request is allowed to perform direct read and write operations. When the I / O request hits the incomplete reconstruction area, the I / O request is suspended; The step of suspending the I / O request when it hits the incomplete reconstruction area includes: The incomplete reconstruction area includes areas that are being reconstructed and areas that have not yet started reconstruction. When the I / O request hits the region being rebuilt, suspend the I / O request; When the I / O request hits the region where reconstruction has not yet begun, a write amplification operation is performed based on the system status; the method further includes: If the minimum physical address of the I / O request is less than the currently reconstructed physical address, then the I / O request hits the reconstructed region. If the minimum physical address of the I / O request is greater than or equal to the currently reconstructed physical address, then the I / O request hits the incomplete reconstruction region.
2. The method according to claim 1, characterized in that, The step of suspending the I / O request when it hits the region being rebuilt includes: Establish a mutual exclusion information table; the mutual exclusion information table includes information validity indicators, virtual hard disk ID number, subgroup ID number, data fragment ID number, and number of data fragments; When an I / O request hits the mutex information table, the I / O request is suspended; the mutex information table represents the region being rebuilt.
3. The method according to claim 2, characterized in that, When an I / O request hits the mutex information table, suspending the I / O request includes: After the target hard disk is rebuilt, the mutex information table is released; Release the pending I / O request and execute it.
4. A read / write request processing device, characterized in that, The device includes: The hard drive monitoring module is used to monitor the current physical address range of the target hard drive during reconstruction. The region differentiation module is used to differentiate between regions that have been reconstructed and regions that have not been reconstructed in the target hard disk based on the currently reconstructed physical address range. The I / O read / write module is used to allow the I / O request to directly read and write the reconstructed area when the I / O request hits the reconstructed area. An I / O suspension module is configured to suspend an I / O request when the I / O request hits the incomplete reconstruction area; the I / O suspension module is further configured to: The incomplete reconstruction area includes areas that are being reconstructed and areas that have not yet started reconstruction. When the I / O request hits the region being rebuilt, suspend the I / O request; When the I / O request hits the region that has not yet started rebuilding, a write amplification operation is determined based on the system state; it also includes: a first region judgment unit, used to determine if the minimum physical address of the I / O request is less than the physical address of the current rebuilding, then the I / O request hits the region that has been rebuilt. The second region determination unit is used to determine if the minimum physical address of the I / O request is greater than or equal to the currently reconstructed physical address, in which case the I / O request hits the region that has not been reconstructed.
5. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 3.
7. A computer program product, characterized in that, Includes computer instructions for causing a computer to perform the method of any one of claims 1 to 3.