Multi-controller data writing method and device, electronic equipment and storage medium

Through the memory consistency interconnection between multiple storage controllers, the stripe lock mechanism in RAID is banned and data operations are directly carried out through interconnected memory, which solves the problem of cumbersome IO mutual exclusion between multiple controllers, and significantly reduces the writing of IO processing. Delay improves data writing efficiency.

CN119473126AActive Publication Date: 2025-02-18INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202411170672.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2025-02-18
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

The existing RAID technology has cumbersome steps in writing IO mutex processing between multiple controllers, resulting in a significant increase in the time-consuming process of writing IO and reducing the efficiency of writing data.

Method used

Through memory consistency interconnection between multiple storage controllers, memory resource sharing between storage controllers is realized, stripe lock mechanism is eliminated, data operations are directly carried out through interconnected memory, and processing delays for writing IO are reduced.

Benefits of technology

It effectively reduces the processing delay of IO writing, improves data writing efficiency, and improves IOPS performance of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473126A_ABST
    Figure CN119473126A_ABST
Patent Text Reader

Abstract

The invention provides a multi-controller data writing method and device, electronic equipment and a storage medium, and the method comprises the steps: receiving a data writing request, and determining to-be-written data corresponding to the data writing request and a target data strip in which the to-be-written data is to be written into an RAID (Redundant Array of Independent Disks); accessing metadata in the associated memory, and determining a target value of a bit corresponding to a target data strip in the metadata; and based on the target numerical value, determining whether the target data stripe is occupied, and determining whether to execute a data writing operation corresponding to the to-be-written data. The memory resource sharing among the memory controllers is realized through the memory consistency interconnection among the plurality of memory controllers, and the plurality of memory controllers are directly associated together through the interconnection memory, so that the serial connection of the physical level is realized. According to the technical scheme, the mode that the multiple storage controllers jointly operate the same part of metadata in the interconnected memory is adopted, a stripe lock mechanism is cancelled, the IO writing processing time delay is reduced, and the data writing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of servers, and in particular to a method, device, electronic equipment and storage medium for writing data of multiple controllers. Background Art

[0002] In order to improve the stability and reliability of the storage system and avoid the inability of customers to access data after a storage controller fails, storage controllers are usually deployed in pairs to form a system. The more storage controllers there are, the more complex the storage system becomes. This is mainly reflected in the data backup and access mutual exclusion between multiple controllers by each module in the storage system. The mutual exclusion problem of write input / output (IO) between multiple controllers in Redundant Array of Independent Disks (RAID) is mainly solved by adding stripe locks in message communication between nodes.

[0003] The existing RAID has complicated steps to realize mutual exclusion of write IO between multiple controllers. Processing one write IO requires multiple message communications between controllers, which significantly increases the time consumption of write IO processing and leads to low efficiency of writing data. Summary of the invention

[0004] The present invention provides a multi-controller data writing method, device, electronic device and storage medium, which are used to solve the defect of low data writing efficiency in the prior art, reduce the processing delay of writing IO, and improve the data writing efficiency.

[0005] The present invention provides a multi-controller data writing method, comprising the following steps: Receive a write data request, and determine the to-be-written data corresponding to the write data request and a target data stripe in a redundant array of independent disks RAID of a storage system where the to-be-written data is to be written; Accessing metadata in an associated memory to determine a target value of a bit corresponding to a target data stripe in the metadata, wherein the associated memory is a memory space in a memory resource device, the memory resource device is connected to a plurality of storage controllers in the storage system, the metadata in the memory space includes a plurality of bits, the value of each bit corresponds to an occupancy status of each data stripe of a RAID in the storage system, and the occupancy status of the data stripe is determined based on a change in the value of a bit in the metadata by the storage controller; Based on the target value, it is determined whether the target data stripe is occupied, and based on whether the target data stripe is occupied, it is determined whether to execute a data write operation corresponding to the data to be written.

[0006] According to a multi-controller data writing method provided by the present invention, the method determines whether the target data stripe is occupied based on the target value, and determines whether to execute the data writing operation corresponding to the data to be written based on whether the target data stripe is occupied, including: When it is determined that the target value is 1, determining that the occupation state of the target data stripe is occupied; When it is determined that the target value is 0, determining that the occupation state of the target data stripe is not occupied; In the case where it is determined that the target data stripe is occupied, suspending the processing of the write data operation of the data to be written in the write data request, and cyclically checking the bit corresponding to the target data stripe in the metadata at intervals of a preset time period, until it is determined that the bit corresponding to the target data stripe is 0, determining that the target data stripe is not occupied, setting the bit corresponding to the target data stripe to 1, and executing the write data operation of the data to be written; When it is determined that the target data stripe is not occupied, the corresponding bit of the target data stripe is set to 1, and a data write operation of the data to be written is performed.

