Multi-controller data writing method and device, electronic equipment and storage medium
By achieving memory consistency interconnection between multiple storage controllers, striping lock mechanisms are eliminated, and metadata in the interconnected memory is directly manipulated. This solves the write I/O mutual exclusion problem between multiple controllers, improving write data efficiency and storage system performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2024-08-23
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, the write I/O mutual exclusion process between multiple controllers is cumbersome, resulting in low data writing efficiency and a significant increase in write I/O processing time.
By achieving memory consistency interconnection among multiple storage controllers, memory resource sharing among storage controllers is realized, eliminating striping lock mechanisms, and metadata is directly operated through interconnected memory, avoiding message communication between nodes.
It reduces write I/O processing latency, improves write data efficiency, increases storage system IOPS performance by more than 20%, and enhances user experience.
Smart Images

Figure CN119473126B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of server technology, and in particular to a multi-controller data writing method, apparatus, electronic device, and storage medium. Background Technology
[0002] To improve system stability and reliability and prevent customer data inaccessibility in the event of a storage controller failure, storage systems typically deploy storage controllers in pairs. The more storage controllers there are, the more complex the storage system becomes, primarily due to the challenges of data backup and access exclusivity between the various modules. Redundant Array of Independent Disks (RAID) addresses the write input / output (IO) exclusivity issue between multiple controllers mainly by adding striped locks through inter-node message communication.
[0003] Existing RAID implementations involve cumbersome write I / O mutual exclusion steps between multiple controllers. Processing a single write I / O requires multiple message communications between controllers, which significantly increases the time consumed in write I / O processing and results in low data writing efficiency. Summary of the Invention
[0004] This invention provides a multi-controller data writing method, apparatus, electronic device, and storage medium to address the shortcomings of low data writing efficiency in the prior art, reduce write I / O processing latency, and improve data writing efficiency.
[0005] This invention provides a method for writing data to multiple controllers, comprising the following steps:
[0006] Receive a write data request and determine 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 to be written by the data to be written.
[0007] Access the metadata in the associated memory to determine the target value of the bit corresponding to the target data stripe in the metadata. The associated memory is the memory space in the memory resource device, which is connected to multiple storage controllers in the storage system. The metadata in the memory space includes multiple bits, and the value of each bit corresponds one-to-one with the occupancy status of each data stripe in the RAID of the storage system. The occupancy status of the data stripe is determined based on the storage controller changing the value of the bit in the metadata.
[0008] Based on the target value, determine whether the target data stripe is occupied, and based on whether the target data stripe is occupied, determine whether to execute the write data operation corresponding to the data to be written.
[0009] According to a multi-controller data writing method provided by the present invention, the step of determining whether the target data stripe is occupied based on the target value, and determining whether to execute the data writing operation corresponding to the data to be written based on whether the target data stripe is occupied, includes:
[0010] If the target value is determined to be 1, the occupancy status of the target data strip is determined to be occupied.
[0011] If the target value is determined to be 0, the occupancy status of the target data strip is determined to be unoccupied.
[0012] If it is determined that the target data stripe is occupied, the write data operation of the data to be written in the write data request is suspended, and the corresponding bit of the target data stripe in the metadata is checked in a loop at preset time intervals until it is determined that the target data stripe is not occupied when the corresponding bit of the target data stripe is 0. Then the corresponding bit of the target data stripe is set to 1, and the write data operation of the data to be written is executed.
[0013] If it is determined that the target data stripe is not occupied, the corresponding bit of the target data stripe is set to 1, and the write operation of the data to be written is performed.
[0014] According to a multi-controller data writing method provided by the present invention, after performing the data writing operation on the data to be written, the method further includes:
[0015] The data to be written is written to the associated memory so that during the next data write, the data to be written is retrieved from the associated memory, and the check block is updated based on the data to be written and the next write data. The obtained check block and the next write data are then written to the data stripe in the storage system.
[0016] According to a multi-controller data writing method provided by the present invention, before accessing the metadata in the associated memory, the method further includes:
[0017] During the interval operation period, the access status of the associated memory is determined, and based on the access status of the associated memory, the RAID status is adjusted.
[0018] According to a multi-controller data writing method provided by the present invention, the step of adjusting the RAID state based on the access state of the associated memory includes:
[0019] If the associated memory becomes inaccessible, the RAID will be set to offline status;
[0020] If the associated memory is accessible, set the RAID to online status.
[0021] According to a multi-controller data writing method provided by the present invention, the memory resource device is disposed in the storage system.
[0022] 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 the standard interconnect protocol CXL.
[0023] The present invention also provides a multi-controller data writing device, comprising the following modules:
[0024] The receiving module is used to receive write data requests and determine 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 to be written by the data to be written.
[0025] The query module is used to access metadata in associated memory and determine the target value of the corresponding bit in the target data stripe in the metadata. The associated memory is the memory space in the memory resource device, which is connected to multiple storage controllers in the storage system. The metadata in the memory space includes multiple bits, and the value of each bit corresponds one-to-one with the occupancy status of each data stripe in the RAID of the storage system. The occupancy status of the data stripe is determined based on the storage controller changing the value of the bit in the metadata.
[0026] The judgment module is used to determine whether the target data strip is occupied based on the target value, and to determine whether to execute the write data operation corresponding to the data to be written based on whether the target data strip is occupied.
[0027] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the multi-controller data writing method as described above.
[0028] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-controller data writing method as described above.
[0029] The multi-controller write data method, apparatus, electronic device, and storage medium provided by this invention achieve memory resource sharing among multiple storage controllers through memory consistency interconnection. This directly links multiple storage controllers together via interconnected memory, realizing physical-level serialization. By having multiple storage controllers jointly operate on the same metadata in the interconnected memory, the striped locking mechanism is eliminated, reducing write I / O processing latency and improving write data efficiency. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0031] Figure 1 This is a schematic diagram of the write I / O mutual exclusion process between controllers in RAID implementation provided by the relevant methods.
[0032] Figure 2 This is a flowchart illustrating the multi-controller data writing method provided by the present invention.
[0033] Figure 3 This is a schematic diagram of the memory interconnection structure of multiple storage controllers provided by the present invention.
[0034] Figure 4 This is a schematic diagram of the online status process of RAID with associated memory control provided by the present invention.
[0035] Figure 5 This is a flowchart illustrating the multi-controller data writing method provided by the present invention.
[0036] Figure 6 This is a schematic diagram of the structure of the multi-controller data writing device provided by the present invention.
[0037] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0039] To improve system stability and reliability and prevent customer data access loss in the event of a storage controller failure, storage systems typically deploy storage controllers in pairs. A storage system can have one to four pairs of storage controllers. When one storage controller fails, its redundant backup controller can take over and continue processing I / O, effectively preventing service interruption for users.
[0040] Therefore, from the perspective of system stability and reliability, the more storage controllers a storage system has, the stronger its ability to withstand controller failures. However, more storage controllers often lead to greater system complexity, primarily due to the challenges of data backup and access exclusivity between different modules. As a core module of a storage system, RAID's fundamental requirement is to ensure correct I / O processing. When the number of storage controllers in a storage system increases, the first problem RAID needs to solve is write I / O exclusivity between controllers.
[0041] Write I / O mutual exclusion between controllers refers to the situation where multiple controllers simultaneously perform write I / O on the same stripe of the same RAID array. Only after one controller has completed its write I / O operation can other controllers proceed with theirs. Different controllers cannot process write I / O on the same stripe concurrently. This is primarily determined by the RAID write I / O mechanism, which involves reading the old I / O data from the disk and then XORing it with the new I / O data to obtain the new data to write to the disk. If different controllers simultaneously process write I / O on the same stripe of the RAID array, the controllers will be unable to access the write I / O data being processed by other controllers, leading to data errors. Therefore, resolving write I / O mutual exclusion among multiple controllers is a crucial issue that RAID must address.
[0042] The relevant methods address the write I / O mutual exclusion problem between multiple controllers in RAID, primarily by adding stripe locks through message communication between nodes. RAID locks a stripe by requesting a stripe lock, indicating that a controller is already handling write I / O on that stripe. Other controllers must wait for the stripe lock to be released before they can re-request it, thus achieving write I / O mutual exclusion between multiple controllers.
[0043] like Figure 1The schematic diagram of the write I / O mutual exclusion process between controllers in the RAID implementation provided by the relevant method is shown below. After receiving a write I / O, controller 1 sends a stripe lock request to controller 2 before starting to process the write I / O. If controller 2 is not currently processing a write I / O for that stripe, it will reply with a lock consent request; otherwise, controller 2 needs to wait until the write I / O for that stripe is completed before replying with a lock consent request. After receiving the lock message reply from controller 2, controller 1 starts processing the write I / O, writing the calculated data block content and parity block content to the disk. After the write data is completed, controller 1 needs to send a message to controller 2 to release the stripe lock. After receiving the lock release message, controller 2 releases the stripe lock and replies to controller 1. After receiving the lock release reply, controller 1 completes the I / O processing and returns the processing result to the upper layer.
[0044] The drawback of the relevant methods is that:
[0045] Implementing write I / O mutual exclusion across multiple controllers in RAID is cumbersome, requiring four inter-controller message communications to process a single write I / O, significantly increasing write I / O processing time. Comparative tests of write I / O performance with and without striping show that the striped implementation incurs approximately a 20% performance penalty. This undoubtedly reduces the storage system's IOPS (Input / Output Operations Per Second) performance significantly, severely impacting the user experience. Consequently, the increased write I / O processing time leads to low data writing efficiency.
[0046] To address the shortcomings of related methods, this invention provides a multi-controller data writing method. Figure 2 This is a flowchart illustrating the multi-controller data writing method provided by the present invention, as shown below. Figure 2 As shown, the method includes the following:
[0047] Step 210: Receive a write data request and determine 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 to be written by the data to be written.
[0048] Step 220: Access the metadata in the associated memory and determine the target value of the bit corresponding to the target data stripe in the metadata. The associated memory is the memory space in the memory resource device, which is connected to multiple storage controllers in the storage system. The metadata in the memory space includes multiple bits, and the value of each bit corresponds one-to-one with the occupancy status of each data stripe in the RAID of the storage system. The occupancy status of the data stripe is determined based on the storage controller changing the value of the bit in the metadata.
[0049] Step 230: Based on the target value, determine whether the target data stripe is occupied, and based on whether the target data stripe is occupied, determine whether to execute the write data operation corresponding to the data to be written.
[0050] The following section uses the example of a storage controller in a storage system executing the multi-controller write data method provided by this invention to illustrate the technical solution of this invention in detail.
[0051] In step 210, the storage controller receives a write data request. This write data request is a request to write data to be written to a target data stripe in the storage system's RAID.
[0052] The storage controller analyzes write data requests to determine the data to be written corresponding to the write data request, as well as the target data stripe in the RAID of the storage system to be stored.
[0053] In RAID, data striping is a data storage technique that divides continuous data into blocks of equal size (also called stripes) and writes these blocks to different disks in the array. This technique aims to improve data access speed and I / O performance by distributing data storage locations.
[0054] The target data stripe is one of multiple data stripes in a RAID array.
[0055] In step 220, the metadata in the associated memory is accessed to determine the target value of the bit corresponding to the target data stripe in the metadata.
[0056] Memory resource devices can be added to the storage system in advance, and these memory resource devices are connected to multiple storage controllers in the storage system.
[0057] Specifically, such as Figure 3 The present invention provides a schematic diagram of a memory interconnection structure for multiple storage controllers. Multiple storage controllers of a storage system can be connected to the same memory resource device via the CXL protocol, thereby enabling interconnection between multiple storage controllers and the memory resource device, and ultimately achieving memory resource sharing among the storage controllers.
[0058] Metadata is pre-built in the associated memory of the memory resource device. The metadata consists of multiple bits, each initially set to 0. The value of each bit in the metadata corresponds one-to-one with the occupancy status of each data stripe in the RAID array within the storage system. In other words, the value of each bit in the metadata reflects the occupancy status of the corresponding data stripe in the RAID array.
[0059] When a storage system contains multiple storage controllers, there is typically a configuration node, also known as the master node. When creating a RAID array, the configuration node requests metadata from the interconnected memory resource devices and initializes all bits in the metadata to 0. The purpose of the metadata is to mark whether each stripe of the RAID is currently processing write I / O; a bit value of 0 indicates that no write I / O is currently being processed on that stripe, while a bit value of 1 indicates that the stripe is currently processing write I / O.
[0060] After the RAID is created, all storage controllers on the storage system can operate on its corresponding write IO mutex metadata based on the RAID ID.
[0061] The target value is obtained by reading the corresponding bit value of the target data stripe from the metadata in the associated memory. It can be understood that the target data stripe represents the location where the data to be written will be written according to the write request, and the bit value of the target data stripe in the metadata reflects the occupancy status of the target data stripe.
[0062] Based on the occupancy status of the target data stripe, it can be determined whether the data to be written can be written to the target data stripe.
[0063] In step 230, based on the target value obtained in step 220, it is determined whether the target data strip is occupied.
[0064] Specifically, if the target value is 0, it can be determined that the target data strip is not occupied. If the target value is 1, it can be determined that the target data strip is occupied.
[0065] Based on whether the target data stripe is occupied, it can be determined whether to execute the write operation corresponding to the data to be written.
[0066] Understandably, if it is determined that the target data stripe is not occupied, the write operation corresponding to the data to be written can be executed; if it is determined that the target data stripe is occupied, the write operation corresponding to the data to be written is suspended, and the write operation corresponding to the data to be written is executed again after it is determined that the target data stripe is not occupied.
[0067] Understandably, memory-consistent interconnects between multiple storage controllers can not only eliminate the striping lock mechanism of RAID and improve write I / O processing performance, but also have a positive impact on message communication and data backup between various module nodes in the entire storage system. For example, mirror backups of data caches between nodes no longer need to be transmitted through message communication, but only need to be stored on the interconnect memory device, and multiple nodes can share them; for example, the metadata of thin volumes no longer needs to be synchronized between nodes, but only needs to be maintained on the interconnect memory.
[0068] By interconnecting memory with multiple controllers to ensure consistency, and leveraging the high speed and low latency of memory access, message communication between nodes is eliminated, and existing striping lock mechanisms are eliminated. This effectively reduces write I / O processing latency and improves 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.
[0069] The multi-controller write data method provided by this invention achieves memory resource sharing among multiple storage controllers through memory consistency interconnection, directly linking multiple storage controllers together via interconnected memory, thus realizing physical-level serialization. By having multiple storage controllers jointly operate on the same metadata in the interconnected memory, the striped locking mechanism is eliminated, reducing write I / O processing latency and improving write data efficiency.
[0070] In one embodiment, based on the target value, determining whether the target data stripe is occupied, and based on whether the target data stripe is occupied, determining whether to execute the write data operation corresponding to the data to be written, includes: if the target value is 1, determining that the target data stripe is occupied; if the target value is 0, determining that the target data stripe is not occupied; if the target data stripe is occupied, pausing 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 preset time intervals, until 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; if 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.
[0071] The purpose of metadata is to mark whether each stripe of the RAID is currently processing write I / O. A bit value of 0 indicates that no write I / O is currently being processed on that stripe, while a bit value of 1 indicates that the stripe is currently processing write I / O.
[0072] If the target value is 0, it can be determined that the target data stripe is not occupied. If the target value is 1, it can be determined that the target data stripe is occupied.
[0073] If it is determined that the target data stripe is not occupied, a write operation can be performed on the data to be written, and the corresponding bit of the target data stripe is set to 1 to prevent other storage controllers from performing write operations on the target data stripe.
[0074] If the target data stripe is determined to be occupied, in order to avoid mutual exclusion of write data, the write operation of the data to be written can only be started after the occupation of the target data stripe is released.
[0075] Based on a preset time interval, the corresponding bit of the target data stripe in the metadata is accessed periodically. The value of the corresponding bit of the target data stripe is checked to see if it changes to 0. In other words, by checking if the corresponding bit of the target data stripe changes to 0, it is determined whether the occupied state of the target data stripe has changed to an unoccupied state.
[0076] If it is determined that the target data stripe is not occupied, a write operation can be performed on the data to be written, and the corresponding bit of the target data stripe is set to 1 to prevent other storage controllers from performing write operations on the target data stripe.
[0077] In one embodiment, after performing the write operation on the data to be written, the method further includes: writing the data to be written to the associated memory so that the data to be written can be retrieved from the associated memory during the next data write operation, updating the check block based on the data to be written and the next write data, and writing the obtained check block and the next write data into the data stripe of the storage system.
[0078] When handling write I / O, RAID needs to read old data from the disk, then perform an XOR operation with the new data to obtain the final data to be written to the disk. Introducing interconnect memory allows for the generation of cached data, reducing the number of disk reads and accelerating I / O processing efficiency. Therefore, before reading old data from the disk, RAID first checks the interconnect memory for cached data for that stripe. If cached data is found, it is used directly without reading from the disk; if no cached data for that stripe is found in the interconnect memory, the old data is read from the disk, and after successful reading, it is stored in the interconnect memory for subsequent write I / O operations that hit that stripe.
[0079] Specifically, during the initial data write, the data is written to the associated memory for storage. In subsequent data writes, the pre-stored data to be written can be retrieved directly from the interconnect memory. Based on the data to be written and the next data to be written, the check block is updated, and the obtained check block and the next data to be written are written to the data stripe in the storage system to complete the data writing process for the next data write.
[0080] In one embodiment, before accessing the metadata in the associated memory, the following steps are also included:
[0081] At intervals, the access status of the associated memory is determined, and based on the access status of the associated memory, the RAID status is adjusted.
[0082] If the associated memory becomes inaccessible, the RAID will be set to offline status;
[0083] If the associated memory is accessible, set the RAID to online status.
[0084] Specifically, such as Figure 4 The schematic diagram of the associated memory control RAID online status process provided by this invention shows that a timer can be started on the RAID module on each storage controller of the storage system, with a running period of 30 seconds, attempting to read the associated memory every 30 seconds. If the read is successful, it means that the associated memory is accessible; if the read fails, it means that the associated memory has encountered an error and I / O cannot be processed further.
[0085] When the RAID is online, if the timer detects that the associated memory is inaccessible, the RAID will be switched offline and I / O processing will stop. When the RAID is offline due to inaccessible interconnect memory, if the timer detects that the interconnect memory can be accessed normally, the RAID will be switched online and I / O processing will begin.
[0086] If a read / write operation to the interconnect memory fails during write I / O processing, the RAID will switch to offline mode to stop writing I / O processing. The write I / O currently being processed will return a failure message indicating that the RAID cannot process it offline.
[0087] Optionally, if associated memory is detected to be inaccessible, and this affects the normal operation of the RAID array, the RAID array can be set to offline status through the RAID configuration interface or management software. This typically involves selecting the specific RAID array and then performing an operation to put the array offline.
[0088] Specifically, this can be achieved by writing automated scripts that can perform predefined operations when specific conditions are met, including setting the RAID array to offline status. Logic is written in the scripts to connect to the RAID controller or storage system and execute commands or API calls to set the RAID array to offline status.
[0089] Once the associated memory is accessible and it is confirmed that the RAID array can be safely brought back online, similar steps can be taken to re-establish its online status. This may include performing some additional checks (such as hard drive consistency checks) and verification procedures.
[0090] In one embodiment, a memory resource device is disposed in the storage system, and multiple storage controllers in the storage system are connected to the memory resource device based on the standard interconnect protocol CXL.
[0091] CXL (Compute Express Link) 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 connectivity.
[0092] The configuration of memory resource devices in a storage system, and the connection between multiple storage controllers and these memory resource devices based on the CXL protocol, can improve the performance, reliability, and scalability of the storage system. These goals are achieved by realizing memory-consistent interconnection between multiple storage controllers.
[0093] Understandably, setting up memory resource devices in storage slots can avoid using network cables or other connection devices to connect memory resource devices to the storage controller, allowing the storage controller to quickly access the interconnected memory of the memory resource devices, reducing access latency and improving access efficiency.
[0094] This invention also provides a flowchart illustrating the multi-controller data writing method provided by this invention, as shown below. Figure 5 As shown, it specifically includes:
[0095] After receiving a write I / O request, RAID will request tag metadata from the interconnect memory;
[0096] Upon receiving a call, the interconnect memory reads the bit value of the corresponding stripe and checks if the bit value of that stripe is 0. If the bit value is 0, it means that no write I / O is processing that stripe, and success is returned; if the bit value is 1, it means that write I / O is processing that stripe, and failure is returned.
[0097] If RAID fails to receive the tag metadata, it will continue to send requests until the tagging is successful before it can continue to process write I / O; if RAID successfully receives the tag metadata, it will start processing write I / O directly.
[0098] When handling write I / O, RAID needs to read old data from the disk, then perform an XOR operation with the new data to obtain the final data to be written to the disk. Introducing interconnect memory allows for the generation of cached data, reducing the number of disk reads and accelerating I / O processing efficiency. Therefore, before reading old data from the disk, RAID first checks the interconnect memory for cached data for that stripe. If cached data is found, it is used directly without reading from the disk; if no cached data for that stripe is found in the interconnect memory, the old data is read from the disk, and after successful reading, it is stored in the interconnect memory for subsequent write I / O operations that hit that stripe.
[0099] After calculating the data that needs to be written to disk, the data is written to the disk and simultaneously updated in the interconnect memory so that subsequent write I / Os that hit this stripe can continue to use it.
[0100] Once the write I / O data is written to disk, a request will be made to release the metadata from the interconnect memory, allowing subsequent write I / O operations to continue processing that stripe.
[0101] The following describes the multi-controller data writing device provided by the present invention. The multi-controller data writing device described below and the multi-controller data writing method described above can be referred to in correspondence.
[0102] like Figure 6 As shown, the device includes:
[0103] The receiving module 610 is used to receive a write data request and determine 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 to be written by the data to be written.
[0104] The query module 620 is used to access metadata in associated memory and determine the target value of the bit corresponding to the target data stripe in the metadata. The associated memory is the memory space in the memory resource device, which is connected to multiple storage controllers in the storage system. The metadata in the memory space includes multiple bits, and the value of each bit corresponds one-to-one with the occupancy status of each data stripe in the RAID of the storage system. The occupancy status of the data stripe is determined based on the storage controller changing the value of the bit in the metadata.
[0105] The judgment module 630 is used to determine whether the target data strip is occupied based on the target value, and to determine whether to execute the write data operation corresponding to the data to be written based on whether the target data strip is occupied.
[0106] The multi-controller write data device provided by this invention achieves memory resource sharing among multiple storage controllers through memory consistency interconnection, directly linking multiple storage controllers together via interconnected memory, thus realizing physical-level serialization. By having multiple storage controllers jointly operate on the same metadata in the interconnected memory, the striped locking mechanism is eliminated, reducing write I / O processing latency and improving write data efficiency.
[0107] In one embodiment, the determination module 630 is specifically used for:
[0108] Based on the target value, determine whether the target data stripe is occupied, and based on whether the target data stripe is occupied, determine whether to execute the write data operation corresponding to the data to be written, including:
[0109] If the target value is determined to be 1, the occupancy status of the target data strip is determined to be occupied.
[0110] If the target value is determined to be 0, the occupancy status of the target data strip is determined to be unoccupied.
[0111] If it is determined that the target data stripe is occupied, the write data operation of the data to be written in the write data request is suspended, and the corresponding bit of the target data stripe in the metadata is checked in a loop at preset time intervals until it is determined that the target data stripe is not occupied when the corresponding bit of the target data stripe is 0. Then the corresponding bit of the target data stripe is set to 1, and the write data operation of the data to be written is executed.
[0112] If it is determined that the target data stripe is not occupied, the corresponding bit of the target data stripe is set to 1, and the write operation of the data to be written is performed.
[0113] In one embodiment, the determining module 630 is further specifically used for:
[0114] After performing the write operation on the data to be written, the method further includes:
[0115] The data to be written is written to the associated memory so that during the next data write, the data to be written is retrieved from the associated memory, and the check block is updated based on the data to be written and the next write data. The obtained check block and the next write data are then written to the data stripe in the storage system.
[0116] In one embodiment, the query module 620 is specifically used for:
[0117] Before accessing metadata in associated memory, the following steps are also included:
[0118] During the interval operation period, the access status of the associated memory is determined, and based on the access status of the associated memory, the RAID status is adjusted.
[0119] In one embodiment, the query module 620 is further specifically used for:
[0120] Based on the access status of the associated memory, adjustments are made to the RAID status, including:
[0121] If the associated memory becomes inaccessible, the RAID will be set to offline status;
[0122] If the associated memory is accessible, set the RAID to online status.
[0123] In one embodiment, the receiving module 610 is specifically used for:
[0124] The memory resource devices are located in the storage system.
[0125] In one embodiment, the receiving module 610 is further configured to:
[0126] Multiple storage controllers in the storage system are connected to the memory resource devices based on the standard interconnect protocol CXL.
[0127] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can invoke logical instructions in the memory 730 to execute a multi-controller write data method, which includes: 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 to be written by the data to be written.
[0128] Access the metadata in the associated memory to determine the target value of the bit corresponding to the target data stripe in the metadata. The associated memory is the memory space in the memory resource device, which is connected to multiple storage controllers in the storage system. The metadata in the memory space includes multiple bits, and the value of each bit corresponds one-to-one with the occupancy status of each data stripe in the RAID of the storage system. The occupancy status of the data stripe is determined based on the storage controller changing the value of the bit in the metadata.
[0129] Based on the target value, determine whether the target data stripe is occupied, and based on whether the target data stripe is occupied, determine whether to execute the write data operation corresponding to the data to be written.
[0130] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0131] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being able to be stored on a non-transitory computer-readable storage medium, the computer program being executed by a processor, the computer being able to execute the multi-controller write data method provided by the above methods, the method including: 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 to be written by the data to be written;
[0132] Access the metadata in the associated memory to determine the target value of the bit corresponding to the target data stripe in the metadata. The associated memory is the memory space in the memory resource device, which is connected to multiple storage controllers in the storage system. The metadata in the memory space includes multiple bits, and the value of each bit corresponds one-to-one with the occupancy status of each data stripe in the RAID of the storage system. The occupancy status of the data stripe is determined based on the storage controller changing the value of the bit in the metadata.
[0133] Based on the target value, determine whether the target data stripe is occupied, and based on whether the target data stripe is occupied, determine whether to execute the write data operation corresponding to the data to be written.
[0134] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a multi-controller write data 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 a redundant array of independent disks (RAID) of the storage system to be written by the data to be written.
[0135] Access the metadata in the associated memory to determine the target value of the bit corresponding to the target data stripe in the metadata. The associated memory is the memory space in the memory resource device, which is connected to multiple storage controllers in the storage system. The metadata in the memory space includes multiple bits, and the value of each bit corresponds one-to-one with the occupancy status of each data stripe in the RAID of the storage system. The occupancy status of the data stripe is determined based on the storage controller changing the value of the bit in the metadata.
[0136] Based on the target value, determine whether the target data stripe is occupied, and based on whether the target data stripe is occupied, determine whether to execute the write data operation corresponding to the data to be written.
[0137] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for writing data to multiple controllers, characterized in that, The method includes: Receive a write data request and determine 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 to be written by the data to be written. Access the metadata in the associated memory to determine the target value of the bit corresponding to the target data stripe in the metadata. The associated memory is the memory space in the memory resource device, which is connected to multiple storage controllers in the storage system. The metadata in the memory space includes multiple bits, and the value of each bit corresponds one-to-one with the occupancy status of each data stripe in the RAID of the storage system. The occupancy status of the data stripe is determined based on the storage controller changing the value of the bit in the metadata. If the target value is determined to be 1, the occupancy status of the target data strip is determined to be occupied. If the target value is determined to be 0, the occupancy status of the target data strip is determined to be unoccupied. If it is determined that the target data stripe is occupied, the write data operation of the data to be written in the write data request is suspended, and the corresponding bit of the target data stripe in the metadata is checked in a loop at preset time intervals until it is determined that the target data stripe is not occupied when the corresponding bit of the target data stripe is 0. Then the corresponding bit of the target data stripe is set to 1, and the write data operation of the data to be written is executed. If it is determined that the target data stripe is not occupied, the corresponding bit of the target data stripe is set to 1, and the write data operation of the data to be written is performed. After performing the write operation on the data to be written, the method further includes: The data to be written is written to the associated memory so that during the next data write, the data to be written is retrieved from the associated memory, and the check block is updated based on the data to be written and the next write data. The obtained check block and the next write data are then written to the data stripe in the storage system.
2. The multi-controller data writing method according to claim 1, characterized in that, Before accessing the metadata in the associated memory, the following steps are also included: During the interval operation period, the access status of the associated memory is determined, and based on the access status of the associated memory, the RAID status is adjusted.
3. The multi-controller data writing method according to claim 2, characterized in that, The adjustment of the RAID state based on the access state of the associated memory includes: If the associated memory becomes inaccessible, the RAID will be set to offline status; If the associated memory is accessible, set the RAID to online status.
4. The multi-controller data writing method according to claim 1, characterized in that, The memory resource device is located in the storage system.
5. The multi-controller data writing method according to claim 1, characterized in that, Multiple storage controllers in the storage system are connected to the memory resource devices based on the standard interconnect protocol CXL.
6. A multi-controller data writing device, characterized in that, include: The receiving module is used to receive write data requests and determine 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 to be written by the data to be written. The query module is used to access metadata in associated memory and determine the target value of the corresponding bit in the target data stripe in the metadata. The associated memory is the memory space in the memory resource device, which is connected to multiple storage controllers in the storage system. The metadata in the memory space includes multiple bits, and the value of each bit corresponds one-to-one with the occupancy status of each data stripe in the RAID of the storage system. The occupancy status of the data stripe is determined based on the storage controller changing the value of the bit in the metadata. The judgment module is used to determine that the occupancy status of the target data strip is occupied when the target value is determined to be 1. If the target value is determined to be 0, the target data stripe is determined to be unoccupied. If the target data stripe is determined to be occupied, the write operation of the data to be written in the write data request is paused, and the corresponding bit of the target data stripe in the metadata is checked cyclically at preset time intervals until the corresponding bit of the target data stripe is determined to be 0. If the corresponding bit of the target data stripe is determined to be 0, the target data stripe is determined to be unoccupied, the corresponding bit of the target data stripe is set to 1, and the write operation of the data to be written is executed. If the target data stripe is determined to be unoccupied, the corresponding bit of the target data stripe is set to 1, and the write operation of the data to be written is executed. After performing the write operation on the data to be written, the method further includes: The data to be written is written to the associated memory so that during the next data write, the data to be written is retrieved from the associated memory, and the check block is updated based on the data to be written and the next write data. The obtained check block and the next write data are then written to the data stripe in the storage system.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the multi-controller write data method as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the multi-controller write data method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method and device, data node and storage medium
CN112214175A