Operation request recovery method and device, computer equipment and storage medium
The method and device address data inconsistency and system performance issues by locking nodes to store key data in non-volatile memory and restoring operations upon failure, ensuring reliable data processing in remote replication systems.
Patent Information
- Application Number
- CN202411239175.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-17
AI Technical Summary
Node failures, site failures, and link failures during read and write operations lead to data inconsistency and system performance issues in remote replication systems.
A method and device that lock master and slave nodes to store key data in non-volatile memory, execute operations, and restore them upon failure, ensuring data consistency and reliability by sending tasks to remote clusters.
Ensures data consistency and improves system reliability by allowing continued processing of read and write operations after failures, using non-volatile memory to store critical data and remote replication techniques.
Smart Images

Figure CN119149300A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of operation request recovery, and in particular to an operation request recovery method, apparatus, computer equipment and storage medium. Background Art
[0002] During the entire read and write operation process, node failures, site failures, link failures, etc. may occur at any time, resulting in the read and write operations being unable to be processed normally. Uncompleted read and write operations will cause the local and remote ends of remote replication to be out of sync, causing data inconsistency problems and seriously affecting system performance. Summary of the invention
[0003] Based on this, it is necessary to provide an operation request recovery method, apparatus, computer equipment and storage medium that can improve system performance in response to the above technical problems.
[0004] In order to solve the above technical problem, in a first aspect, an operation request recovery method is provided, the method comprising:
[0005] In response to the master node receiving a read / write operation request, locking the master node;
[0006] Parse the read and write operation requests, obtain the key data of the read and write operation requests, store the key data in the preset space of the master node, and generate control instructions;
[0007] In response to receiving the control instruction from the slave node, locking the slave node, obtaining key data of the read and write operation request, and storing the key data in a preset space of the slave node;
[0008] In response to the slave node locking, the master node executes the read and write operation tasks according to the read and write operation request, and sends the read and write operation tasks to the remote cluster storage;
[0009] In response to detecting that a failure occurs when the master node performs a read or write operation task, triggering a failure notification, and sending the failure notification to the slave node;
[0010] In response to receiving the fault notification from the slave node, the slave node obtains key data from a preset space of the slave node, restores the read and write operation requests according to the key data, and sends the restored read and write operation requests to the remote cluster for execution.
[0011] In one embodiment, sending the recovered read / write operation request to the remote cluster for execution includes:
[0012] In response to the remote cluster receiving the restored read / write operation request, the remote cluster executes the restored read / write operation task according to the restored read / write operation request;
[0013] In response to completion of the restored read and write operation tasks, the remote cluster generates an end instruction and sends the end instruction to the slave node.
[0014] In one embodiment, sending the end instruction to the slave node includes:
[0015] In response to receiving the end instruction from the slave node, releasing the lock on the slave node and deleting the key data stored in the preset space of the slave node;
[0016] In response to the deletion of the key data stored in the preset space of the slave node, the slave node generates a deletion instruction and sends the deletion instruction to the master node;
[0017] In response to the master node receiving the deletion instruction, the lock of the master node is released, and the key data stored in the preset space of the master node is deleted.
[0018] In one embodiment, the key data includes data volume ID, logical block address location information, logical block address length, and read / write operation request sequence number, and storing the key data in the master node preset space includes: storing the key data in non-volatile memory.
[0019] In one embodiment, the master node and the slave node are arranged in a local cluster, and the method further comprises:
[0020] Get the data volume in the local cluster and use it as the primary volume.
[0021] Get the data volume in the remote cluster and use it as a secondary volume.
[0022] The format information of the primary volume and the secondary volume is consistent;
[0023] Establish a remote replication relationship between the primary volume and the secondary volume.
[0024] In one embodiment, the method further comprises:
[0025] In response to the master node failure recovery, obtaining differential data from when the master node failure occurs to when the master node failure is recovered;
[0026] Establish a change data bitmap based on the difference data;
[0027] Flushes the changed data bitmap to the remote cluster.
[0028] In one embodiment, the method further comprises:
[0029] Get the ports of the local cluster device and the remote cluster device;
[0030] Configure virtual IP addresses for each local cluster device port and each remote cluster device port.
[0031] Get the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device;
[0032] Generate a link table based on the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device;
[0033] In response to receiving a read / write operation request, searching a target link from a link table;
[0034] Establish a remote replication relationship between the local cluster device and the remote cluster device based on the target link;
[0035] Wherein, the link table pair is encrypted using the preset authentication information to generate mapping encryption information of the link table;
[0036] The virtual link table information is generated according to the preset authentication information, link table and mapping encryption information and stored in the database.
[0037] In order to solve the above technical problem, in a second aspect, an operation request recovery device is provided, the device comprising:
[0038] The storage module is used to lock the master node in response to the master node receiving a read / write operation request; parse the read / write operation request, obtain key data of the read / write operation request, store the key data in a preset space of the master node, and generate a control instruction; in response to the slave node receiving a control instruction, lock the slave node, obtain key data of the read / write operation request, and store the key data in a preset space of the slave node;
[0039] An execution module, configured to respond to the slave node locking, the master node executing the read / write operation task according to the read / write operation request, and sending the read / write operation task to the remote cluster storage; in response to detecting that a fault occurs when the master node executes the read / write operation task, trigger a fault notification, and send the fault notification to the slave node;
[0040] The recovery module is used to respond to receiving a fault notification from the slave node, the slave node obtains key data from the preset space of the slave node, and restores the read and write operation requests according to the key data, and sends the restored read and write operation requests to the remote cluster for execution.
[0041] In order to solve the above technical problem, in the third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: the processor implements the steps of the method described in the first aspect when executing the computer program.
[0042] In order to solve the above technical problem, in a fourth aspect, the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0043] Different from the prior art, in the present application, in response to the master node receiving a read / write operation request, the master node is locked; the read / write operation request is parsed to obtain key data of the read / write operation request, the key data is stored in the preset space of the master node, and a control instruction is generated at the same time; in response to the slave node receiving a control instruction, the slave node is locked to obtain key data of the read / write operation request, and the key data is stored in the preset space of the slave node; in response to the slave node being locked, the master node performs the read / write operation task according to the read / write operation request, and sends the read / write operation task to a remote cluster storage; in response to detecting that a fault occurs when the master node performs the read / write operation task, a fault notification is triggered, and the fault notification is sent to the slave node; in response to the slave node receiving the fault notification, the slave node obtains key data from the preset space of the slave node, and restores the read / write operation request according to the key data, and sends the restored read / write operation request to the remote cluster for execution. In this way, when processing read and write operations, the key data of the read and write operations are stored in the preset space of the master node and the preset space of the slave node respectively. In this way, when a failure occurs during the processing of read and write operations, after the cluster restores its business processing capabilities, the key data of the read and write operations can be restored from the preset space of the master node or the preset space of the slave node on both the master node and the slave node, and the processing of the read and write operations can be continued. In addition, the read and write operation tasks can be sent to the remote cluster storage, which can improve system reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of a flow chart of an operation request recovery method in one embodiment;
[0045] Figure 2 A flowchart of an operation request recovery method in another embodiment;
[0046] Figure 3 A structural block diagram of an operation request recovery processing device in one embodiment;
[0047] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] In one embodiment, Figure 1 As shown, a method for recovering an operation request is provided, the method comprising the following steps:
[0050] Step 101, in response to the master node receiving a read / write operation request, the master node is locked.
[0051] Specifically, when the master node receives a read / write operation request from the host, it can lock the master node. The lock here can be a metadata bitmap lock. The metadata bitmap lock can be an MDL lock, which stands for metadata lock. The main function of the MDL lock is to maintain the data consistency of the table metadata. When there is an active transaction (explicit or implicit) on the table, the metadata cannot be written. Therefore, the MDL lock was introduced from MySQL version 5.5 to protect the metadata information of the table, which is used to solve or ensure the consistency between DDL operations and DML operations.
[0052] Step 102, parse the read and write operation request, obtain key data of the read and write operation request, store the key data in the preset space of the master node, and generate control instructions.
[0053] After receiving the write operation request, the master node parses the write operation request and obtains the key data of the read and write operation request. Among them, the key data of the read and write operation request may include data volume ID, logical block address location information, logical block address length, read and write operation request sequence number and other information. The key data of the read and write operation request obtained is stored in the preset space of the master node, so that when the master node fails in the future, the key data corresponding to the operation request can be obtained to continue to execute the read and write operation request. Among them, the preset space of the master node can be in non-volatile memory. The main advantage of non-volatile memory is that its data can still be retained after power failure, and it has faster read and write speed and higher durability.
[0054] Step 103, in response to receiving the control instruction from the slave node, locking the slave node, obtaining key data of the read and write operation request, and storing the key data in a preset space of the slave node.
[0055] After the master node stores the critical data in the preset space of the master node, a control instruction is generated and sent to the slave node. After receiving the control instruction, the slave node is locked. The lock here can also be a metadata bitmap lock. The lock is not specifically limited in this solution. The lock for locking the master node and the lock for locking the slave node can be the same lock or different locks.
[0056] In this application, the master node and the slave node back up metadata with each other, and failover can be achieved between the master node and the slave node. The slave node will also obtain the key data of this operation request and store the key data in the preset space of the slave node, which can be a non-volatile memory.
[0057] Step 104, in response to the slave node locking, the master node executes the read / write operation task according to the read / write operation request, and sends the read / write operation task to the remote cluster storage.
[0058] Although the present application does not process read and write operations on the slave node, the slave node is still locked to ensure that other read and write operation requests can process the data and read and write operations of the slave node, avoid conflicts, and improve the reliability of read and write operations.
[0059] In this application, a master node and a slave node are set in a local cluster, and the data volume in the local cluster is obtained, and the data volume in the local cluster is used as the master volume; the data volume in the remote cluster is obtained, and the data volume in the remote cluster is used as the slave volume; the format information of the master volume and the slave volume is consistent; a remote replication relationship between the master volume and the slave volume is established, so that a remote replication relationship between the local cluster and the remote cluster is established, which can improve the reliability of data processing.
[0060] In a feasible implementation, the method also includes: creating a primary volume change volume corresponding to the primary volume, the primary volume change volume is used to back up the snapshots stored in the primary volume; creating a secondary volume change volume corresponding to the secondary volume, the secondary volume change volume is used to back up the snapshots stored in the primary volume; and establishing a remote replication relationship between the primary volume change volume and the secondary volume change volume.
[0061] The primary volume can directly send the data information received and stored in the primary volume to the secondary volume for backup through the remote replication relationship between the primary volume and the secondary volume, and can also send the data information received and stored in the primary volume to the secondary volume for backup through the primary volume change volume and the secondary volume change volume. Specifically, the replication relationship between the primary volume and the primary volume change volume can be a snapshot relationship, and the replication relationship between the secondary volume and the secondary volume change volume can be a snapshot relationship, that is, the primary volume stores the data information after receiving the data information, and can also send the received data information to the primary volume change volume corresponding to the primary volume, the primary volume change volume can also send the received data information to the secondary volume change volume corresponding to the secondary volume, and the secondary volume change volume will then send the received data information to the secondary volume for storage, thereby realizing the backup of the data information in the primary volume to achieve redundant protection of the data information.
[0062] Step 105 , in response to detecting that a fault occurs when the master node performs a read or write operation task, triggering a fault notification, and sending the fault notification to the slave node.
[0063] Step 106, in response to receiving the fault notification from the slave node, the slave node obtains key data from a preset space of the slave node, restores the read and write operation requests according to the key data, and sends the restored read and write operation requests to the remote cluster for execution.
[0064] In the present application, the master node can be monitored in real time. When the master node fails, a fault notification will be triggered and sent to the slave node. After receiving the fault notification, the slave node will obtain key data from the preset space of the slave node. Because the key data stored in the preset space of the slave node and the preset space of the master node are the key data of the same read and write request, when the master node fails, the key data can be obtained from the preset space of the slave node to restore the read and write operation request, restore the original read and write operation request, and send the read and write operation request to the remote cluster for processing. In this way, when a fault occurs during the processing of the read and write operation, after the cluster restores its business processing capacity, the key data of the read and write operation can be restored from the preset space of the master node or the preset space of the slave node on both the master node and the slave node, and the processing of the read and write operation can continue. In addition, the read and write operation tasks will be sent to the remote cluster storage, which can improve the system reliability.
[0065] In one embodiment, when a master node fails, in response to master node failure recovery, differential data from when the master node failure occurs to when the master node failure is recovered can be obtained; a change data bitmap can be established based on the differential data; and the change data bitmap can be flushed to a remote cluster.
[0066] Specifically, when the master node fails, the difference data from when the master node fails to when the master node recovers is obtained, and a change data bitmap is established based on the difference data; the change data bitmap is flushed to the remote cluster. In this application, the change data bitmap can be used to record the differential data, so that when copying data from the storage system, only the differential data needs to be copied, thereby improving the copying efficiency; the snapshot technology is used in the master file system in the local cluster to ensure that the master file system data read during the synchronization process is consistent, and the synchronization process and the host's write process to the master file system can be carried out simultaneously; the snapshot technology is used in the slave file system of the remote cluster to avoid abnormalities in the next synchronization process that cause the slave file system data to be unavailable.
[0067] In one embodiment, after the recovered read-write operation request is sent to the remote cluster for execution, it includes: in response to the remote cluster receiving the recovered read-write operation request, the remote cluster executes the recovered read-write operation task according to the recovered read-write operation request; in response to the completion of the recovered read-write operation task, the remote cluster generates an end instruction and sends the end instruction to the slave node.
[0068] After sending the end instruction to the slave node, it includes: in response to the slave node receiving the end instruction, releasing the lock of the slave node and deleting the key data stored in the preset space of the slave node; in response to deleting the key data stored in the preset space of the slave node, the slave node generates a deletion instruction and sends the deletion instruction to the master node; in response to the master node receiving the deletion instruction, releasing the lock of the master node and deleting the key data stored in the preset space of the master node.
[0069] After the remote cluster receives the recovery read / write operation request sent by the slave node, the remote cluster executes the recovery read / write operation task according to the recovery read / write operation request. After the remote cluster completes the recovery read / write operation task, it can generate an end instruction and send the end instruction to the slave node. After receiving the end instruction, the node will release the lock on the slave node and delete the key data of this read / write operation task to release the preset space of the slave node. Then the slave node generates a task end instruction to complete the execution of this operation request, sends the technical task instruction to the master node, and the master node releases the lock and deletes the key data of the node preset space.
[0070] In one embodiment, the operation request recovery method provided in the present application also includes: obtaining the ports of the local cluster device and the ports of the remote cluster device; configuring virtual IPs for each port of the local cluster device and each port of the remote cluster device respectively; obtaining the virtual IP information of the ports of the local cluster device and the virtual IP information of the ports of the remote cluster device; generating a link table based on the virtual IP information of the ports of the local cluster device and the virtual IP information of the ports of the remote cluster device; in response to receiving a read or write operation request, searching the link table for a target link; establishing a remote replication relationship between the local cluster device and the remote cluster device based on the target link; wherein, encrypting the link table pair using preset authentication information to generate mapping encryption information of the link table; generating virtual link table information based on the preset authentication information, the link table, and the mapping encryption information and storing it in a database.
[0071] This embodiment realizes remote replication by first generating a replication link table based on the port group and then establishing a remote replication relationship based on the selected replication link. Since the replication link table of the port group is used, the applied replication link is not a replication link of a fixed IP. When a failure occurs, rapid switching can be performed based on the virtual IP, thereby avoiding failure problems caused by the use of fixed IPs and improving the stability of the remote replication relationship established by the storage system.
[0072] See also Figure 2 In a specific implementation, the operation request recovery method of the present application is as follows:
[0073] First, when creating a remote replication relationship, a piece of memory is applied for each node in each cluster to store the basic information of the remote replication read and write operations being processed, such as volume ID (data volume ID), l ba starting position (logical block address position information), l ba length (logical block address length), version number of the read and write operation, sequence number of the read and write operation (read and write operation request sequence number) and other information. This information cannot be lost after a failure, so it is called critical data. This piece of memory that stores critical data is non-volatile memory, and it can still be recovered from harden after the node is offline and restored. That is, the data in the non-volatile memory can be saved to the hard disk in the event of damage. It can be restored to the memory later for further processing.
[0074] After the remote replication is created, the master volume of the remote replication starts to receive read and write operations. When the master node of the storage device receives the read and write operation, it first applies for a lock for the read and write operation. After the read and write operation obtains the lock, the master node applies for the master node preset space for storing basic information for the read and write operation, and stores the volume ID, l ba starting position, l ba length, sequence number of the read and write operation, etc. in the NVJ memory. After that, the master node sends a message to the slave node, and the read and write operation is also locked synchronously in the slave node. After the lock is successful, the slave node applies for the slave node preset space for the read and write operation to store key information, and specifically stores the volume ID, l ba starting position, l ba length, sequence number of the read and write operation, etc. in the NVJ memory of the slave node. After that, the slave node returns a message of successful locking to the master node, and the read and write operation acquires the lock.
[0075] After the read / write operation acquires the lock, it starts writing the read / write operation. While writing the read / write operation to the local cluster, it also sends the read / write operation to the auxiliary volume at the remote site. The remote site writes the read / write operation to the remote cluster. When the read / write operation at the local site and the remote site are both written, they are returned to the remote replication module, which initiates the lock release process.
[0076] First, remote replication releases the read-write operation processing lock on the master node of this node, and then sends a lock release processing request to the slave node on the opposite side. After the slave node receives the lock release processing message, it releases the read-write operation processing lock of this node, and then clears the key data of this read-write operation, releases the key information of the slave node preset space, and returns the lock release success information to the master node. After the master node receives the lock release success message from the slave node, it clears the key data saved on the master node and releases the key information of the master node preset space. The read-write operation processing is completed and returned to the host.
[0077] This read and write operation processing process can ensure that the basic information of the read and write operation is saved in the non-volatile memory during the entire read and write operation processing process. When a failure occurs during the read and write operation processing, such as a node failure, a site failure, or a link failure, causing the remote replication read and write operation to be interrupted and unable to be processed, the basic information of the read and write operation is maintained on both nodes. After the cluster is restored, the read and write operation can be resumed on either of the two nodes and continued.
[0078] For example: the master node receives a remote replication read / write operation, and the master node and slave node are locked. The read / write operation on the master node has been sent to the local, and the local data is new data, but the read / write operation has not been sent to the remote replication secondary volume in time. At this time, the master node fails and goes offline, causing the read / write operation to be interrupted and unable to continue. After the master node goes offline, the surviving node in the cluster takes over the business from the slave node. After the slave node takes over, it recovers the basic information of the unprocessed read / write operation from the preset space of this node, applies for resources for the read / write operation, reprocesses the read / write operation, and re-initiates data synchronization from the local cluster to the remote cluster. When the read / write operation is processed, the data of the two sites is synchronized consistently.
[0079] The present application solves the problem that when a node failure, site failure, or link failure occurs during the processing of a remote replication read / write operation, the processing of the read / write operation is interrupted, resulting in inconsistent data between the remote replication master volume and the auxiliary volume. During the processing of the read / write operation, key information of the read / write operation, such as volume ID, lba starting position, lba length, version number of the read / write operation, sequence number of the read / write operation, etc., is saved in a non-volatile memory, and these key information are simultaneously maintained in two nodes of the cluster where the remote replication master volume is located. When the read / write operation starts to be processed, the key information is saved in the non-volatile memory, and when the read / write operation is processed, the key information of the read / write operation is cleared from the non-volatile memory. In this way, when a node failure, site failure, or link failure occurs during the processing of the read / write operation, after the cluster recovers its business processing capability, the basic information of the read / write operation can be recovered from the non-volatile memory on both nodes, the processing of the read / write operation is continued, and the read / write operation is synchronized from the master volume of the local end to the auxiliary volume of the remote end, thereby ensuring the data consistency of the master volume and the auxiliary volume of the remote replication. The auxiliary volume of the remote replication is made to be an effective and available volume.
[0080] It should be understood that although Figure 1-Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 2At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0081] In one embodiment, Figure 3 As shown, an operation request recovery device is provided, comprising: a storage module 30, an execution module 31 and a recovery module 32, wherein:
[0082] The storage module 30 is used to lock the master node in response to the master node receiving a read / write operation request; parse the read / write operation request, obtain key data of the read / write operation request, store the key data in the preset space of the master node, and generate a control instruction; in response to the slave node receiving a control instruction, lock the slave node, obtain key data of the read / write operation request, and store the key data in the preset space of the slave node;
[0083] The execution module 31 is used for, in response to the slave node locking, the master node executing the read / write operation task according to the read / write operation request, and sending the read / write operation task to the remote cluster storage; in response to detecting that a fault occurs when the master node executes the read / write operation task, triggering a fault notification, and sending the fault notification to the slave node;
[0084] The recovery module 32 is used for, in response to receiving a fault notification from the slave node, the slave node obtains key data from a preset space of the slave node, recovers read and write operation requests according to the key data, and sends the recovered read and write operation requests to the remote cluster for execution.
[0085] In one embodiment, another implementation of the operation request recovery method that can be implemented by the above device includes the following specific steps:
[0086] Sending the restored read and write operation request to the remote cluster for execution includes:
[0087] In response to the remote cluster receiving the restored read / write operation request, the remote cluster executes the restored read / write operation task according to the restored read / write operation request;
[0088] In response to completion of the restored read and write operation tasks, the remote cluster generates an end instruction and sends the end instruction to the slave node.
[0089] In one embodiment, another implementation of the operation request recovery method that can be implemented by the above device includes the following specific steps:
[0090] Sending the end command to the slave node includes:
[0091] In response to receiving the end instruction from the slave node, releasing the lock on the slave node and deleting the key data stored in the preset space of the slave node;
[0092] In response to the deletion of the key data stored in the preset space of the slave node, the slave node generates a deletion instruction and sends the deletion instruction to the master node;
[0093] In response to the master node receiving the deletion instruction, the lock of the master node is released, and the key data stored in the preset space of the master node is deleted.
[0094] In one embodiment, another implementation of the operation request recovery method that can be implemented by the above device includes the following specific steps:
[0095] The key data includes data volume ID, logical block address location information, logical block address length, and read / write operation request sequence number. Storing the key data in the preset space of the master node includes storing the key data in non-volatile memory.
[0096] In one embodiment, another implementation of the operation request recovery method that can be implemented by the above device includes the following specific steps:
[0097] The master node and the slave node are set in a local cluster, and the method also includes:
[0098] Get the data volume in the local cluster and use it as the primary volume.
[0099] Get the data volume in the remote cluster and use it as a secondary volume.
[0100] The format information of the primary volume and the secondary volume is consistent;
[0101] Establish a remote replication relationship between the primary volume and the secondary volume.
[0102] In one embodiment, another implementation of the operation request recovery method that can be implemented by the above device includes the following specific steps:
[0103] The method also includes:
[0104] In response to the master node failure recovery, obtaining differential data from when the master node failure occurs to when the master node failure is recovered;
[0105] Establish a change data bitmap based on the difference data;
[0106] Flushes the changed data bitmap to the remote cluster.
[0107] In one embodiment, another implementation of the operation request recovery method that can be implemented by the above device includes the following specific steps:
[0108] The method also includes:
[0109] Get the ports of the local cluster device and the remote cluster device;
[0110] Configure virtual IP addresses for each local cluster device port and each remote cluster device port.
[0111] Get the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device;
[0112] Generate a link table based on the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device;
[0113] In response to receiving a read / write operation request, searching a target link from a link table;
[0114] Establish a remote replication relationship between the local cluster device and the remote cluster device based on the target link;
[0115] Wherein, the link table pair is encrypted using preset authentication information to generate mapping encryption information of the link table;
[0116] The virtual link table information is generated according to the preset authentication information, link table and mapping encryption information and stored in the database.
[0117] For the specific definition of the operation request recovery device, please refer to the definition of the operation request recovery method above, which will not be repeated here. Each module in the above operation request recovery device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0118] In one embodiment, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the operation request recovery method provided by the above methods.
[0119] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data applied by the operation request recovery method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an operation request recovery method is implemented.
[0120] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0121] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0122] Step 101, in response to the master node receiving a read / write operation request, the master node is locked.
[0123] Step 102, parse the read and write operation request, obtain key data of the read and write operation request, store the key data in the preset space of the master node, and generate control instructions.
[0124] Step 103, in response to receiving the control instruction from the slave node, locking the slave node, obtaining key data of the read and write operation request, and storing the key data in a preset space of the slave node.
[0125] Step 104, in response to the slave node locking, the master node executes the read / write operation task according to the read / write operation request, and sends the read / write operation task to the remote cluster storage.
[0126] Step 105 , in response to detecting that a fault occurs when the master node performs a read or write operation task, triggering a fault notification, and sending the fault notification to the slave node.
[0127] Step 106, in response to receiving the fault notification from the slave node, the slave node obtains key data from a preset space of the slave node, restores the read and write operation requests according to the key data, and sends the restored read and write operation requests to the remote cluster for execution.
[0128] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0129] Sending the restored read and write operation request to the remote cluster for execution includes:
[0130] In response to the remote cluster receiving the restored read / write operation request, the remote cluster executes the restored read / write operation task according to the restored read / write operation request;
[0131] In response to completion of the restored read and write operation tasks, the remote cluster generates an end instruction and sends the end instruction to the slave node.
[0132] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0133] In response to receiving the end instruction from the slave node, releasing the lock on the slave node and deleting the key data stored in the preset space of the slave node;
[0134] In response to the deletion of the key data stored in the preset space of the slave node, the slave node generates a deletion instruction and sends the deletion instruction to the master node;
[0135] In response to the master node receiving the deletion instruction, the lock of the master node is released, and the key data stored in the preset space of the master node is deleted.
[0136] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0137] The key data includes data volume ID, logical block address location information, logical block address length, and read / write operation request sequence number. Storing the key data in the preset space of the master node includes storing the key data in non-volatile memory.
[0138] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0139] The master node and the slave node are set in a local cluster, and the method also includes:
[0140] Get the data volume in the local cluster and use it as the primary volume.
[0141] Get the data volume in the remote cluster and use it as a secondary volume.
[0142] The format information of the primary volume and the secondary volume is consistent;
[0143] Establish a remote replication relationship between the primary volume and the secondary volume.
[0144] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0145] The method also includes:
[0146] In response to the master node failure recovery, obtaining differential data from when the master node failure occurs to when the master node failure is recovered;
[0147] Establish a change data bitmap based on the difference data;
[0148] Flushes the changed data bitmap to the remote cluster.
[0149] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0150] The method also includes:
[0151] Get the ports of the local cluster device and the remote cluster device;
[0152] Configure virtual IP addresses for each local cluster device port and each remote cluster device port.
[0153] Get the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device;
[0154] Generate a link table based on the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device;
[0155] In response to receiving a read / write operation request, searching a target link from a link table;
[0156] Establish a remote replication relationship between the local cluster device and the remote cluster device based on the target link;
[0157] Wherein, the link table pair is encrypted using the preset authentication information to generate mapping encryption information of the link table;
[0158] The virtual link table information is generated according to the preset authentication information, link table and mapping encryption information and stored in the database.
[0159] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0160] Step 101, in response to the master node receiving a read / write operation request, the master node is locked.
[0161] Step 102, parse the read and write operation request, obtain key data of the read and write operation request, store the key data in the preset space of the master node, and generate control instructions.
[0162] Step 103, in response to receiving the control instruction from the slave node, locking the slave node, obtaining key data of the read and write operation request, and storing the key data in a preset space of the slave node.
[0163] Step 104, in response to the slave node locking, the master node executes the read / write operation task according to the read / write operation request, and sends the read / write operation task to the remote cluster storage.
[0164] Step 105 , in response to detecting that a fault occurs when the master node performs a read or write operation task, triggering a fault notification, and sending the fault notification to the slave node.
[0165] Step 106, in response to receiving the fault notification from the slave node, the slave node obtains key data from a preset space of the slave node, restores the read and write operation requests according to the key data, and sends the restored read and write operation requests to the remote cluster for execution.
[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0167] Sending the restored read and write operation request to the remote cluster for execution includes:
[0168] In response to the remote cluster receiving the restored read / write operation request, the remote cluster executes the restored read / write operation task according to the restored read / write operation request;
[0169] In response to completion of the restored read and write operation tasks, the remote cluster generates an end instruction and sends the end instruction to the slave node.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0171] In response to receiving the end instruction from the slave node, releasing the lock on the slave node and deleting the key data stored in the preset space of the slave node;
[0172] In response to the deletion of the key data stored in the preset space of the slave node, the slave node generates a deletion instruction and sends the deletion instruction to the master node;
[0173] In response to the master node receiving the deletion instruction, the lock of the master node is released, and the key data stored in the preset space of the master node is deleted.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0175] The key data includes data volume ID, logical block address location information, logical block address length, and read / write operation request sequence number. Storing the key data in the preset space of the master node includes storing the key data in non-volatile memory.
[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0177] The master node and the slave node are set in a local cluster, and the method also includes:
[0178] Get the data volume in the local cluster and use it as the primary volume.
[0179] Get the data volume in the remote cluster and use it as a secondary volume.
[0180] The format information of the primary volume and the secondary volume is consistent;
[0181] Establish a remote replication relationship between the primary volume and the secondary volume.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] The method also includes:
[0184] In response to the master node failure recovery, obtaining differential data from when the master node failure occurs to when the master node failure is recovered;
[0185] Establish a change data bitmap based on the difference data;
[0186] Flushes the changed data bitmap to the remote cluster.
[0187] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0188] The method also includes:
[0189] Get the ports of the local cluster device and the remote cluster device;
[0190] Configure virtual IP addresses for each local cluster device port and each remote cluster device port.
[0191] Get the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device;
[0192] Generate a link table based on the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device;
[0193] In response to receiving a read / write operation request, searching a target link from a link table;
[0194] Establish a remote replication relationship between the local cluster device and the remote cluster device based on the target link;
[0195] Wherein, the link table pair is encrypted using the preset authentication information to generate mapping encryption information of the link table;
[0196] The virtual link table information is generated according to the preset authentication information, link table and mapping encryption information and stored in the database.
[0197] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0198] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0199] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. An operation request recovery method, characterized in that: include: In response to the master node receiving a read / write operation request, locking the master node; Parse the read / write operation request, obtain key data of the read / write operation request, store the key data in a preset space of the master node, and generate a control instruction; In response to receiving the control instruction from the slave node, locking the slave node, obtaining key data of the read and write operation request, and storing the key data in a preset space of the slave node; In response to the slave node locking, the master node executes the read / write operation task according to the read / write operation request, and sends the read / write operation task to the remote cluster storage; In response to detecting that a fault occurs when the master node performs a read or write operation task, triggering a fault notification, and sending the fault notification to the slave node; In response to receiving a fault notification from a slave node, the slave node obtains key data from a preset space of the slave node, restores read and write operation requests according to the key data, and sends the restored read and write operation requests to a remote cluster for execution.
2. The method according to claim 1, characterized in that The step of sending the restored read / write operation request to the remote cluster for execution includes: In response to the remote cluster receiving the restored read / write operation request, the remote cluster executes the restored read / write operation task according to the restored read / write operation request; In response to completion of the restored read and write operation tasks, the remote cluster generates an end instruction and sends the end instruction to the slave node.
3. The method according to claim 2, characterized in that The sending of the end instruction to the slave node comprises: In response to receiving the end instruction from the slave node, releasing the lock on the slave node and deleting the key data stored in the preset space of the slave node; In response to the deletion of the key data stored in the preset space of the slave node, the slave node generates a deletion instruction and sends the deletion instruction to the master node; In response to the master node receiving the deletion instruction, the lock of the master node is released, and the key data stored in the preset space of the master node is deleted.
4. The method according to claim 1, characterized in that The key data includes data volume ID, logical block address location information, logical block address length, and read / write operation request sequence number. Storing the key data in the master node preset space includes storing the key data in a non-volatile memory.
5. The method according to claim 1, characterized in that The master node and the slave node are arranged in a local cluster, and the method further comprises: Obtain a data volume in a local cluster, and use the data volume in the local cluster as a primary volume; Obtaining a data volume in a remote cluster, and using the data volume in the remote cluster as a secondary volume; The format information of the primary volume is consistent with that of the secondary volume; A remote replication relationship between the primary volume and the secondary volume is established.
6. The method according to claim 1, characterized in that The method further comprises: In response to the master node failure recovery, obtaining differential data from when the master node failure occurs to when the master node failure is recovered; Establishing a change data bitmap according to the difference data; The changed data bitmap is flushed to the remote cluster.
7. The method according to claim 1, characterized in that The method further comprises: Get the ports of the local cluster device and the remote cluster device; Performing virtual IP configuration on each port of the local cluster device and each port of the remote cluster device respectively; Get the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device; Generate a link table based on the virtual IP information of the port of the local cluster device and the virtual IP information of the port of the remote cluster device; In response to receiving a read / write operation request, searching for a target link from the link table; Establishing a remote replication relationship between the local cluster device and the remote cluster device based on the target link; wherein the link table pair is encrypted using preset authentication information to generate mapping encryption information of the link table; Virtual link table information is generated according to the preset authentication information, the link table, and the mapping encryption information and stored in a database.
8. An operation request recovery device, characterized in that: The device comprises: The storage module is used to lock the master node in response to the master node receiving a read / write operation request; parse the read / write operation request, obtain key data of the read / write operation request, store the key data in a preset space of the master node, and generate a control instruction; in response to the slave node receiving a control instruction, lock the slave node, obtain key data of the read / write operation request, and store the key data in a preset space of the slave node; An execution module, configured to respond to the slave node locking, the master node executing the read / write operation task according to the read / write operation request, and sending the read / write operation task to the remote cluster storage; in response to detecting that a fault occurs when the master node executes the read / write operation task, trigger a fault notification, and send the fault notification to the slave node; The recovery module is used for, in response to receiving a fault notification from a slave node, the slave node obtains key data from a preset space of the slave node, recovers read and write operation requests according to the key data, and sends the recovered read and write operation requests to a remote cluster for execution.
9. A computer 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 computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