[0007] According to a multi-controller data writing method provided by the present invention, after executing the data writing operation of the data to be written, the method further comprises: The data to be written is written into the associated memory, so that when the data is written next time, the data to be written is obtained from the associated memory, and based on the data to be written and the next write data, the check block is updated, and the obtained check block and the next write data are written into the data stripe in the storage system.

[0008] According to a multi-controller data writing method provided by the present invention, before accessing metadata in the associated memory, the method further includes: At intervals of the operation cycle, the access status of the associated memory is determined, and based on the access status of the associated memory, the RAID status is adjusted.

[0009] According to a multi-controller data writing method provided by the present invention, the adjustment of the RAID state based on the access state of the associated memory includes: In the case where the associated memory is inaccessible, setting the RAID to an offline state; In case the associated memory is accessible, the RAID is set to an online state.

[0010] According to a multi-controller data writing method provided by the present invention, the memory resource device is arranged in the storage system.

[0011] According to a multi-controller data writing method provided by the present invention, multiple storage controllers in the storage system are connected to the memory resource device based on a standard interconnection protocol CXL protocol.

[0012] The present invention also provides a multi-controller data writing device, comprising the following modules: A receiving module, configured to receive a write data request, and determine the to-be-written data corresponding to the write data request and a target data stripe in a redundant array of independent disks RAID of a storage system into which the to-be-written data is to be written; A query module is used to access metadata in an associated memory to determine a target value of a bit corresponding to a target data stripe in the metadata, wherein the associated memory is a memory space in a memory resource device, the memory resource device is connected to a plurality of storage controllers in the storage system, the metadata in the memory space includes a plurality of bits, the value of each bit corresponds to an occupancy status of each data stripe of a RAID in the storage system, and the occupancy status of the data stripe is determined based on a change in the value of a bit in the metadata by the storage controller; The judgment module is used to determine whether the target data stripe is occupied based on the target value, and determine whether to execute the data write operation corresponding to the data to be written based on whether the target data stripe is occupied.

