Storage disaster recovery method and device, electronic equipment and storage medium
By synchronizing the data of the first storage cluster to the second storage cluster and performing synchronously under the input and output instructions of the target user, the problem of data loss in traditional disaster recovery methods is solved, and the disaster recovery performance of the storage system is improved.
Patent Information
- Application Number
- CN202411725836.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-15
AI Technical Summary
Traditional cyclical snapshot backup disaster recovery methods can lead to large amounts of data loss when the main cluster fails, and the storage system has low disaster recovery performance.
By synchronizing the storage data of the first storage cluster to the second storage cluster and generating corresponding input and output instructions based on the input and output instructions of the target user, it is ensured that when the data is consistent, the two storage clusters perform input and output operations simultaneously, thereby avoiding data loss.
Pre-synchronize the data of the primary storage cluster to the backup storage cluster to avoid incremental updates of the primary storage cluster to the backup storage cluster multiple times, improve the disaster recovery performance of the storage system, and reduce data loss in failure.
Smart Images

Figure CN119829335A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data storage, and in particular to a storage disaster recovery method, device, electronic device and storage medium. Background Art
[0002] As more and more core enterprise data and systems are running in the cloud, people are increasingly demanding high availability of cloud data. Occasional failures in traditional single data centers will lead to data loss for enterprises and users, causing huge losses to enterprises and users. In this context, new requirements are put forward for the disaster recovery capabilities of storage systems.
[0003] In the related art, the following can be used: Figure 1 The periodic snapshot backup disaster recovery method shown in the figure takes snapshots of the virtual block device (RadosBlockDevice, RBD) volume of the primary cluster at a certain period (for example, every 15 minutes). During the first backup, the full snapshot data will be read and written to the standby cluster. Subsequent backups can export the incremental modification data before and after the two snapshot points and synchronize them to the standby cluster.
[0004] However, in Figure 1 In the method shown, if the primary cluster fails at some point, it is necessary to switch to the backup cluster, which will result in a large amount of data loss between the time when the primary cluster fails and the time when the last backup is successful (i.e. Figure 1 The disaster recovery performance of the above storage system is still low. Summary of the invention
[0005] In view of the above problems, embodiments of the present application provide a storage disaster recovery method, apparatus, electronic device, and readable storage medium to overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect, an embodiment of the present application provides a storage disaster recovery method, the method comprising:
[0007] Synchronize the storage data of the first storage cluster to the second storage cluster;
[0008] Based on the target input / output instruction sent by the target user, generate a first input / output instruction of the first storage cluster and a second input / output instruction of the second storage cluster;
[0009] When the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, the first input-output instruction is sent to the first storage cluster, and the second input-output instruction is synchronously sent to the second storage cluster, so that the first storage cluster and the second storage cluster synchronously execute the input-output operation corresponding to the target input-output instruction.
[0010] Optionally, the method further comprises:
[0011] In the case where the second input / output instruction fails to execute, writing the failed second input / output instruction into a fault record log as an abnormal input / output instruction;
[0012] Repeat the abnormal input and output instructions in the fault record log.
[0013] Optionally, the method further comprises:
[0014] Counting the number of execution failures of the abnormal input and output instructions;
[0015] In the case where the number of execution failures is greater than or equal to the preset number of times, a fault prompt message is sent or the step of synchronizing the storage data of the first storage cluster to the second storage cluster is performed.
[0016] Optionally, the method further comprises:
[0017] When the abnormal input / output instruction is successfully executed, removing the abnormal input / output instruction from the fault record log;
[0018] When the fault record log is cleared, it is determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.
[0019] Optionally, the method further comprises:
[0020] Acquire a first number of successfully executed first input-output instructions corresponding to the target input-output instruction, and a second number of successfully executed second input-output instructions;
[0021] When the sum of the first number and the second number is equal to the total number of clusters of the first storage cluster and the second storage cluster, it is determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.
[0022] Optionally, the method further comprises:
[0023] When the second input-output instruction fails to execute and the first input-output instruction is executed successfully, execution success information for the target input-output instruction is sent to the target user, so that the target user continues to submit the input-output instruction.
[0024] Optionally, the method further comprises:
[0025] When the second input / output instruction times out, or the input / output instruction queue where the second input / output instruction is located overflows, it is determined that the execution of the second input / output instruction fails.
[0026] In a second aspect, an embodiment of the present application provides a storage disaster recovery device, the device comprising:
[0027] A synchronization module, used to synchronize the storage data of the first storage cluster to the second storage cluster;
[0028] A generating module, configured to generate a first input-output instruction of the first storage cluster and a second input-output instruction of the second storage cluster based on a target input-output instruction sent by a target user;
[0029] The first sending module is used to send the first input-output instruction to the first storage cluster and synchronously send the second input-output instruction to the second storage cluster when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, so that the first storage cluster and the second storage cluster synchronously execute the input-output operation corresponding to the target input-output instruction.
[0030] Optionally, the device further comprises:
[0031] A writing module, used for writing the failed second input / output instruction as an abnormal input / output instruction into a fault record log when the second input / output instruction fails to execute;
[0032] The execution module is used to repeatedly execute the abnormal input and output instructions in the fault record log.
[0033] Optionally, the device further comprises:
[0034] A statistics module, used to count the number of execution failures of the abnormal input and output instructions;
[0035] The second sending module is used to send fault prompt information or execute the step of synchronizing the storage data of the first storage cluster to the second storage cluster when the number of execution failures is greater than or equal to a preset number.
[0036] Optionally, the device further comprises:
[0037] A removal module, configured to remove the abnormal input and output instruction from the fault record log if the abnormal input and output instruction is successfully executed;
[0038] The first determination module is configured to determine, when the fault record log is cleared, whether the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.
[0039] Optionally, the device further comprises:
[0040] An acquisition module, used to acquire a first number of successfully executed first input-output instructions corresponding to the target input-output instruction, and a second number of successfully executed second input-output instructions;
[0041] The second determination module is configured to determine that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster when the sum of the first number and the second number is equal to the total number of clusters of the first storage cluster and the second storage cluster.
[0042] Optionally, the device further comprises:
[0043] The third sending module is used to send execution success information for the target input-output instruction to the target user when the execution of the second input-output instruction fails and the execution of the first input-output instruction succeeds, so that the target user continues to submit the input-output instruction.
[0044] Optionally, the device further comprises:
[0045] The determination module is used to determine that the execution of the second input-output instruction fails when the second input-output instruction times out or the input-output instruction queue where the second input-output instruction is located overflows.
[0046] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the storage disaster recovery method as described in any one of the above.
[0047] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the storage disaster recovery method as described in any one of the above items is implemented.
[0048] The specific beneficial effects are:
[0049] The embodiment of the present application synchronizes the storage data of the first storage cluster to the second storage cluster, generates the first input and output instructions of the first storage cluster and the second input and output instructions of the second storage cluster based on the target input and output instructions sent by the target user, and when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, sends the first input and output instructions to the first storage cluster, and synchronously sends the second input and output instructions to the second storage cluster, so that the first storage cluster and the second storage cluster synchronously execute the input and output operations corresponding to the target input and output instructions. The data of the primary storage cluster can be synchronized to the backup storage cluster in advance, and when a data storage task occurs, the data can be sent to the primary storage cluster and the backup storage cluster respectively, thereby avoiding the process of multiple incremental updates from the primary storage cluster to the backup storage cluster, and also avoiding the large-scale data loss caused by the failure of the primary storage cluster, thereby improving the disaster recovery performance of the storage system to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0051] Figure 1 It is a schematic diagram of a storage disaster recovery mode provided in an embodiment of the present application;
[0052] Figure 2 It is a flowchart of a storage disaster recovery method provided by an embodiment of the present application;
[0053] Figure 3 It is a flowchart of another storage disaster recovery method provided by an embodiment of the present application;
[0054] Figure 4 is a schematic diagram of a storage system provided in an embodiment of the present application;
[0055] Figure 5 It is a schematic diagram of a storage disaster recovery state conversion provided by an embodiment of the present application;
[0056] Figure 6 It is a logic block diagram of a storage disaster recovery device provided in an embodiment of the present application;
[0057] Figure 7 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The exemplary embodiments of the present application will be described in more detail below in conjunction with the accompanying drawings in the embodiments of the present application. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to enable the scope of the present application to be fully communicated to those skilled in the art.
[0059] Reference Figure 2 , Figure 2 A schematic diagram of a storage disaster recovery method provided in an embodiment of the present application, the method comprising:
[0060] Step 101: Synchronize storage data of a first storage cluster to a second storage cluster.
[0061] In the embodiments of the present application, data storage is to store data in a physical or logical storage medium for later use. The following is a detailed description of data storage:
[0062] Persistence: Data storage is persistent, and data can be saved in the storage medium and will not be lost due to program exit or computer shutdown.
[0063] Scalability: Data storage can be expanded as needed, can store large amounts of data, and can be expanded as the amount of data increases.
[0064] Security: Data storage needs to ensure data security, which can be protected through data encryption, access control, backup and other measures.
[0065] Efficiency: Data storage needs to ensure data efficiency. Data reading and writing speed and storage efficiency can be improved through data indexing, caching, compression and other technologies.
[0066] Data management: Data storage requires data management, including data backup, recovery, migration, cleanup and other operations to ensure data integrity and reliability.
[0067] In general, data storage is an important part of modern information technology. It not only involves data preservation and management, but also involves many aspects such as data security, availability and performance optimization.
[0068] In an embodiment of the present application, a storage cluster is a system that organizes multiple independent computer nodes (servers) through physical connections or logical means to achieve data storage and management. A storage cluster generally refers to the physical connection of independent computer nodes (servers) and the control function of allocating loads to each node (server) and managing load transfer between nodes. For enterprise data storage, a cluster usually requires a shared storage system, such as a storage area network (SAN). A method that is directly connected to each node and can replicate data in the storage system can also be used. General storage cluster applications provide fault recovery functions for key processes to ensure load balancing of high-performance processes. DAS (Direct Attached Storage), NAS (Network Attached Storage) and SAN (Storage Area Network) are three common types of storage clusters. Each type has its own unique advantages and disadvantages and is suitable for different application scenarios. The main technologies in clustered storage are block storage, file storage and object storage. Block storage is commonly found in devices such as USB flash drives, optical disks, and hard disks, and can achieve high availability through technologies such as Raid and LVM; file storage and network storage are commonly found in devices such as samba and nfs, which have low construction costs and can share storage between different hosts; object storage, distributed storage, and storage buckets have the advantages of high read and write efficiency and can share storage between different hosts, but they are expensive and difficult to implement technically. Block storage + DAS, block storage + NAS, block storage + SAN, file storage + NAS, object storage + SAN, etc. are common clustered storage architectures. These architectures have their own characteristics and can be selected according to specific needs. Storage clusters have the advantages of high availability, high throughput, strong scalability, and high cost performance. Even if a node in the cluster fails, there are still other healthy nodes that can process requests to ensure the normal operation of the system. In general, storage clusters are an efficient and reliable data storage solution that is suitable for various application scenarios that require high performance, high availability, and scalability. In actual applications, the appropriate storage cluster type and technical architecture should be selected according to specific needs.
[0069] In an embodiment of the present application, to write data to a storage cluster or read data from a storage cluster, the input and output ports of the storage cluster are required, and are implemented through an input and output process (i.e., an IO process) adapted to the input and output port. The IO process is a trigger of the IO function of the operating system initiated by an application, that is, the input and output process is called through an input and output instruction. The IO process involves transferring data from an external device (such as a hard disk, a network) to the inside of a computer, or transferring data from the inside of a computer to an external device. This process is the basis for the interaction between a computer and the outside world. Without IO operations, the computer will not be able to receive user instructions or display processing results. The IO process is crucial for any system that needs to interact with the external environment. For example, a database management system needs to frequently read and write data on a disk, and a Web server needs to process network requests from a client. IO operation modes include synchronous and asynchronous. In synchronous IO mode, the program will wait for the IO operation to complete before continuing to execute; while asynchronous IO allows the program to continue to execute other tasks while the IO operation is in progress. IO performance optimization can be performed through zero-copy technology and caching. Among them, zero-copy technology can improve IO operation efficiency by reducing the number of times data is copied between kernel space and user space. The cache strategy can use buffers to reduce frequent IO operations, thereby improving system performance.
[0070] In an embodiment of the present application, a storage cluster may refer to a device cluster composed of multiple storage devices for storing data. The first storage cluster and the second storage cluster may be in the same data storage system, wherein the first storage cluster may be a primary storage cluster and the second storage cluster may be a backup storage cluster. In order to make the data stored in the first storage cluster and the second storage cluster consistent, the storage data in the first storage cluster may be synchronized to the second storage cluster. This may be regarded as an initialization process for the data storage system where the second storage cluster and the first storage cluster are located.
[0071] Step 102 : Based on the target input / output instruction sent by the target user, generate a first input / output instruction of the first storage cluster and a second input / output instruction of the second storage cluster.
[0072] In an embodiment of the present application, a target user may send a target input / output instruction to a data storage system where the first storage cluster and the second storage cluster are located, and a first input / output instruction of the first storage cluster and a second input / output instruction of the second storage cluster may be generated according to the target input / output instruction. The first input / output instruction is used to write target data to the first storage cluster or read target data from the first storage cluster, and the second input / output instruction is used to write target data to the second storage cluster or read target data from the second storage cluster.
[0073] Step 103, when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, the first input-output instruction is sent to the first storage cluster, and the second input-output instruction is synchronously sent to the second storage cluster, so that the first storage cluster and the second storage cluster synchronously execute the input-output operation corresponding to the target input-output instruction.
[0074] In an embodiment of the present application, it is first possible to determine whether the storage data of the second storage cluster is consistent with the storage data of the first storage cluster. If the two storage data are consistent, the first input-output instruction can be sent to the first storage cluster, and the second input-output instruction can be sent to the second storage cluster at the same time, so that the first storage cluster and the second storage cluster can synchronously execute the input-output operation corresponding to the target input-output instruction. If the above input-output operation is a data write operation, the target data is written to the first storage cluster and the second storage cluster respectively based on the first input-output instruction and the second input-output instruction; if the above input-output operation is a data read operation, the target data is read from the first storage cluster and the second storage cluster to the cache device respectively based on the first input-output instruction and the second input-output instruction for the target user to view. At the same time, if the above read operation is successfully executed, the redundant copy of the target data can be deleted from the cache device so that the cache device has a larger cache space.
[0075] In an embodiment of the present application, by synchronizing the storage data of the first storage cluster to the second storage cluster, based on the target input and output instructions sent by the target user, the first input and output instructions of the first storage cluster and the second input and output instructions of the second storage cluster are generated. When the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, the first input and output instructions are sent to the first storage cluster, and the second input and output instructions are synchronously sent to the second storage cluster, so that the first storage cluster and the second storage cluster synchronously execute the input and output operations corresponding to the target input and output instructions. The data of the primary storage cluster can be synchronized to the backup storage cluster in advance, and when a data storage task occurs, the data can be sent to the primary storage cluster and the backup storage cluster respectively, thereby avoiding the process of multiple incremental updates from the primary storage cluster to the backup storage cluster, and also avoiding the large-scale data loss caused by the failure of the primary storage cluster, thereby improving the disaster recovery performance of the storage system to a certain extent.
[0076] Reference Figure 3 , Figure 3 A flowchart of another storage disaster recovery method provided in an embodiment of the present application, the method may include:
[0077] Step 201: Synchronize storage data of a first storage cluster to a second storage cluster.
[0078] In the embodiments of the present application, the implementation content of this step can refer to the embodiment content of step 101, which will not be repeated here.
[0079] Step 202 : Based on the target input / output instruction sent by the target user, generate a first input / output instruction of the first storage cluster and a second input / output instruction of the second storage cluster.
[0080] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 102, which will not be repeated here.
[0081] Step 203, when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, the first input-output instruction is sent to the first storage cluster, and the second input-output instruction is synchronously sent to the second storage cluster, so that the first storage cluster and the second storage cluster synchronously execute the input-output operation corresponding to the target input-output instruction.
[0082] In the embodiments of the present application, the implementation content of this step can refer to the implementation content of step 103, which will not be repeated here.
[0083] Step 204: When the second input / output instruction fails to execute, the failed second input / output instruction is written into a fault record log as an abnormal input / output instruction.
[0084] In the embodiments of the present application, log refers to the record generated by the system or application during operation, which is used to track and record various operations, events and error information. The following is a detailed introduction to log:
[0085] 1. Basic concepts of logs
[0086] Definition: A log is a record generated by a system or application during operation, used to track and record various operations, events, and error information.
[0087] Importance: Logs are critical for system monitoring, troubleshooting, performance optimization, and security auditing.
[0088] 2. Log Type
[0089] Operating system logs: record operating system level events, such as login / logout, system service status changes, etc.
[0090] Application log: generated by the application, recording various information when the application is running, including user behavior, transaction processing, etc.
[0091] Security log: specifically records events related to system security, such as intrusion attempts, permission changes, etc.
[0092] 3. Log Level
[0093] DEBUG: Detailed information, usually only used when diagnosing problems.
[0094] INFO: Normal messages confirming that the program is working as expected.
[0095] WARN: Warning messages indicating potential problems.
[0096] ERROR: A more serious problem that may cause the program to terminate.
[0097] FATAL: A very serious error, causing the program to terminate.
[0098] 4. Log Format
[0099] Plain text format: The most common log format, easy to read and analyze.
[0100] JSON format: structured data format, easy for programs to parse and process.
[0101] XML format: Another structured data format suitable for complex log structures.
[0102] In general, logs are an indispensable part of computer systems. They help developers and system administrators understand the operation status of the system and discover and solve problems in a timely manner. Understanding the basic concepts, types, levels, and formats of logs is essential for effectively managing and monitoring systems.
[0103] In an embodiment of the present application, if the second input-output instruction corresponding to the second storage cluster fails to execute, the second input-output instruction that failed to execute can be written into the fault record log as an abnormal input-output instruction. Among them, the execution failure means that the data transmission task corresponding to the input-output instruction is not correctly executed. The fault record log can be saved in a permanent storage device, which can play a role in power-off protection. The fault record log can be in plain text format, JSON format or XML format, which can include the second input-output instruction information that failed to execute, and the timestamp information of the instruction execution failure, and can also include the error type of the second input-output instruction execution failure.
[0104] Step 205: Repeat the execution of the abnormal input and output instructions in the fault record log.
[0105] In an embodiment of the present application, when there is abnormal input / output instruction content in the fault record log, the abnormal input / output instruction saved in the fault record log can be repeatedly executed. The frequency of repeatedly executing the abnormal input / output instruction and the maximum number of repeated executions can be manually set.
[0106] In an embodiment of the present application, when the execution of the second input / output instruction fails, the second input / output instruction that failed to execute is written into a fault record log as an abnormal input / output instruction, and the abnormal input / output instruction in the fault record log is repeatedly executed. The second input / output instruction that failed to execute can be recorded in a log, and the abnormal input / output instruction can be repeatedly executed according to the fault record log, which can ensure to a large extent that the abnormal input / output instruction is correctly executed, thereby improving the disaster recovery performance of the storage system composed of the first storage cluster and the second storage cluster to a certain extent.
[0107] Step 206, counting the number of execution failures of the abnormal input and output instructions.
[0108] In an embodiment of the present application, the number of execution failures of abnormal input and output instructions can be counted. Each abnormal input and output instruction has its corresponding number of execution failures, and when the abnormal input and output instruction is successfully executed, the number of execution failures of the abnormal input and output instruction will be reset to 0.
[0109] Step 207 : When the number of execution failures is greater than or equal to a preset number, send a fault prompt message or execute the step of synchronizing the storage data of the first storage cluster to the second storage cluster.
[0110] In an embodiment of the present application, if the number of execution failures of the abnormal input / output instruction is greater than or equal to a preset number, a fault prompt message may be sent to the target user, or a step of synchronizing the storage data of the first storage cluster to the second storage cluster may be performed. The preset number of times may be the maximum number of repeated executions of the abnormal input / output instruction. The fault prompt message may be used to prompt the target user that the data operation in the second storage cluster has failed. For example, if the target input / output instruction is a data write instruction, "second storage cluster data write failure" or similar fault prompt messages may be sent to the target user. If the target input / output instruction is a data read instruction, "second storage cluster data read failure" or similar fault prompt messages may be sent to the target user.
[0111] In an embodiment of the present application, by counting the number of execution failures of abnormal input and output instructions, when the number of execution failures is greater than or equal to a preset number, a fault prompt message is sent or the step of synchronizing the storage data of the first storage cluster to the second storage cluster is performed. When the number of execution failures of the abnormal input and output instructions reaches a preset number, a fault prompt message can be sent, or the storage data of the first storage cluster can be synchronized to the second storage cluster, which can promptly prompt the user of the fault and initialize the storage system composed of the first storage cluster and the second storage cluster, which can reduce the difference in data stored in the first storage cluster and the second storage cluster to a certain extent, and improve the disaster recovery performance of the storage system composed of the first storage cluster and the second storage cluster to a certain extent.
[0112] Step 208: If the abnormal input / output instruction is executed successfully, remove the abnormal input / output instruction from the fault record log.
[0113] In an embodiment of the present application, if the abnormal input / output instruction in the fault record log is executed successfully, the abnormal input / output instruction can be removed from the fault record log.
[0114] Step 209: when the fault record log is cleared, determine whether the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.
[0115] In an embodiment of the present application, if the fault record log is cleared, that is, there is no content related to any abnormal input and output instructions in the fault record log, it can be determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.
[0116] In an embodiment of the present application, when an abnormal input and output instruction is successfully executed, the abnormal input and output instruction is removed from the fault record log. When the fault record log is cleared, it is determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster. The data consistency between the storage data of the second storage cluster and the storage data of the first storage cluster can be determined from the perspective of the fault record log, so that the first storage cluster and the second storage cluster can ensure that the current input and output instruction is successfully executed when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, and can execute the next input and output instruction, which improves the disaster recovery performance of the storage system composed of the first storage cluster and the second storage cluster to a certain extent.
[0117] Step 210 , obtaining a first number of successfully executed first input-output instructions corresponding to the target input-output instruction and a second number of successfully executed second input-output instructions.
[0118] In an embodiment of the present application, a first number of successfully executed first input / output instructions and a second number of successfully executed second input / output instructions in the first input / output instructions and the second input / output instructions corresponding to the target input / output instructions may be obtained.
[0119] Step 211: when the sum of the first quantity and the second quantity is equal to the total number of the first storage cluster and the second storage cluster, determine that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.
[0120] In an embodiment of the present application, each first storage cluster may correspond to a first input / output instruction, and each second storage cluster may correspond to a second input / output instruction. If the sum of the first quantity and the second quantity is equal to the total number of clusters of the first storage cluster and the second storage cluster, it can be determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster. After determining that the two storage data are consistent, a prompt message can also be sent to the target user, so that the target user can continue to initiate a new input / output instruction.
[0121] In an embodiment of the present application, by obtaining a first number of successfully executed first input-output instructions corresponding to a target input-output instruction, and a second number of successfully executed second input-output instructions, when the sum of the first number and the second number is equal to the total cluster size of the first storage cluster and the second storage cluster, it is determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster. The data consistency between the storage data of the second storage cluster and the storage data of the first storage cluster can be determined from the perspective of the number of successfully executed first input-output instructions and second input-output instructions, so that the first storage cluster and the second storage cluster can ensure that the current input-output instruction is successfully executed and the next input-output instruction can be executed when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, thereby improving the disaster recovery performance of the storage system composed of the first storage cluster and the second storage cluster to a certain extent.
[0122] Step 212: When the second input-output instruction fails to execute and the first input-output instruction succeeds, send execution success information for the target input-output instruction to the target user, so that the target user continues to submit the input-output instruction.
[0123] In an embodiment of the present application, if the second input-output instruction fails to execute and the first input-output instruction is executed successfully, this means that the target user has successfully completed the data reading and writing target corresponding to the target input-output instruction in the first storage cluster. At this time, execution success information for the target input-output instruction can be sent to the target user, so that the target user can continue to submit new input-output instructions.
[0124] In an embodiment of the present application, when the second input / output instruction fails to execute and the first input / output instruction executes successfully, execution success information for the target input / output instruction is sent to the target user, so that the target user continues to submit input / output instructions. When the first input / output instruction executes successfully and the second input / output instruction fails to execute, execution success information for the target input / output instruction is sent to the target user, so that the target user can submit a new input / output instruction, thereby improving the data reading and writing efficiency of the storage system composed of the first storage cluster and the second storage cluster to a certain extent.
[0125] Step 213: when the second input / output instruction times out, or the input / output instruction queue where the second input / output instruction is located overflows, it is determined that the execution of the second input / output instruction fails.
[0126] In an embodiment of the present application, if the second input-output instruction times out, it can be determined that the second input-output instruction has failed to execute. The second input-output instruction timeout can refer to the execution time of the second input-output instruction exceeding a preset time. When the input-output instruction queue where the second input-output instruction is located overflows, the second input-output instruction cannot be correctly executed, and at this time, it can also be determined that the second input-output instruction has failed to execute.
[0127] In an embodiment of the present application, by determining that the execution of the second input-output instruction has failed when the second input-output instruction times out or the input-output instruction queue where the second input-output instruction is located overflows, the execution of the second input-output instruction can be determined to have failed when the second input-output instruction times out or the input-output instruction queue where the second input-output instruction is located overflows, thereby avoiding the situation where the storage cluster is paralyzed due to the second input-output instruction being stuck, and improving the disaster recovery performance of the storage system consisting of the first storage cluster and the second storage cluster to a certain extent.
[0128] Reference Figure 4 , Figure 4A schematic diagram of a storage system provided for an embodiment of the present application. In the figure, the storage system is composed of a first storage cluster, a second storage cluster, and a disaster recovery coordination module connecting the first storage cluster and the second storage cluster. After the target user initiates a target input and output instruction, the disaster recovery coordination module can initiate input and output sub-instructions to the first storage cluster and the second storage cluster respectively according to the target input and output instruction, so that the first storage cluster and the second storage cluster can respectively perform the target input and output tasks corresponding to the target input and output instruction according to their respective input and output sub-instructions. If the input and output sub-instructions corresponding to the second storage cluster are executed abnormally, a fault record log object can be generated in the disaster recovery coordination module and saved in a permanent storage space. The disaster recovery coordination module can re-execute the abnormal input and output sub-instructions saved in the log according to the fault record log object. If the execution is successful and the fault record in the log is cleared, it can be confirmed that the data stored in the first storage cluster and the second storage cluster are consistent. At this time, the disaster recovery coordination module can start processing the next input and output instruction.
[0129] Reference Figure 5 , Figure 5 It is a schematic diagram of a storage disaster recovery state transition provided in an embodiment of the present application.
[0130] In the figure, the first storage cluster and the second storage cluster can be initialized first, that is, the data in the first storage cluster is synchronized to the second storage cluster. After the synchronization is completed, the first storage cluster and the second storage cluster can enter a parallel submission state. At this time, the data reading and writing operations on the first storage cluster will also be performed synchronously in the second storage cluster. If the input and output sub-instructions in the second storage cluster fail to execute, the first storage cluster and the second storage cluster can enter a catch-up state. At this time, the second storage cluster can repeat the input and output sub-instructions that failed to execute before. If the number of execution failures of the above-mentioned input and output sub-instructions reaches a preset number of times, the first storage cluster and the second storage cluster can enter an error state and send an error prompt instruction to the user so that the user can manually repair the first storage cluster and the second storage cluster. After the user completes the repair, the first storage cluster and the second storage cluster can enter the initialization state again to synchronize the data in the first storage cluster to the second storage cluster.
[0131] Reference Figure 6 , Figure 6 A logical block diagram of a storage disaster recovery device provided in an embodiment of the present application, the device 600 may include:
[0132] The synchronization module 601 is used to synchronize the storage data of the first storage cluster to the second storage cluster;
[0133] A generating module 602, configured to generate a first input-output instruction of the first storage cluster and a second input-output instruction of the second storage cluster based on the target input-output instruction sent by the target user;
[0134] The first sending module 603 is used to send the first input-output instruction to the first storage cluster and synchronously send the second input-output instruction to the second storage cluster when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, so that the first storage cluster and the second storage cluster synchronously execute the input-output operation corresponding to the target input-output instruction.
[0135] Optionally, the device 600 further includes:
[0136] A writing module, used for writing the failed second input / output instruction as an abnormal input / output instruction into a fault record log when the second input / output instruction fails to execute;
[0137] The execution module is used to repeatedly execute the abnormal input and output instructions in the fault record log.
[0138] Optionally, the device 600 further includes:
[0139] A statistics module, used to count the number of execution failures of the abnormal input and output instructions;
[0140] The second sending module is used to send fault prompt information or execute the step of synchronizing the storage data of the first storage cluster to the second storage cluster when the number of execution failures is greater than or equal to a preset number.
[0141] Optionally, the device 600 further includes:
[0142] A removal module, configured to remove the abnormal input and output instruction from the fault record log if the abnormal input and output instruction is successfully executed;
[0143] The first determination module is configured to determine, when the fault record log is cleared, whether the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.
[0144] Optionally, the device 600 further includes:
[0145] An acquisition module, used to acquire a first number of successfully executed first input-output instructions corresponding to the target input-output instruction, and a second number of successfully executed second input-output instructions;
[0146] The second determination module is configured to determine that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster when the sum of the first number and the second number is equal to the total number of clusters of the first storage cluster and the second storage cluster.
[0147] Optionally, the device 600 further includes:
[0148] The third sending module is used to send execution success information for the target input-output instruction to the target user when the execution of the second input-output instruction fails and the execution of the first input-output instruction succeeds, so that the target user continues to submit the input-output instruction.
[0149] Optionally, the device 600 further includes:
[0150] The determination module is used to determine that the execution of the second input-output instruction fails when the second input-output instruction times out or the input-output instruction queue where the second input-output instruction is located overflows.
[0151] The storage disaster recovery device in the embodiment of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a GPUBOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultramobile personal computer (ultramobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0152] The storage disaster recovery device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, a Linux operating system, a Windows operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0153] The storage disaster recovery device provided in the embodiment of the present application can achieve Figures 1 to 4To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0154] The present application embodiment provides an electronic device, see Figure 7 The electronic device 70 includes: a processor 701, a memory 702, and a computer program 7021 stored in the memory 702 and executable on the processor 701. When the processor 701 executes the program, the storage disaster recovery method of the aforementioned embodiment is implemented.
[0155] In an embodiment of the present application, the memory 702 may be used to store software programs and various data. The memory 702 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 702 may include a volatile memory or a non-volatile memory, or the memory 702 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 702 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0156] The processor 701 may include one or more processing units; optionally, the processor 701 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 701.
[0157] The embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps in the storage disaster recovery method disclosed in the embodiment of the present application are implemented.
[0158] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the processor is enabled to implement the steps in the storage disaster recovery method disclosed in the embodiment of the present application.
[0159] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0160] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0161] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0162] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0163] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0164] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0165] The above is a detailed introduction to a storage disaster recovery method provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A storage disaster recovery method, characterized in that: The method comprises: Synchronize the storage data of the first storage cluster to the second storage cluster; Based on the target input / output instruction sent by the target user, generating a first input / output instruction of the first storage cluster and a second input / output instruction of the second storage cluster; When the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, the first input-output instruction is sent to the first storage cluster, and the second input-output instruction is synchronously sent to the second storage cluster, so that the first storage cluster and the second storage cluster synchronously execute the input-output operation corresponding to the target input-output instruction.
2. The method according to claim 1, characterized in that The method further comprises: In the case where the second input / output instruction fails to execute, writing the failed second input / output instruction into a fault record log as an abnormal input / output instruction; Repeat the abnormal input and output instructions in the fault record log.
3. The method according to claim 2, characterized in that The method further comprises: Counting the number of execution failures of the abnormal input and output instructions; In the case where the number of execution failures is greater than or equal to the preset number of times, a fault prompt message is sent or the step of synchronizing the storage data of the first storage cluster to the second storage cluster is performed.
4. The method according to claim 2, characterized in that: The method further comprises: When the abnormal input / output instruction is successfully executed, removing the abnormal input / output instruction from the fault record log; When the fault record log is cleared, it is determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.
5. The method according to claim 1, characterized in that The method further comprises: Acquire a first number of successfully executed first input-output instructions corresponding to the target input-output instruction, and a second number of successfully executed second input-output instructions; When the sum of the first number and the second number is equal to the total number of clusters of the first storage cluster and the second storage cluster, it is determined that the storage data of the second storage cluster is consistent with the storage data of the first storage cluster.
6. The method according to claim 1, characterized in that The method further comprises: When the second input-output instruction fails to execute and the first input-output instruction is executed successfully, execution success information for the target input-output instruction is sent to the target user, so that the target user continues to submit the input-output instruction.
7. The method according to claim 2, characterized in that: The method further comprises: When the second input / output instruction times out, or the input / output instruction queue where the second input / output instruction is located overflows, it is determined that the execution of the second input / output instruction fails.
8. A storage disaster recovery device, characterized in that: The device comprises: A synchronization module, used to synchronize the storage data of the first storage cluster to the second storage cluster; A generating module, configured to generate a first input-output instruction of the first storage cluster and a second input-output instruction of the second storage cluster based on a target input-output instruction sent by a target user; The first sending module is used to send the first input-output instruction to the first storage cluster and synchronously send the second input-output instruction to the second storage cluster when the storage data of the second storage cluster is consistent with the storage data of the first storage cluster, so that the first storage cluster and the second storage cluster synchronously execute the input-output operation corresponding to the target input-output instruction.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the storage disaster recovery method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the storage disaster recovery method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Storage disaster recovery method and apparatus, and electronic device and storage medium
WO2026114171A1