Data reading method, controller, computer equipment and storage medium
By sharing memory between controllers, obtaining the initialization metadata of the target strip and judging its initialization status, the problems of low data reading efficiency and poor accuracy in global deletion scenarios are solved, and a more efficient and reliable data reading and global deletion process is achieved.
Patent Information
- Application Number
- CN202411891547.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-20
AI Technical Summary
In the global deletion scenario, the data reading from the storage system is low efficiency and poor accuracy, resulting in low efficiency and poor accuracy of global deletion, affecting the performance and reliability of the entire storage system.
By sharing memory between controllers, obtaining the initialization metadata of the target controller belonging to the target strip, determining whether the target strip has completed initialization, and reading data from the disk of the target strip after initialization is completed, avoiding conflicts during initialization and data reconstruction.
It improves the efficiency and accuracy of reading data from the storage system, improves the efficiency and accuracy of global deletion, and ensures the performance and reliability of the entire storage system.
Smart Images

Figure CN119759284A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data storage, and in particular to a data reading method, a controller, a computer device and a storage medium. Background Art
[0002] In today's big data era, with the continuous growth of data volume, data storage has become an important issue in various fields. In the process of data storage, in order to avoid occupying too many storage resources and reduce the space occupation and cost of data storage, the host usually uses data deduplication (DDP) technology to reduce duplicate data in the storage system, that is, to perform global deduplication on the storage system. For high-end storage systems (four controllers and above) of all-flash storage arrays (ALL Flash Array, AFA), if the metadata of each controller is completely consistent, then the synchronization overhead between multiple controllers will inevitably increase, which will have a serious impact on performance. Therefore, metadata is usually synchronized between two controllers. Metadata includes the mapping relationship of deduplication and background tasks of RAID.
[0003] As a result, the host directly sends data read requests from all controllers to query deduplication metadata and read operations, which will cause serious conflicts between read operations and metadata synchronization from the four controllers. For example, in the initialization scenario, when reading data from the stripe where the data to be read is located, other controllers are initializing the stripe. These conflicts will lead to low efficiency and poor accuracy in reading data from the storage system in the global deduplication scenario, which will in turn lead to low efficiency and poor accuracy in global deduplication, affecting the performance and reliability of the entire storage system. Summary of the invention
[0004] In view of this, the present invention provides a data reading method, a controller, a computer device and a storage medium to solve the problem of low efficiency and poor accuracy in reading data from a storage system in a global deduplication scenario, resulting in low global deduplication efficiency and poor accuracy, affecting the performance and reliability of the entire storage system.
[0005] In a first aspect, the present invention provides a data reading method, which is applied to a first controller, and the method includes: receiving a read request sent from a host, the read request carrying a stripe identifier, the stripe identifier being used to indicate a stripe where target data corresponding to the read request is located; determining, based on the stripe identifier, whether a target stripe corresponding to the stripe identifier belongs to management of the first controller; if not, obtaining initialization metadata corresponding to a target controller to which the target stripe belongs from a shared memory, the initialization metadata being used to indicate whether initialization of the target stripe has been completed; when the initialization metadata indicates that initialization of the target stripe has been completed, reading target data from at least one disk corresponding to the target stripe, and returning the target data to the host.
[0006] Based on the above-mentioned first aspect, when the first controller receives a read request sent from the host, it can determine whether the target stripe corresponding to the stripe identifier belongs to the management of the first controller based on the stripe identifier carried in the read request; and when the target stripe does not belong to the management of the first controller, obtain the initialization metadata corresponding to the target controller to which the target stripe belongs from the shared memory to determine whether the target stripe has completed initialization, and when the target stripe has completed initialization, read the target data from at least one disk corresponding to the target stripe and return it to the host.
[0007] Since the shared memory is shared by all controllers, after the first controller receives a read request and the target stripe is not managed by the first controller, it can obtain the initialization metadata of the target controller corresponding to the target stripe from the shared memory; then it can first determine whether the target stripe has been initialized, and after the target stripe has been initialized, it can read the target data from at least one disk corresponding to the target stripe. Therefore, it can avoid the conflict in the initialization scenario where the stripe where the data to be read is located is read while other controllers are initializing the stripe, thereby improving the efficiency and accuracy of reading data from the storage system, thereby improving the efficiency and accuracy of global deduplication, and ensuring the performance and reliability of the entire storage system.
[0008] In an optional embodiment, each disk includes a check block and a data block, the data block stores data, and the check block stores check information for recovering the data stored in the data block; before obtaining the initialization metadata corresponding to the target controller from the shared memory, the method also includes: obtaining the check synchronization metadata corresponding to the target controller from the shared memory, the check synchronization metadata is used to indicate whether the target stripe is marked as having a problem with the readability of the check block; if the check synchronization metadata indicates that the target stripe is not marked as having a problem with the readability of the check block, it is determined that all check blocks of at least one disk are not faulty.
[0009] In an embodiment of the present invention, since the shared memory is the shared memory of all controllers, the first controller can obtain the verification synchronization metadata corresponding to the target controller from the shared memory, and then determine whether the target stripe is marked as having a problem with the readability of the verification block, which facilitates the subsequent first controller to determine whether the target data can be read from at least one disk.
[0010] In an optional embodiment, the method also includes: if the check synchronization metadata indicates that the target stripe is marked as having a problem with the readability of the check block, determining that there is a first disk in at least one disk, and that there is a fault in the first check block of the first disk; obtaining the first disk status of the first disk, the first disk status being used to indicate whether there is a fault in the data block of the first disk; if the first disk status indicates that there is no fault in the data block of the first disk, reading the target data from at least one disk.
[0011] In an embodiment of the present invention, the first controller can mark the target stripe as having a problem with the readability of the check block, determine the first disk having the problem with the readability of the check block from at least one disk, and further determine whether the data block of the first disk is faulty, so that even if the first disk has a problem with the readability of the check block, the data of the data block of the first disk can be read, thereby avoiding the problem that in a disk failure scenario, other controllers mark faulty blocks or bad blocks due to the unavailability of the check block, resulting in the data in the data block corresponding to the check block not being read, thereby improving the efficiency and accuracy of reading data from the storage system, thereby improving the efficiency and accuracy of global deduplication, and ensuring the performance and reliability of the entire storage system.
[0012] In an optional implementation, the method further includes: if the first disk status indicates that a data block of the first disk is faulty, determining and recording that the first disk cannot perform data reconstruction.
[0013] In an embodiment of the present invention, when there is a fault in the first check block of the first disk and a fault in the first data block, it can be determined and recorded that the first disk cannot reconstruct data, thereby avoiding a scenario in which the first controller subsequently attempts to reconstruct data on the first disk, thereby improving the performance of the storage system.
[0014] In an optional embodiment, the method further includes: if the target stripe is managed by the first controller, obtaining at least one disk status, each disk status is used to indicate whether there is a fault in the data blocks of each disk; if there is no fault in the data blocks of at least one disk and the target stripe is initialized, reading the target data from at least one disk and returning the target data to the host.
[0015] In an embodiment of the present invention, when the target stripe is managed by the first controller, at least one disk corresponding to the target stripe has no faults, and the target stripe has completed initialization, the target data can be directly read and returned to the host, so that the host can perform global deduplication based on the read target data.
[0016] In an optional embodiment, the method further includes: if the target stripe is not managed by the first controller, obtaining reconstruction metadata corresponding to the target controller from the shared memory, the reconstruction metadata being used to indicate whether the target stripe has completed data reconstruction; when the reconstruction metadata indicates that the target stripe has completed data reconstruction, reading the target data from at least one disk and returning the target data to the host.
[0017] In an implementation manner of the present invention, the reconstruction metadata of the target controller can be obtained from the shared memory; then, it can be determined whether the target stripe has completed data reconstruction, and after the target stripe has completed data reconstruction, the target data can be read from at least one disk corresponding to the target stripe. Therefore, in a data reconstruction scenario, it can be avoided that when reading data from the stripe where the data to be read is located, conflicts occur while other controllers are performing data reconstruction processing on the stripe, thereby improving the efficiency and accuracy of reading data from the storage system, thereby improving the efficiency and accuracy of global deduplication, and ensuring the performance and reliability of the entire storage system.
[0018] In an optional embodiment, the method further includes: when the reconstruction metadata indicates that the target stripe has not completed data reconstruction, obtaining a second disk status of a second disk that has not completed data reconstruction, the second disk status being used to indicate whether there is a fault in a data block of the second disk; if the second disk status indicates that there is no fault in a data block of the second disk, reading the target data from at least one disk and returning the target data to the host; if the second disk status indicates that there is a fault in a data block of the second disk, reconstructing the data block of the second disk based on a check block of the second disk until the data reconstruction is completed, reading the target data from at least one disk, and returning the target data to the host.
[0019] In an implementation manner of the present invention, when the target stripe has not completed data reconstruction, it can be determined whether the data block of the second disk has a fault. Even if the data block of the second disk has a fault, the data block of the second disk can be reconstructed based on the check block of the second disk to read the target data. This avoids the problem that the data in the data block of the second disk is not read due to the fault of the data block of the second disk when the target stripe has not completed data reconstruction. This improves the efficiency and accuracy of reading data from the storage system, thereby improving the efficiency and accuracy of global deduplication, and ensuring the performance and reliability of the entire storage system.
[0020] In a second aspect, the present invention provides a controller, which includes: a transceiver module for receiving a read request sent from a host, the read request carrying a stripe identifier, the stripe identifier being used to indicate the stripe where the target data corresponding to the read request is located; a processing module for determining, based on the stripe identifier, whether the target stripe corresponding to the stripe identifier belongs to the management of a first controller; the transceiver module is also used to obtain initialization metadata corresponding to the target controller to which the target stripe belongs from a shared memory if not, the initialization metadata being used to indicate whether the target stripe has completed initialization; the processing module is also used to read the target data from at least one disk corresponding to the target stripe and return the target data to the host when the initialization metadata indicates that the target stripe has completed initialization.
[0021] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the data reading method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0022] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data reading method of the first aspect or any corresponding embodiment thereof.
[0023] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the data reading method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 is a schematic diagram of stripe locking in a storage system with four controllers according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of binding a controller and a stripe in a storage system according to an embodiment of the present invention;
[0027] Figure 3 is a topological diagram of a data reading system according to an embodiment of the present invention;
[0028] Figure 4is a flow chart of a data reading method according to an embodiment of the present invention;
[0029] Figure 5 is a structural block diagram of a controller according to an embodiment of the present invention;
[0030] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0032] The embodiment of the present invention is applied to the scenario where the host deduplicates data in the storage system. Data deduplication technology (ie, DDP technology) is a core technology that can reduce data storage space, especially in AFA storage systems with high storage space costs, DDP has become an essential feature.
[0033] Global deduplication at the storage system level is undoubtedly the basis for ensuring the deduplication rate, but global deduplication of the storage system needs to support data synchronization and mutual exclusion for concurrent access by each controller in the storage system, but metadata synchronization is a challenge for high-end storage because metadata synchronization between controllers will directly affect the performance of the storage system. In order to ensure the performance of the storage system and improve the efficiency of global deduplication, it is usually solved in the following two ways.
[0034] Method 1: If Figure 1 As shown, Figure 1 FIG. 1 is a schematic diagram of stripe locking in a storage system with four controllers according to an embodiment of the present invention; Figure 1 In the global deduplication scenario, when the controller processes stripe 1, it needs to notify the other three controllers of the message and obtain authorization from the other three controllers before processing IO. This prevents the mutual exclusion problem caused by multiple stripes processing one stripe at the same time. In this way, the controller has no binding relationship with the stripe, and each controller can process the stripe, so the problem that all four controllers can issue deduplication read requests can be solved. The disadvantage is that the four controllers are synchronously mutually exclusive, which has a large performance loss. In addition, the number and cycle of messages locked in a four-controller storage system or even an eight-controller storage system will be significantly lengthened in this way, which has a great impact on performance and is not scalable enough.
[0035] Method 2: If Figure 2 As shown, Figure 2 is a schematic diagram of binding a controller and a stripe in a storage system according to an embodiment of the present invention; Figure 2 In the example, controller 1 is bound to stripe 1, controller 2 is bound to stripe 2, controller 3 is bound to stripe 3, and controller 4 is bound to stripe. This method binds stripes to controllers, that is, one stripe is processed only on one controller, which completely avoids stripe locks between controllers. However, in the global deduplication scenario of four controllers, data needs to be read from all four controllers. Obviously, there is a natural conflict in supporting the access capabilities of four controllers under this mechanism, especially for verifying RAID (such as the common RAID5 and RAID6), which involves background tasks such as initialization and reconstruction. The mutual exclusion of read and write IO and the mutual exclusion of background tasks are also difficult to effectively solve the problem.
[0036] Both of the above methods cannot effectively resolve conflicts in read operations and metadata synchronization between controllers in the storage system, which leads to low efficiency and poor accuracy in reading data from the storage system in the global deduplication scenario, affecting the performance and reliability of the entire storage system.
[0037] In order to solve the above technical problems, an embodiment of the present invention provides a data reading method, which solves the conflict problem caused by global deduplication and data synchronization mutual exclusion between multiple controllers by adding shared memory, so as to improve the efficiency and accuracy of reading data from the storage system in the global deduplication scenario, thereby improving the efficiency and accuracy of global deduplication and ensuring the performance and reliability of the entire storage system.
[0038] Below Figure 3 Taking the data reading system 300 as an example, the method provided in the embodiment of the present application is described. Figure 3 It is only a schematic diagram and does not constitute a limitation on the applicable scenarios of the technical solution provided in this application.
[0039] like Figure 3 As shown, Figure 3 4 is a topological diagram of a data reading system according to an embodiment of the present invention. Figure 3 In the embodiment, the data reading system 300 may include a host 301 , a first controller 302 , a second controller 303 , a third controller 304 , a fourth controller 305 , a shared memory 306 , a first disk 307 , a second disk 308 , a third disk 309 and a fourth disk 310 .
[0040] The host 301 in the embodiment of the present invention may be any device with computing and communication capabilities, such as a server, a server or a virtual machine.
[0041] The first controller 302, the second controller 303, the third controller 304 or the fourth controller 305 in the embodiment of the present invention may be any controller in the storage system. Each controller manages at least one stripe; and the data of each stripe is distributed on at least one disk.
[0042] The shared memory 306 in the embodiment of the present invention can be any memory device that is visible and sharable to all controllers. For example, the shared memory 306 can be an open industrial standard for high-bandwidth, low-latency device interconnection cache consistency interconnect protocol (Compute Express Link Intel, CXL) memory. CXL memory can be used to connect devices such as central processing units and accelerators, memory buffers (Memory Buffer) and smart network cards (Smart NIC). CXL memory can increase the memory capacity and bandwidth of the server, and its latency is slightly higher than that of local memory. For all controllers, CXL memory is their own memory, but it is shared with other controllers. CXL memory serves as the upper-level cache of controller metadata and records the metadata of each controller.
[0043] The first disk 307, the second disk 308, the third disk 309 or the fourth disk 310 of the embodiment of the present invention may be any type of disk. The data stored in the first disk 307, the second disk 308, the third disk 309 and the fourth disk 310 constitute all the data corresponding to a stripe.
[0044] Figure 3 The data reading system 300 shown is only used as an example and is not used to limit the technical solution of the present application. Those skilled in the art should understand that in the specific implementation process, the data reading system 300 may also include other devices, and the number of controllers and disks may also be determined according to specific needs without limitation.
[0045] According to an embodiment of the present invention, a data reading method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0046] In this embodiment, a data reading method is provided, which can be used for the first controller mentioned above. Figure 4 is a flow chart of a data reading method according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0047] S401: receiving a read request sent from a host.
[0048] The read request carries a stripe identifier, which is used to indicate the stripe where the target data requested to be read corresponding to the read request is located.
[0049] Exemplarily, the host sends a read request to the first controller, and the first controller receives the read request.
[0050] S402: Determine, according to the stripe identifier, whether the target stripe corresponding to the stripe identifier is managed by the first controller.
[0051] The target stripe corresponds to at least one disk. Each disk includes a check block and a data block. The data block stores data. The check block stores check information for recovering the data stored in the data block.
[0052] In one example, after receiving a read request, the first controller determines a target stripe corresponding to the stripe identifier based on the stripe identifier carried in the read request; and determines whether the target stripe is managed by the first controller according to the target stripe and the corresponding relationship.
[0053] The corresponding relationship is a corresponding relationship between each controller and at least one stripe managed by each controller.
[0054] It can be understood that if the target stripe belongs to the first controller, the first controller can be called the owner node of the target stripe.
[0055] S403: If not, obtaining initialization metadata corresponding to the target controller to which the target stripe belongs from the shared memory.
[0056] S404: When the initialization metadata indicates that the target stripe has completed initialization, read the target data from at least one disk corresponding to the target stripe, and return the target data to the host.
[0057] The target controller is one of multiple controllers of the storage system.
[0058] In the embodiment of the present invention, the initialization metadata is used to indicate whether the target stripe has completed initialization.
[0059] It can be understood that, since the shared memory can be shared by all controllers, when the first controller is not the owner node corresponding to the target node, the initialization metadata of the target controller can also be obtained from the shared storage.
[0060] Optionally, if the target stripe is managed by the first controller, the first controller obtains the status of at least one disk; if there are no faults in the data blocks of at least one disk and the target stripe is initialized, the target data is read from at least one disk and returned to the host.
[0061] The status of each disk is used to indicate whether a data block of each disk is faulty.
[0062] In one example, before obtaining the initialization metadata corresponding to the target controller from the shared memory, the first controller obtains the check synchronization metadata corresponding to the target controller from the shared memory; if the check synchronization metadata indicates that the target stripe is not marked as having a problem with the readability of the check block, it is determined that all check blocks of at least one disk are not faulty.
[0063] The check synchronization metadata is used to indicate whether the target stripe is marked as having a problem with the readability of the check block.
[0064] It can be understood that the fact that all check blocks of at least one disk have no faults indicates that among all data blocks of at least one disk corresponding to the target stripe, even if there are faulty data blocks, data can be reconstructed through check blocks, and the faulty data blocks can be restored to normal data blocks, thereby reading the data.
[0065] In some optional embodiments, if the check synchronization metadata indicates that the target stripe is marked as having a problem with the readability of the check block, the first controller determines that a first disk exists in at least one disk; obtains the first disk status of the first disk; and if the first disk status indicates that there is no fault in the data block of the first disk, reads the target data from at least one disk.
[0066] The first check block of the first disk has a fault. The first disk status is used to indicate whether the data block of the first disk has a fault.
[0067] Optionally, if the first disk status indicates that a data block of the first disk is faulty, the first controller determines and records that the first disk cannot perform data reconstruction.
[0068] In addition to the initialization metadata and verification synchronization metadata of the target stripe, the shared memory also stores reconstruction metadata. The reconstruction metadata is used to indicate whether the target stripe has completed data reconstruction.
[0069] In some optional embodiments, if the target stripe is not managed by the first controller, the first controller obtains the reconstruction metadata corresponding to the target controller from the shared memory; when the reconstruction metadata indicates that the target stripe has completed data reconstruction, the target data is read from at least one disk and the target data is returned to the host.
[0070] It can be understood that the reconstruction metadata indicates that the target stripe has completed data reconstruction, indicating that except for the first controller, no other controller is performing data reconstruction on the target stripe, and therefore, no conflict between controllers will be caused.
[0071] In some optional embodiments, when the reconstruction metadata indicates that the target stripe has not completed data reconstruction, the second disk status of the second disk whose data reconstruction has not been completed is obtained; if the second disk status indicates that there is no fault in the data block of the second disk, the target data is read from at least one disk and the target data is returned to the host; if the second disk status indicates that there is a fault in the data block of the second disk, the data block of the second disk is reconstructed based on the check block of the second disk until the data reconstruction is completed, the target data is read from at least one disk, and the target data is returned to the host.
[0072] The second disk status is used to indicate whether a data block of the second disk is faulty.
[0073] It can be understood that even if there is a fault in the data block of the second disk, the data block of the second disk can be reconstructed based on the check block of the second disk, and then the target data can be read, thereby avoiding the problem that the data in the data block of the second disk is not read due to the fault in the data block of the second disk when the target stripe has not completed data reconstruction.
[0074] In some optional embodiments, when the first controller determines that the target stripe corresponding to the stripe identifier does not belong to the management of the first controller, it first obtains the verification synchronization metadata corresponding to the target controller from the shared memory; if the verification synchronization metadata indicates that the target stripe is not marked as a verification block and there is a readability problem, then the initialization metadata corresponding to the target controller to which the target stripe belongs is obtained from the shared memory; if the initialization metadata indicates that the target stripe has completed initialization, the reconstruction metadata corresponding to the target controller is obtained from the shared memory; when the reconstruction metadata indicates that the target stripe has completed data reconstruction, the target data is read from at least one disk and the target data is returned to the host. The target data is read from at least one disk corresponding to the target stripe of the host and the target data is returned to the host.
[0075] It can be understood that since the shared memory is the shared memory of all controllers, when the target stripe is not managed by the first controller, the first controller can obtain the check synchronization metadata, initialization metadata and reconstruction metadata of the target controller based on the shared memory; and then it can judge in turn whether the target stripe is marked as having a problem with the readability of the check block, whether the initialization is completed, and whether data reconstruction is in progress. Thus, it can avoid the problem that when reading data in the stripe where the data to be read is located, the data block corresponding to the check block of other controllers is not read due to the unavailability of the disk check block, the conflict that other controllers are initializing the stripe, and the conflict that other controllers are reconstructing the data on the stripe.
[0076] Based on the above Figure 4According to the method, when the first controller receives a read request sent from the host, it can determine whether the target stripe corresponding to the stripe identifier belongs to the management of the first controller based on the stripe identifier carried in the read request; and when the target stripe does not belong to the management of the first controller, obtain the initialization metadata corresponding to the target controller to which the target stripe belongs from the shared memory to determine whether the target stripe has completed initialization, and when the target stripe has completed initialization, read the target data from at least one disk corresponding to the target stripe and return it to the host.
[0077] Since the shared memory is shared by all controllers, after the first controller receives a read request and the target stripe is not managed by the first controller, it can obtain the initialization metadata of the target controller corresponding to the target stripe from the shared memory; then it can first determine whether the target stripe has been initialized, and after the target stripe has been initialized, it can read the target data from at least one disk corresponding to the target stripe. Therefore, it can avoid the conflict in the initialization scenario where the stripe where the data to be read is located is read while other controllers are initializing the stripe, thereby improving the efficiency and accuracy of reading data from the storage system, thereby improving the efficiency and accuracy of global deduplication, and ensuring the performance and reliability of the entire storage system.
[0078] In this embodiment, a controller is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0079] This embodiment provides a controller such as Figure 5 As shown, Figure 5 is a structural block diagram of a controller according to an embodiment of the present invention; the controller comprises:
[0080] The transceiver module 501 is used to receive a read request sent from a host. The read request carries a stripe identifier, and the stripe identifier is used to indicate the stripe where the target data requested to be read corresponding to the read request is located.
[0081] The processing module 502 is used to determine, according to the stripe identifier, whether the target stripe corresponding to the stripe identifier is managed by the first controller.
[0082] The transceiver module 501 is further used to obtain initialization metadata corresponding to the target controller to which the target stripe belongs from the shared memory if no, and the initialization metadata is used to indicate whether the target stripe has completed initialization.
[0083] The processing module 502 is further configured to read target data from at least one disk corresponding to the target stripe and return the target data to the host when the initialization metadata indicates that the target stripe has completed initialization.
[0084] In some optional embodiments, each disk includes a check block and a data block, the data block stores data, and the check block stores check information for recovering the data stored in the data block; before obtaining the initialization metadata corresponding to the target controller from the shared memory, the transceiver module 501 is also used to obtain the check synchronization metadata corresponding to the target controller from the shared memory, and the check synchronization metadata is used to indicate whether the target stripe is marked as having a problem with the readability of the check block; the processing module 502 is also used to determine that all check blocks of at least one disk are not faulty if the check synchronization metadata indicates that the target stripe is not marked as having a problem with the readability of the check block.
[0085] In some optional embodiments, the processing module 502 is also used to determine that a first disk exists in at least one disk and a first check block of the first disk has a fault if the check synchronization metadata indicates that the target stripe is marked as having a problem with the readability of the check block; the transceiver module 501 is also used to obtain a first disk status of the first disk, and the first disk status is used to indicate whether a data block of the first disk has a fault; the processing module 502 is also used to read target data from at least one disk if the first disk status indicates that the data block of the first disk has no fault.
[0086] In some optional implementations, the processing module 502 is further configured to determine and record that the first disk cannot perform data reconstruction if the first disk status indicates that a data block of the first disk is faulty.
[0087] In some optional embodiments, the transceiver module 501 is also used to obtain at least one disk status if the target stripe is managed by the first controller, and each disk status is used to indicate whether there is a fault in the data block of each disk; the processing module 502 is also used to read the target data from at least one disk and return the target data to the host if there is no fault in the data blocks of at least one disk and the target stripe is initialized.
[0088] In some optional embodiments, the transceiver module 501 is also used to obtain the reconstruction metadata corresponding to the target controller from the shared memory if the target stripe is not managed by the first controller, and the reconstruction metadata is used to indicate whether the target stripe has completed data reconstruction; the processing module 502 is also used to read the target data from at least one disk and return the target data to the host when the reconstruction metadata indicates that the target stripe has completed data reconstruction.
[0089] In some optional embodiments, the transceiver module 501 is also used to obtain the second disk status of the second disk that has not completed data reconstruction when the reconstruction metadata indicates that the target stripe has not completed data reconstruction, and the second disk status is used to indicate whether there is a fault in the data block of the second disk; the processing module 502 is also used to read the target data from at least one disk and return the target data to the host if the second disk status indicates that the data block of the second disk has no fault; the processing module 502 is also used to reconstruct the data block of the second disk based on the check block of the second disk until the data reconstruction is completed, read the target data from at least one disk, and return the target data to the host if the second disk status indicates that the data block of the second disk has a fault.
[0090] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0091] The controller in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0092] The embodiment of the present invention also provides a computer device having the above Figure 5 Controller shown.
[0093] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0094] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0095] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0096] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0097] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0098] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0099] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0100] Part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0101] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A data reading method, characterized in that: Applied to a first controller; the method comprises: Receive a read request sent from a host, the read request carrying a stripe identifier, the stripe identifier being used to indicate a stripe where target data requested to be read corresponding to the read request is located; Determining, according to the stripe identifier, whether the target stripe corresponding to the stripe identifier belongs to management of the first controller; If not, obtaining initialization metadata corresponding to the target controller to which the target stripe belongs from the shared memory, wherein the initialization metadata is used to indicate whether the target stripe has completed initialization; In a case where the initialization metadata indicates that the target stripe has completed initialization, the target data is read from at least one disk corresponding to the target stripe, and the target data is returned to the host.
2. The method according to claim 1, characterized in that Each of the disks includes a check block and a data block, wherein the data block stores data and the check block stores check information for recovering the data stored in the data block; Before acquiring the initialization metadata corresponding to the target controller from the shared memory, the method further includes: Acquire the check synchronization metadata corresponding to the target controller from the shared memory, where the check synchronization metadata is used to indicate whether the target stripe is marked as having a check block readability problem; If the parity synchronization metadata indicates that the target stripe is not marked as having a problem with the parity block readability, it is determined that all parity blocks of the at least one disk are not faulty.
3. The method according to claim 2, characterized in that The method further comprises: If the check synchronization metadata indicates that the target stripe is marked as having a problem with the check block readability, determining that a first disk exists in the at least one disk, and a first check block of the first disk has a fault; Acquire a first disk status of the first disk, where the first disk status is used to indicate whether a data block of the first disk is faulty; If the first disk status indicates that there is no failure in the data block of the first disk, the target data is read from the at least one disk.
4. The method according to claim 3, characterized in that The method further comprises: If the first disk status indicates that a data block of the first disk is faulty, it is determined and recorded that the first disk cannot perform data reconstruction.
5. The method according to claim 1, characterized in that: The method further comprises: If the target stripe is managed by the first controller, obtaining at least one disk status, each of which is used to indicate whether a data block of each disk is faulty; If no data blocks of the at least one disk are faulty and the target stripe has been initialized, the target data is read from the at least one disk and returned to the host.
6. The method according to claim 1, characterized in that The method further comprises: If the target stripe is not managed by the first controller, obtaining reconstruction metadata corresponding to the target controller from the shared memory, where the reconstruction metadata is used to indicate whether data reconstruction of the target stripe is completed; In a case where the reconstruction metadata indicates that the target stripe completes the data reconstruction, the target data is read from the at least one disk and returned to the host.
7. The method according to claim 6, characterized in that The method further comprises: When the reconstruction metadata indicates that the target stripe has not completed the data reconstruction, obtaining a second disk status of the second disk that has not completed the data reconstruction, where the second disk status is used to indicate whether a data block of the second disk has a fault; If the second disk status indicates that the data block of the second disk does not have a fault, reading the target data from the at least one disk and returning the target data to the host; If the status of the second disk indicates that there is a fault in the data block of the second disk, reconstruct the data block of the second disk based on the check block of the second disk until the data reconstruction is completed, read the target data from the at least one disk, and return the target data to the host.
8. A controller, characterized in that: The controller comprises: A transceiver module, used for receiving a read request sent from a host, wherein the read request carries a stripe identifier, and the stripe identifier is used for indicating a stripe where target data requested to be read corresponding to the read request is located; A processing module, configured to determine, according to the stripe identifier, whether a target stripe corresponding to the stripe identifier belongs to management of the controller; The transceiver module is further used to obtain initialization metadata corresponding to the target controller to which the target stripe belongs from the shared memory if no, the initialization metadata is used to indicate whether the target stripe has completed initialization; The processing module is further configured to read the target data from at least one disk corresponding to the target stripe and return the target data to the host when the initialization metadata indicates that the target stripe has completed initialization.
9. A computer device, characterized in that: include: 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 data reading method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the data reading method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data processing method, independent hard disk redundant array controller and data storage system
CN111625181A
Method, device and equipment for recovering metadata by RAID (Redundant Array of Independent Disk) controller and medium
CN115543692A
Data request system, method and device, computer equipment and storage medium
CN116737619A
Write vulnerability processing method, electronic equipment and storage medium
CN117744086A
Data writing method, device and equipment for redundant disk array
CN118585138A