[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for writing data of the multi-controller described above is implemented.

[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for writing data of multiple controllers as described above is implemented.

[0015] The multi-controller data writing method, device, electronic device and storage medium provided by the present invention realize memory resource sharing among storage controllers through memory consistency interconnection among multiple storage controllers, directly associate multiple storage controllers together through interconnected memory, and realize physical level series connection. By using the method in which multiple storage controllers jointly operate the same metadata in the interconnected memory, the stripe lock mechanism is abolished, the processing delay of writing IO is reduced, and the efficiency of writing data is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 It is a schematic diagram of a mutual exclusion flow of write IO between RAID controllers provided by a related method.

[0018] Figure 2 It is a flow chart of the multi-controller data writing method provided by the present invention.

[0019] Figure 3 It is a schematic diagram of the memory interconnection structure of multiple storage controllers provided by the present invention.

[0020] Figure 4 It is a schematic diagram of the online status flow of the associated memory controlling RAID provided by the present invention.

[0021] Figure 5 It is a flow chart of a method for writing data using multiple controllers provided by the present invention.

[0022] Figure 6 It is a schematic diagram of the structure of the data writing device of multiple controllers provided by the present invention.

[0023] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] In order to improve the stability and reliability of the storage system and avoid customers being unable to access data after a storage controller fails, storage controllers are usually deployed in pairs to form a system. A storage system can have one to four pairs of storage controllers. When a storage controller fails, its redundant controller as a backup can take over the failed controller to continue processing IO, thereby effectively avoiding user business interruption.

[0026] Therefore, if we only consider the stability and reliability of the system, the more storage controllers there are, the stronger the storage system's ability to bear controller failures. However, the more storage controllers there are, the more complex the storage system becomes. This is mainly reflected in the data backup and access mutual exclusion between multiple controllers in the storage system. As the core module of the storage system, RAID's basic requirement is to ensure the correct processing of IO. When the number of storage controllers in the storage system increases, the first problem that RAID needs to solve is the mutual exclusion of write IO between controllers.

[0027] Write IO mutual exclusion between controllers means that when multiple controllers write IO to the same strip of the same RAID at the same time, one controller needs to process the write IO before other controllers can process the write IO of the strip. Different controllers cannot process write IO to the same strip at the same time. This is mainly determined by the mechanism of RAID processing write IO. When RAID processes write IO, it needs to read the old IO data from the disk, and then perform XOR calculation with the new IO data to obtain the new data for writing to the disk. If different controllers process write IO to the same RAID strip at the same time, the controller will not be able to obtain the write IO data being processed by other controllers, causing data errors. Therefore, how to solve the write IO mutual exclusion between multiple controllers is an issue that RAID must consider.

[0028] Related methods aim to solve the write IO mutual exclusion problem between multiple controllers in RAID, mainly by adding stripe locks through message communication between nodes. RAID locks the stripe by requesting the stripe lock, indicating that the stripe has a controller processing the write IO, and other controllers need to wait until the stripe lock is released before reapplying, thus achieving write IO mutual exclusion between multiple controllers.

[0029] like Figure 1 The flowchart of the mutual exclusion of write IO between controllers in RAID implementation provided by the related method is shown as follows. After controller 1 receives the write IO, it will first send a stripe lock request to controller 2 before starting to process the write IO. If controller 2 is not processing the write IO of the stripe, it will reply to agree to the lock request; otherwise, controller 2 needs to wait until the write IO processing on the stripe is completed before replying to agree to the lock request. After controller 1 receives the lock message reply from controller 2, it starts to process the write IO and writes the calculated data block content and check block content to the disk. When the write data is completed, controller 1 needs to send a message to notify controller 2 to release the stripe lock. After controller 2 receives the notification of the lock release message, it releases the stripe lock and replies to controller 1 at the same time. After controller 1 receives the lock release reply, it completes the IO processing and returns the processing result to the upper layer.

[0030] The shortcomings of the related methods are: The steps for implementing write IO mutual exclusion between multiple controllers in RAID are cumbersome. Processing one write IO requires four messages between controllers, which significantly increases the time spent on write IO processing. Comparing the write IO processing performance with and without stripe locks, the implementation with stripe locks results in a performance loss of about 20%, which undoubtedly greatly reduces the IOPS (Input / Output Operations Per Second) performance of the storage system and seriously affects the user experience. As a result, the time spent on write IO processing increases significantly, resulting in low efficiency in writing data.

[0031] In view of the defects in the related methods, the present invention provides a method for writing data of multiple controllers. Figure 2 is a flow chart of a method for writing data by multiple controllers provided by the present invention, such as Figure 2 As shown, the method includes the following: Step 210, receiving a write data request, and determining the to-be-written data corresponding to the write data request and the target data stripe in the redundant array of independent disks RAID of the storage system into which the to-be-written data is to be written; Step 220: access metadata in an associated memory to determine a target value of a bit corresponding to a target data stripe in the metadata, wherein the associated memory is a memory space in a memory resource device, wherein the memory resource device is connected to a plurality of storage controllers in the storage system, wherein the metadata in the memory space includes a plurality of bits, wherein the value of each bit corresponds to an occupation state of each data stripe of a RAID in the storage system, wherein the occupation state of the data stripe is determined based on a change in the value of a bit in the metadata by the storage controller; Step 230: Determine whether the target data stripe is occupied based on the target value, and determine whether to execute a data write operation corresponding to the data to be written based on whether the target data stripe is occupied.

[0032] The following takes the storage controller in the storage system executing the multi-controller data writing method provided by the present invention as an example to describe the technical solution of the present invention in detail.

[0033] In step 210, the storage controller receives a write data request, wherein the write data request is a request to write the data to be written into a target data stripe in the RAID of the storage system.

[0034] The storage controller analyzes the write data request to determine the to-be-written data corresponding to the write data request and the target data stripe in the RAID of the storage system where the to-be-written data is to be stored.

[0035] Among them, data striping in RAID is a data storage technology that divides continuous data into data blocks of the same size (also called stripes) and writes these data blocks to different disks in the array. This technology aims to improve data access speed and I / O performance by dispersing the storage location of data.

[0036] The target data stripe is one of multiple data stripes in the RAID.

[0037] In step 220, metadata in the associated memory is accessed to determine a target value of a bit corresponding to the target data stripe in the metadata.

[0038] A memory resource device may be added in advance to the storage system, and the memory resource device is connected to multiple storage controllers in the storage system.

[0039] Specifically, Figure 3 The memory interconnection structure diagram of multiple storage controllers provided by the present invention is shown as follows. Multiple storage controllers of a storage system can be connected to the same memory resource device through the CXL protocol to connect multiple storage controllers to the interconnected memory of the memory resource device, thereby realizing memory resource sharing between storage controllers.

[0040] In the associated memory of the memory resource device, a metadata is pre-built. The metadata includes multiple bits, and the initial value of each bit is set to 0. Among them, the value of each bit of the metadata corresponds to the occupancy status of each data stripe of the RAID in the storage system. That is, the value of each bit in the metadata reflects the occupancy status of the corresponding data stripe in the RAID.

[0041] When a storage system contains multiple storage controllers, there is usually a configuration node, which is the master node. When creating a RAID, the configuration node applies for metadata on the interconnected memory resource device and initializes all bits in the metadata to 0. The role of metadata is to mark whether each stripe of the RAID is processing write IO. A bit value of 0 indicates that the stripe is not currently processing write IO, and a bit value of 1 indicates that the stripe is currently processing write IO.

[0042] After the RAID is created, all storage controllers on the storage system can operate the corresponding write IO mutual exclusion metadata according to the RAID ID.

[0043] The target data stripe is read from the metadata in the associated memory to obtain the target value. It can be understood that the target data stripe is the location where the data to be written corresponding to the write data request will be written, and the value of the bit corresponding to the target data stripe in the metadata reflects the occupancy status of the target data stripe.

[0044] Whether the data to be written can be written into the target data stripe may be determined based on the occupancy status of the target data stripe.

[0045] In step 230 , based on the target value obtained in step 220 , it is determined whether the target data stripe is occupied.

[0046] Specifically, when the obtained target value is 0, it can be determined that the target data stripe is not occupied. When the obtained target value is 1, it can be determined that the target data stripe is occupied.

[0047] Based on whether the target data stripe is occupied, it can be determined whether to execute a data write operation corresponding to the data to be written.

[0048] It can be understood that if it is determined that the target data stripe is not occupied, the write data operation corresponding to the data to be written can be executed; if it is determined that the target data stripe is occupied, the write data operation corresponding to the data to be written is suspended, and the write data operation corresponding to the data to be written is executed again after it is determined that the target data stripe is not occupied.

[0049] It is understandable that the memory consistency interconnection between multiple storage controllers can not only eliminate the RAID stripe lock mechanism and improve the processing performance of write IO, but also have a positive impact on the message communication and data backup between the nodes of each module in the entire storage system. For example, the mirror backup of the data cache between nodes is no longer transmitted through message communication, but only needs to be saved on the device of the interconnected memory, and multiple nodes can achieve sharing; for example, the metadata of the thin volume no longer needs to be synchronized between nodes, and only a copy of the metadata needs to be maintained on the interconnected memory.

[0050] By interconnecting multiple controllers with consistent memory, and taking advantage of the fast memory access speed and low latency, we can eliminate message communication between nodes, eliminate the existing stripe lock mechanism, effectively reduce the processing latency of write IO, and improve the IOPS performance of the storage system by more than 20%, thereby effectively ensuring the user experience and enhancing the core competitiveness of the data center.

[0051] The multi-controller data writing method provided by the present invention realizes memory resource sharing among storage controllers through memory consistency interconnection among multiple storage controllers, directly associates multiple storage controllers together through interconnected memory, and realizes physical level serial connection. By using the method in which multiple storage controllers jointly operate the same metadata in the interconnected memory, the stripe lock mechanism is abolished, the processing delay of writing IO is reduced, and the writing data efficiency is improved.

[0052] In one embodiment, based on the target value, it is determined whether the target data stripe is occupied, and based on whether the target data stripe is occupied, it is determined whether to execute the write data operation corresponding to the data to be written, including: when it is determined that the target value is 1, the occupancy state of the target data stripe is determined to be occupied; when it is determined that the target value is 0, the occupancy state of the target data stripe is determined to be not occupied; when it is determined that the target data stripe is occupied, suspending the processing of the write data operation of the data to be written in the write data request, and checking the corresponding bit of the target data stripe in the metadata in a loop at intervals of a preset time period until it is determined that the corresponding bit of the target data stripe is 0, determining that the target data stripe is not occupied, setting the corresponding bit of the target data stripe to 1, and executing the write data operation of the data to be written; when it is determined that the target data stripe is not occupied, setting the corresponding bit of the target data stripe to 1, and executing the write data operation of the data to be written.

[0053] The metadata is used to mark whether each stripe of the RAID is processing write IO. A bit value of 0 indicates that the stripe is not currently processing write IO, and a bit value of 1 indicates that the stripe is currently processing write IO.

[0054] When the obtained target value is 0, it can be determined that the target data stripe is not occupied. When the obtained target value is 1, it can be determined that the target data stripe is occupied.

[0055] When it is determined that the target data stripe is not occupied, a data write operation of the data to be written may be performed, and a bit corresponding to the target data stripe may be set to 1 to prevent other storage controllers from performing a data write operation on the target data stripe.

[0056] When it is determined that the target data stripe is occupied, in order to avoid data write mutual exclusion, the data write operation of the data to be written can be started only after the occupation of the target data stripe is released.

[0057] Based on the preset time interval, the corresponding bit of the target data stripe in the metadata is accessed regularly to check whether the value of the corresponding bit of the target data stripe becomes 0. That is, by checking whether the corresponding bit of the target data stripe becomes 0, it is determined whether the occupied state of the target data stripe is changed to the unoccupied state.

[0058] When it is determined that the target data stripe is not occupied, a data write operation of the data to be written may be performed, and a bit corresponding to the target data stripe may be set to 1 to prevent other storage controllers from performing a data write operation on the target data stripe.

[0059] In one embodiment, after executing the data write operation of the data to be written, it also includes: writing the data to be written into the associated memory, so that when the data is written next time, the data to be written is obtained from the associated memory, and based on the data to be written and the next write data, the check block is updated, and the obtained check block and the next write data are written into the data stripe in the storage system.

[0060] When RAID processes write IO, it needs to read the old data from the disk, and then perform XOR calculation with the new data to obtain the data that will eventually be written to the disk. After the introduction of interconnected memory, cache data can be generated in the interconnected memory to reduce the number of disk reads and speed up IO processing efficiency. Therefore, before reading old data from the disk, RAID first searches the interconnected memory to see if there is cached data for the stripe. If there is cached data, it will be used directly without reading the disk again. If the cached data of the stripe cannot be found in the interconnected memory, the old data will be read from the disk, and after successful reading, it will be stored in the interconnected memory so that it can continue to be used by subsequent write IOs that hit the stripe.

[0061] Specifically, when writing data for the first time, the data is written into the associated memory for storage. In the subsequent second data writing process, the pre-stored data to be written can be directly obtained from the interconnected memory, and the check block is updated based on the data to be written and the next write data, and the obtained check block and the next write data are written into the data stripe of the storage system to implement the data writing process of the next write data.

[0062] In one embodiment, before accessing the metadata in the associated memory, the method further includes: At intervals of the operation cycle, determining the access status of the associated memory, and adjusting the RAID status based on the access status of the associated memory; In the case where the associated memory is inaccessible, setting the RAID to an offline state; In case the associated memory is accessible, the RAID is set to an online state.

[0063] Specifically, Figure 4 As shown in the flowchart of the online state of the associated memory control RAID provided by the present invention, a timer can be started on each RAID module on each storage controller of the storage system, with an operation cycle of 30 seconds, and an attempt is made to read the associated memory every 30 seconds. If the reading is successful, it means that the associated memory can be accessed; if the reading fails, it means that the associated memory is abnormal and can no longer process IO.

[0064] When the RAID is in the online state, if the timer detects that the associated memory is inaccessible, the RAID is switched offline and IO processing is stopped; when the RAID is in the offline state because the interconnected memory is inaccessible, if the timer detects that the interconnected memory can be accessed normally, the RAID is switched to the online state and starts processing IO.

[0065] If the read-write interconnect memory fails during the process of processing write IO, the RAID is switched offline to stop processing write IO, and the write IO being processed is returned with the failure reason that the RAID offline cannot process.

[0066] Optionally, if the associated memory is detected to be inaccessible and this affects the normal operation of the RAID array, the RAID array can be set to an offline state through the RAID configuration interface or management software. This usually involves selecting the specific RAID array and then performing an operation to put the array offline.

[0067] Specifically, it can be based on writing automated scripts that can perform predefined actions when specific conditions are met, including setting the RAID to an offline state. Write logic in the script to connect to the RAID controller or storage system and execute commands or API calls to set the RAID array to an offline state.

[0068] When the associated memory regains accessibility, and it is confirmed that the RAID array can be safely brought back online, a similar procedure can be used to bring the RAID array back online. This may include performing some additional checks (such as a hard drive consistency check) and confirming the operation.

[0069] In one embodiment, the memory resource device is arranged in the storage system, and a plurality of storage controllers in the storage system are connected to the memory resource device based on a standard interconnection protocol CXL protocol.

[0070] The Compute Express Link (CXL) protocol is an open industry-standard interconnect protocol designed to enhance communication capabilities. It supports high-performance computing and memory-intensive workloads in next-generation data centers by providing high-bandwidth, low-latency connections.

[0071] The configuration of memory resource devices in the storage system and the connection of multiple storage controllers to these memory resource devices based on the CXL protocol can improve the performance, reliability and scalability of the storage system. These goals can be achieved by implementing memory consistency interconnection between multiple storage controllers.

[0072] It is understandable that setting up a memory resource device in the storage inhalation can avoid the use of network cables or other connection devices, realize the connection between the memory resource device and the storage controller, and enable the storage controller to quickly access the interconnected memory of the memory resource device, thereby reducing access delay and improving access efficiency.

[0073] The present invention also provides a flow chart of a method for writing data using multiple controllers provided by the present invention, such as Figure 5 As shown, specifically including: After receiving a write IO request, RAID will request the tag metadata from the interconnect memory; After receiving the call, the interconnect memory reads the BIT value of the corresponding stripe and checks whether the BIT value of the stripe is 0. If the BIT value is 0, it means that no write IO is processing the stripe, and a success is returned; if the BIT value is 1, it means that a write IO is processing the stripe, and a failure is returned.

[0074] After RAID receives the failed marking metadata, it continues to initiate requests until the marking is successful before it can continue to process the write IO; after RAID receives the successful marking metadata, it directly starts processing the write IO.

[0075] When RAID processes write IO, it needs to read the old data from the disk, and then perform XOR calculation with the new data to obtain the data that will eventually be written to the disk. After the introduction of interconnected memory, cache data can be generated in the interconnected memory to reduce the number of disk reads and speed up IO processing efficiency. Therefore, before reading old data from the disk, RAID first searches the interconnected memory to see if there is cached data for the stripe. If there is cached data, it will be used directly without reading the disk again. If the cached data of the stripe cannot be found in the interconnected memory, the old data will be read from the disk, and after successful reading, it will be stored in the interconnected memory so that it can continue to be used by subsequent write IOs that hit the stripe.

[0076] After calculating the data that needs to be written to disk, the data is written to disk and updated to the interconnect memory at the same time, so that subsequent write IOs that hit the stripe can continue to use it.

[0077] After the write IO data is written to the disk, the interconnect memory will be requested to release the metadata so that subsequent write IOs can continue to process the stripe.

[0078] The data writing device of the multi-controller provided by the present invention is described below. The data writing device of the multi-controller described below and the data writing method of the multi-controller described above can be referred to each other.

[0079] like Figure 6 As shown, the device comprises: The receiving module 610 is used to receive a write data request, and determine the to-be-written data corresponding to the write data request and the target data stripe in the redundant array of independent disks RAID of the storage system where the to-be-written data is to be written; A query module 620 is used to access metadata in an associated memory to determine a target value of a bit corresponding to a target data stripe in the metadata, wherein the associated memory is a memory space in a memory resource device, wherein the memory resource device is connected to a plurality of storage controllers in the storage system, wherein the metadata in the memory space includes a plurality of bits, wherein the value of each bit corresponds to an occupancy status of each data stripe of a RAID in the storage system, wherein the occupancy status of the data stripe is determined based on a change in the value of a bit in the metadata by the storage controller; The judgment module 630 is used to determine whether the target data stripe is occupied based on the target value, and determine whether to execute the data write operation corresponding to the data to be written based on whether the target data stripe is occupied.

[0080] The multi-controller data writing device provided by the present invention realizes memory resource sharing among storage controllers through memory consistency interconnection among multiple storage controllers, directly associates multiple storage controllers together through interconnected memory, and realizes physical level serial connection. By using the method in which multiple storage controllers jointly operate the same metadata in the interconnected memory, the stripe lock mechanism is abolished, the processing delay of writing IO is reduced, and the writing data efficiency is improved.

[0081] In one embodiment, the determination module 630 is specifically used to: Determining whether the target data stripe is occupied based on the target value, and determining whether to perform a data write operation corresponding to the data to be written based on whether the target data stripe is occupied, including: When it is determined that the target value is 1, determining that the occupation state of the target data stripe is occupied; When it is determined that the target value is 0, determining that the occupation state of the target data stripe is not occupied; In the case where it is determined that the target data stripe is occupied, suspending the processing of the write data operation of the data to be written in the write data request, and cyclically checking the bit corresponding to the target data stripe in the metadata at intervals of a preset time period, until it is determined that the bit corresponding to the target data stripe is 0, determining that the target data stripe is not occupied, setting the bit corresponding to the target data stripe to 1, and executing the write data operation of the data to be written; When it is determined that the target data stripe is not occupied, the corresponding bit of the target data stripe is set to 1, and a data write operation of the data to be written is performed.

[0082] In one embodiment, the determination module 630 is further specifically configured to: After executing the data writing operation of the data to be written, the method further includes: The data to be written is written into the associated memory, so that when the data is written next time, the data to be written is obtained from the associated memory, and based on the data to be written and the next write data, the check block is updated, and the obtained check block and the next write data are written into the data stripe in the storage system.

[0083] In one embodiment, the query module 620 is specifically used to: Before accessing the metadata in the associated memory, also include: At intervals of the operation cycle, the access status of the associated memory is determined, and based on the access status of the associated memory, the RAID status is adjusted.

[0084] In one embodiment, the query module 620 is further specifically configured to: Based on the access state of the associated memory, performing adjustment on the RAID state includes: In the case where the associated memory is inaccessible, setting the RAID to an offline state; In case the associated memory is accessible, the RAID is set to an online state.

[0085] In one embodiment, the receiving module 610 is specifically configured to: A memory resource device is determined to be disposed in the storage system.

[0086] In one embodiment, the receiving module 610 is further specifically configured to: Multiple storage controllers in the storage system are connected to the memory resource device based on the standard interconnection protocol CXL protocol.

[0087] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute a multi-controller data writing method, the method comprising: receiving a write data request, and determining the data to be written corresponding to the write data request and the target data stripe in the independent disk redundant array RAID of the storage system where the data to be written is to be written; Accessing metadata in an associated memory to determine a target value of a bit corresponding to a target data stripe in the metadata, wherein the associated memory is a memory space in a memory resource device, the memory resource device is connected to a plurality of storage controllers in the storage system, the metadata in the memory space includes a plurality of bits, the value of each bit corresponds to an occupancy status of each data stripe of a RAID in the storage system, and the occupancy status of the data stripe is determined based on a change in the value of a bit in the metadata by the storage controller; Based on the target value, it is determined whether the target data stripe is occupied, and based on whether the target data stripe is occupied, it is determined whether to execute a data write operation corresponding to the data to be written.

[0088] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0089] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the multi-controller data writing method provided by the above methods, the method includes: receiving a write data request, and determining the to-be-written data corresponding to the write data request and the target data stripe in the independent disk redundant array RAID of the storage system where the to-be-written data is to be written; Accessing metadata in an associated memory to determine a target value of a bit corresponding to a target data stripe in the metadata, wherein the associated memory is a memory space in a memory resource device, the memory resource device is connected to a plurality of storage controllers in the storage system, the metadata in the memory space includes a plurality of bits, the value of each bit corresponds to an occupancy status of each data stripe of a RAID in the storage system, and the occupancy status of the data stripe is determined based on a change in the value of a bit in the metadata by the storage controller; Based on the target value, it is determined whether the target data stripe is occupied, and based on whether the target data stripe is occupied, it is determined whether to execute a data write operation corresponding to the data to be written.

[0090] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the multi-controller data writing method provided by the above methods, the method comprising: receiving a write data request, and determining the data to be written corresponding to the write data request and the target data stripe in the redundant array of independent disks RAID of the storage system where the data to be written is to be written; Accessing metadata in an associated memory to determine a target value of a bit corresponding to a target data stripe in the metadata, wherein the associated memory is a memory space in a memory resource device, the memory resource device is connected to a plurality of storage controllers in the storage system, the metadata in the memory space includes a plurality of bits, the value of each bit corresponds to an occupancy status of each data stripe of a RAID in the storage system, and the occupancy status of the data stripe is determined based on a change in the value of a bit in the metadata by the storage controller; Based on the target value, it is determined whether the target data stripe is occupied, and based on whether the target data stripe is occupied, it is determined whether to execute a data write operation corresponding to the data to be written.

[0091] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0092] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for writing data by multiple controllers, characterized in that: The method comprises: Receive a write data request, and determine the to-be-written data corresponding to the write data request and a target data stripe in a redundant array of independent disks RAID of a storage system where the to-be-written data is to be written; Accessing metadata in an associated memory to determine a target value of a bit corresponding to a target data stripe in the metadata, wherein the associated memory is a memory space in a memory resource device, the memory resource device is connected to a plurality of storage controllers in the storage system, the metadata in the memory space includes a plurality of bits, the value of each bit corresponds to an occupancy status of each data stripe of a RAID in the storage system, and the occupancy status of the data stripe is determined based on a change in the value of a bit in the metadata by the storage controller; Based on the target value, it is determined whether the target data stripe is occupied, and based on whether the target data stripe is occupied, it is determined whether to execute a data write operation corresponding to the data to be written.

2. The multi-controller data writing method according to claim 1, characterized in that: The determining, based on the target value, whether the target data stripe is occupied, and determining, based on whether the target data stripe is occupied, whether to perform a data write operation corresponding to the data to be written, includes: When it is determined that the target value is 1, determining that the occupation state of the target data stripe is occupied; When it is determined that the target value is 0, determining that the occupation state of the target data stripe is not occupied; In the case where it is determined that the target data stripe is occupied, suspending the processing of the write data operation of the data to be written in the write data request, and cyclically checking the bit corresponding to the target data stripe in the metadata at intervals of a preset time period, until it is determined that the bit corresponding to the target data stripe is 0, determining that the target data stripe is not occupied, setting the bit corresponding to the target data stripe to 1, and executing the write data operation of the data to be written; When it is determined that the target data stripe is not occupied, the corresponding bit of the target data stripe is set to 1, and a data write operation of the data to be written is performed.

3. The multi-controller data writing method according to claim 2, characterized in that: After executing the data writing operation of the data to be written, the method further includes: The data to be written is written into the associated memory, so that when the data is written next time, the data to be written is obtained from the associated memory, and based on the data to be written and the next write data, the check block is updated, and the obtained check block and the next write data are written into the data stripe in the storage system.

4. The multi-controller data writing method according to claim 1, characterized in that: Before accessing the metadata in the associated memory, the method further includes: At intervals of the operation cycle, the access status of the associated memory is determined, and based on the access status of the associated memory, the RAID status is adjusted.

5. The multi-controller data writing method according to claim 4, characterized in that: The adjusting of the RAID state based on the access state of the associated memory includes: In the case where the associated memory is inaccessible, setting the RAID to an offline state; In case the associated memory is accessible, the RAID is set to an online state.

6. The multi-controller data writing method according to claim 1, characterized in that: The memory resource device is arranged in the storage system.

7. The multi-controller data writing method according to claim 1, characterized in that: The multiple storage controllers in the storage system are connected to the memory resource device based on the standard interconnection protocol CXL protocol.

8. A data writing device for multiple controllers, characterized in that: include: A receiving module, configured to receive a write data request, and determine the to-be-written data corresponding to the write data request and a target data stripe in a redundant array of independent disks RAID of a storage system into which the to-be-written data is to be written; A query module is used to access metadata in an associated memory to determine a target value of a bit corresponding to a target data stripe in the metadata, wherein the associated memory is a memory space in a memory resource device, the memory resource device is connected to a plurality of storage controllers in the storage system, the metadata in the memory space includes a plurality of bits, the value of each bit corresponds to an occupancy status of each data stripe of a RAID in the storage system, and the occupancy status of the data stripe is determined based on a change in the value of a bit in the metadata by the storage controller; The judgment module is used to determine whether the target data stripe is occupied based on the target value, and determine whether to execute the data write operation corresponding to the data to be written based on whether the target data stripe is occupied.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the multi-controller data writing method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the multi-controller data writing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method for implementing mixed hierarchical array, the hierarchical array and storage system

    CN101458613A

  • Data processing method and device, data node and storage medium

    CN112214175A

  • Storage management method, device and computer program product

    CN114594900A

Cited By

  • Data writing method and electronic equipment

    CN120973316A