Shared storage cluster-based total backup method, product, medium and equipment
By checking and releasing backup locks in a preset order within a shared storage cluster, the problem of data inconsistency among multiple nodes in the shared storage cluster is solved, improving backup reliability and overall performance, and achieving data consistency and efficient resource utilization.
Patent Information
- Application Number
- CN202510949215.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-11-04
AI Technical Summary
Existing full backup solutions cannot control the coordination and consistency among multiple nodes in a shared storage multi-node cluster, which poses a risk of data inconsistency and cannot meet the concurrency requirements among multiple nodes.
By checking backup locks sequentially in a preset order at the start of a full backup and releasing them in reverse order at the end of the backup, combined with differentiated lock handling in exclusive and non-exclusive modes, the orderly progress of the backup process and resource control are ensured.
It improves the reliability and success rate of backups, ensures data consistency, enhances the overall performance and flexibility of the shared storage cluster, and achieves coordination consistency and resource utilization efficiency among multiple nodes.
Smart Images

Figure CN120892250A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to database technology, and in particular, to a full backup method, product, medium and equipment based on a shared storage cluster. BACKGROUND
[0002] The shared storage database cluster refers to a database being managed by multiple database management system instances, each instance running on a separate physical device node, each instance in the cluster can independently receive access requests from user clients, and each instance in the cluster can read and write objects and data in the database, when a data access conflict occurs, the database instance synchronizes data modification through network communication, and ensures data consistency between nodes.
[0003] Computer systems inevitably have internal failures, system failures and hardware failures and other problems. These problems can cause transactions in the database to stop abnormally or some data to be lost, so the database management system must have the ability to restore the database from an error state to a certain known correct state (also known as a consistent state or a complete state), which is called a database backup and recovery mechanism. Backup technology is an important part of the database management system and plays a decisive role in system reliability.
[0004] However, the full backup scheme in the existing market usually adopts a single machine full backup mode, which does not meet the requirements in the shared storage multi-node cluster, cannot control the coordination and consistency between multiple nodes, cannot control the concurrency between multiple nodes, and has the risk of data inconsistency. Therefore, in the shared storage multi-node cluster, how to make multiple nodes synchronize backup and control the concurrent backup between nodes becomes a key problem. SUMMARY
[0005] In view of the above problems, a full backup method, product, medium and equipment based on a shared storage cluster are proposed to overcome the above problems or at least partially solve the above problems.
[0006] An object of the present application is to provide a full backup method based on a shared storage cluster to improve the reliability of full backup of each node based on a shared storage cluster.
[0007] A further object of the present application is to improve the flexibility and adaptability of full backup in the shared storage cluster.
[0008] Another further object of the present application is to improve the data consistency of full backup.
[0009] In particular, the present application provides a full backup method based on a shared storage cluster, which comprises:
[0010] In response to the start of the full backup, each node in the shared storage cluster checks the backup lock in turn according to a preset order;
[0011] copying a data set cluster of the full backup, wherein the data set cluster contains all files required by the full backup;
[0012] In response to the end of the full backup, each node releases the backup lock in turn in reverse order of the preset order.
[0013] Optionally, the step of each node checking the backup lock in turn according to the preset order comprises:
[0014] determining whether the full backup is in an exclusive mode;
[0015] If the full backup is in the exclusive mode, then each node checks whether the backup exclusive lock can be held in turn according to the preset order;
[0016] If yes, then the backup exclusive lock is applied to each node in turn;
[0017] If no, then it is determined that the backup fails;
[0018] If the full backup is not in the exclusive mode, then each node applies the backup shared lock in turn according to the preset order.
[0019] Optionally, after the step of each node checking the backup lock in turn according to the preset order, the full backup method based on the shared storage cluster further comprises:
[0020] changing the shared memory state of each node in turn according to the preset order;
[0021] each node enables forced full-page writing and performs a forced log switching operation;
[0022] each node creates a checkpoint;
[0023] obtaining the backup start point of each node, and checking the uniqueness of the backup start point of each node according to the checkpoint;
[0024] recording backup start information, wherein the backup start information includes the number of each node, the backup start point, the backup mode, and the backup timestamp.
[0025] Optionally, the step of checking the uniqueness of the backup start point of each node according to the checkpoint comprises:
[0026] determining whether the backup start point of a first node in the preset order is consistent with the checkpoint;
[0027] If yes, then it is determined that the backup start point of each node is unique;
[0028] If not, the step of creating a checkpoint for each node is performed again until the backup start points of the nodes are unique.
[0029] Optionally, the step of recording the backup start information comprises:
[0030] In the case that the full backup is in the exclusive mode, the backup start information is written into a backup tag file in the data set cluster;
[0031] In the case that the full backup is in the non-exclusive mode, the backup start information is output as a return value.
[0032] Optionally, after the step of copying the data set cluster of the full backup, the full backup method based on the shared storage cluster further comprises:
[0033] In the case that the full backup is in the exclusive mode, the backup tag file is deleted.
[0034] Optionally, after the step of copying the data set cluster of the full backup, the full backup method based on the shared storage cluster further comprises:
[0035] Each node closes the forced full page write and generates a backup end log respectively;
[0036] Each node performs a log switching operation;
[0037] In response to the backup end logs being all archived, it is determined that the full backup is ended.
[0038] According to another aspect of the present application, there is also provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the full backup methods based on the shared storage cluster as described above.
[0039] According to yet another aspect of the present application, there is also provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the full backup methods based on the shared storage cluster as described above.
[0040] According to still another aspect of the present application, there is also provided a computer device comprising a memory, a processor and a computer program stored on the memory, the processor executing the computer program to implement the steps of any of the full backup methods based on the shared storage cluster as described above.
[0041] The full backup method based on the shared storage cluster of the present application realizes effective coordination and control of each node in the full backup process by checking backup locks of each node in the shared storage cluster in a preset order in turn at the beginning of full backup and releasing backup locks of each node in the reverse order of the preset order in turn at the end of full backup. Thus, the full backup method of the present application sets the order of applying backup locks and the order of releasing backup locks of each node in the shared storage cluster, ensures the orderly progress of the full backup process, avoids backup failure, data inconsistency and other problems caused by concurrent backup or resource contention among multiple nodes, improves the reliability and success rate of backup, thereby improving the accuracy of subsequent data recovery, and further improving the overall performance of the shared storage cluster.
[0042] Further, the full backup method based on the shared storage cluster of the present application realizes strict control of resource occupation and data consistency in the backup process by applying backup exclusive locks to nodes in a preset order and determining backup failure in the case of any node application failure for exclusive mode full backup, ensuring that only one backup task can exist in the system at the same time. In addition, the full backup method based on the shared storage cluster of the present application realizes allowing multiple backup tasks to exist at the same time in the non-exclusive mode by applying backup shared locks to each node in a preset order for non-exclusive mode full backup, thereby improving the concurrency and efficiency of backup. Thus, the full backup method based on the shared storage cluster of the present application realizes flexible support for different backup modes by differential lock processing for different backup modes, not only guarantees the safety of backup, but also fully utilizes cluster resources, thereby improving the flexibility and adaptability of full backup in the shared storage cluster, and further improving the overall performance.
[0043] Further, the full backup method based on the shared storage cluster of the present application provides a unified memory environment for subsequent backup operations by sequentially performing the operation of changing the shared memory state after the step of applying for a backup lock, so as to synchronize the shared memory state of each node. Meanwhile, each node opens forced full page writing and performs forced log switching operation, so as to ensure the integrity of the data page and the continuity of the log, thereby providing a strong guarantee for the reliability of the backup data and the data consistency during the recovery. In addition, each node creates a checkpoint and obtains the backup starting point of each node, checks the uniqueness of the backup starting point of each node according to the checkpoint, and records the backup starting information, so as to establish an explicit starting point and complete information record for the backup process. Thus, the full backup method based on the shared storage cluster of the present application realizes the full-link consistency anchoring from the physical state to the logical identification through the preparation operation before the multi-process full backup, provides a silent environment for the subsequent data copying operation, ensures the consistency and safety of the cluster data in the backup process, that is, improves the data consistency of the full backup, and further improves the accuracy of the subsequent data recovery.
[0044] The above and other objects, advantages and features of the present application will become more apparent from the following detailed description of some embodiments thereof, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS
[0045] Some embodiments of the present application will now be described in detail with reference to the drawings, which are provided by way of example and are not intended to limit the present application. Like reference numerals refer to like elements throughout the drawings. It should be understood that the drawings are not necessarily to scale. In the drawings:
[0046] Figure 1 is a schematic diagram of a full backup method based on a shared storage cluster according to an embodiment of the present application;
[0047] Figure 2 is a schematic diagram of a full backup starting flow in the full backup method based on the shared storage cluster according to an embodiment of the present application;
[0048] Figure 3 is a schematic diagram of a full backup ending flow in the full backup method based on the shared storage cluster according to an embodiment of the present application;
[0049] Figure 4 is a control flow chart of the full backup method based on the shared storage cluster according to an embodiment of the present application;
[0050] Figure 5 is a schematic diagram of a computer program product according to an embodiment of the present application;
[0051] Figure 6is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application;
[0052] Figure 7 is a schematic block diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0053] Exemplary embodiments of the present application will be described hereinafter with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be embodied in various forms without being limited by the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
[0054] To solve the above problems, an embodiment of the present application proposes a full backup method based on a shared storage cluster. Figure 1 is a schematic diagram of a full backup method based on a shared storage cluster according to an embodiment of the present application. As shown in Figure 1 the full backup method based on a shared storage cluster of the present embodiment can generally include:
[0055] Step S102, in response to the start of full backup, each node in the shared storage cluster checks the backup lock in turn according to a preset order. That is, in the process of performing full backup start, the backup lock can be checked in turn according to the preset order. It should be noted that the preset order can be preset as the order from small to large according to the number (which can be recorded as SCN) of each node in the shared storage cluster. Specifically, the node SCN can be pre-allocated, and each node SCN is different to identify each node.
[0056] Step S104, copying the data set cluster of full backup, wherein the data set cluster contains all the files required for full backup. Thus, after copying the data set cluster of full backup, the data backup process of full backup ends.
[0057] Step S106, in response to the end of full backup, each node releases the backup lock in turn in the reverse order of the preset order. That is, in the process of performing full backup stop, after the end of full backup, each node can release the backup lock in turn in the reverse order of the order of applying the backup lock, so as to completely end the whole process of full backup, thereby completing the full backup.
[0058] It should be noted that the shared storage cluster can include a shared storage database cluster, which means that one database is managed by multiple database management system instances, and each instance runs on a separate physical device node. Each node can independently receive access requests from user clients and independently read and write objects and data thereon. When performing backup, the nodes can communicate over a network to synchronize data modifications, thereby ensuring data consistency between nodes.
[0059] In addition, the full backup method based on the shared storage cluster according to the embodiments of the present application can be divided into the following three processes executed in sequence: (1) a process of executing full backup start (2) a process of copying data set clusters for full data backup (3) a process of executing full backup stop.
[0060] The full backup method based on the shared storage cluster according to the embodiments of the present application realizes effective coordination and control of each node during the full backup process by checking backup locks in the shared storage cluster in a predetermined order in sequence at the start of full backup, and releasing backup locks in reverse order of the predetermined order in sequence at the end of full backup.
[0061] Thus, the full backup method based on the shared storage cluster according to the embodiments of the present application sets the order of applying backup locks and the order of releasing backup locks for each node in the shared storage cluster, ensures the orderly progress of the full backup process, avoids backup failures, data inconsistencies, and other problems caused by concurrent backups or resource contention among multiple nodes, improves the reliability and success rate of backup, thereby improving the accuracy of subsequent data recovery, and further improving the overall performance of the shared storage cluster.
[0062] In some embodiments, in the step S102, that is, the step of checking backup locks in sequence in a predetermined order for each node in the process of executing full backup start can include the following steps: determining whether the full backup is in exclusive mode; if it is in exclusive mode, checking whether each node can hold a backup exclusive lock in sequence in a predetermined order; if yes, applying a backup exclusive lock to the node in sequence; if no, determining that the backup has failed; if it is not in exclusive mode, applying a backup shared lock to each node in sequence in a predetermined order.
[0063] In this embodiment, for full backup in exclusive mode, a backup exclusive lock is applied to the node in sequence in a predetermined order, and in the case of any node application failure, it is considered that there is already an exclusive backup in the shared storage cluster, so it is determined that this backup has failed, ensuring that only one backup task can exist in the system at the same time, thereby realizing strict control of resource occupation and data consistency during the backup process.
[0064] Furthermore, for full backups in non-exclusive mode, backup shared locks are applied for sequentially for each node according to a preset order. These backup shared locks can be session-level locks, allowing multiple non-exclusive backup modes to coexist in the system. Specifically, before the step of sequentially applying for backup shared locks for each node, the full backup method based on a shared storage cluster in this embodiment of the invention can also perform the following steps: sequentially checking whether each node already has other backup locks; if not, then applying for backup shared locks for each node sequentially; if so, then determining that the backup has failed. Thus, by applying for backup shared locks for full backups in non-exclusive mode, multiple backup tasks can coexist in non-exclusive mode, thereby improving the concurrency and efficiency of backups.
[0065] Therefore, the full backup method based on shared storage cluster in this embodiment of the invention achieves flexible support for different backup modes by performing differentiated locking processing for different backup modes. This ensures the security of the backup while making full use of cluster resources, thereby improving the flexibility and adaptability of full backup in shared storage clusters and further enhancing overall performance.
[0066] Figure 2 This is a schematic diagram of the full backup start process in a full backup method based on a shared storage cluster according to an embodiment of the present invention.
[0067] like Figure 2 As shown, in the process of executing a full backup start, after the steps of checking backup locks sequentially by each node in a preset order, the full backup method based on a shared storage cluster of the present invention may further include the following steps: sequentially changing the shared memory state of each node in a preset order; enabling forced full-page write on each node and performing a forced log switching operation; creating a checkpoint on each node; obtaining the backup start point (which can be denoted as startpoint) of each node and checking the uniqueness of the startpoint of each node based on the checkpoint; and recording the backup start information. It should be noted that the backup start information includes the SCN of each node, the startpoint, the backup method, and the backup timestamp. That is, the main content of the backup tag file may include the startpoint of all nodes, the nodes participating in the backup, the backup method, and the timeline of the backup.
[0068] like Figure 2As shown, in the embodiment, the flow of performing the full backup start can include the following steps: pre-checking; changing the shared memory state; starting forced full page writing; log switching; creating a checkpoint; obtaining a start point; and recording backup start information. It should be noted that the pre-checking step is the step of sequentially checking the backup lock of each node in the preset order in step S102.
[0069] In addition, as shown in Figure 2 Each node of the shared storage cluster can include a coordination node and a following node. Specifically, the coordination node can be the node initiating the backup, and the following node can be other nodes in the shared storage cluster except the node initiating the backup.
[0070] In the embodiment, the full backup method based on the shared storage cluster of the application synchronizes the shared memory state of each node by sequentially performing the operation of changing the shared memory state after the step of applying for the backup lock, thereby providing a unified memory environment for subsequent backup operations. Meanwhile, each node starts forced full page writing and performs forced log switching, thereby ensuring the integrity of the data page and the continuity of the log, and providing a strong guarantee for the reliability of the backup data and the data consistency during recovery. In addition, each node creates a checkpoint and obtains the start point of each node, checks the uniqueness of the start point of each node according to the checkpoint, and records the backup start information, thereby establishing a clear starting point and complete information record for the backup process.
[0071] Therefore, the full backup method based on the shared storage cluster of the embodiment of the application realizes full-link consistency anchoring from the physical state to the logical identification by performing the preparation operation before the full backup by multiple flows, thereby providing a silent environment for subsequent data copying operations, ensuring the consistency and security of the cluster data during the backup process, i.e., improving the data consistency of the full backup, and further improving the accuracy of subsequent data recovery.
[0072] In some embodiments, the step of checking the uniqueness of the start point of each node according to the checkpoint can include the following steps: determining whether the start point of the first node in the preset order in each node is consistent with the checkpoint; if yes, determining that the start point of each node is unique; and if no, performing the step of creating a checkpoint for each node again until the start point of each node is unique.
[0073] It should be noted that the startpoint is the unique identifier of the backup, and the record (record) of the backup end (BACKUP END) type written in the backup end log at the end of the backup is directly associated with the startpoint, and the startpoint is also used as the starting point of the recovery process. Only when all nodes participating in the backup replay the BACKUP END type record recording this startpoint, can the consistency state of the recovery be achieved. Therefore, ensuring the uniqueness of the startpoint is the core prerequisite for achieving recovery consistency.
[0074] In order to ensure the consistency of the startpoint, in the process of performing the full backup start, the node initiating the backup will first request a global checkpoint of all nodes participating, and use the checkpoint as the startpoint of the backup.
[0075] Therefore, whether the startpoint on any node is consistent with the created checkpoint can determine whether the startpoint is unique. If not, the startpoint can be corrected by re-requesting the global checkpoint until a unique startpoint is obtained.
[0076] Therefore, the full backup method based on the shared storage cluster of the embodiment of the application can determine whether the startpoint of the first node in the preset order is consistent with the created checkpoint. If not, the checkpoint is recreated until the startpoint is unique. The uniqueness of the startpoint is strictly guaranteed, the problem of confusion of the recovery starting point caused by repeated startpoint is avoided, and it is ensured that all nodes can be replayed based on the same unique identifier during the recovery process, so that the shared storage cluster can reliably achieve a consistent state during recovery, and the accuracy and reliability of subsequent recovery operations are improved.
[0077] In some embodiments, the step of recording the backup start information can include the following steps: in the case of exclusive mode full backup, the backup start information is written into a backup tag file in the data cluster; in the case of non-exclusive mode full backup, the backup start information is output as a return value.
[0078] That is, for exclusive mode full backup, a backup tag file will be written in the data cluster to record the information of this backup for recovery, so that the backup start information is persistently stored in the shared storage cluster, and the key information related to the backup can be quickly and accurately obtained during subsequent recovery.
[0079] In addition, since there can be multiple non-exclusive backups in the shared storage cluster, it is not suitable to write files in the data set cluster, and for full backup in the non-exclusive mode, all information is output as a return value at the end of the backup, and the content is consistent with exclusive backup. Therefore, conflicts and confusion caused by simultaneous writing of backup tag files by multiple backup tasks in the non-exclusive mode are avoided, and immediate acquisition and management of non-exclusive mode backup information is facilitated.
[0080] Therefore, the full backup method based on the shared storage cluster according to the embodiments of the present application improves the flexibility and accuracy of backup information management by processing the backup start information in different storage modes according to the backup mode, and provides a more reliable basis for subsequent database recovery.
[0081] Figure 3 is a schematic diagram of a full backup end process in the full backup method based on the shared storage cluster according to an embodiment of the present application. As shown in Figure 3 , the first step of the full backup stop process includes deleting the backup tag file.
[0082] That is, in the present embodiment, after the step S104, the full backup method based on the shared storage cluster of the present application can further include the following step: in the case of performing full backup in the exclusive mode, deleting the backup tag file.
[0083] In addition, after the step of copying the data set cluster of the full backup, the full backup method based on the shared storage cluster can further include the following steps: each node closes the forced full page write and generates a backup end log respectively; each node performs a log switching operation; in response to all backup end logs being archived, determining that the full backup is ended.
[0084] That is, as shown in Figure 3 , the full backup stop process can further include the following steps: deleting the backup tag file; closing the forced full page write; writing the backup end log; log switching; waiting for archiving to complete; releasing the backup lock protection. It should be noted that the step of releasing the backup lock protection is the step S106 described above. In addition, deleting the backup tag file and waiting for archiving to complete are optional steps. Specifically, for full backup in the exclusive mode, the full backup stop process performs the step of deleting the backup tag file; for full backup in the non-exclusive mode, the full backup stop process skips the step of deleting the backup tag file.
[0085] In one embodiment, the step of waiting for the archiving to complete can set an optional parameter, and the step is started when the optional parameter is set to true. In order to protect the complete availability of the backup, it is necessary to wait for all the log files on which the backup depends to be archived, and the node that initiates the backup waits until all the nodes have the record of the BACKUP END type in the log file archived before considering the backup to be complete.
[0086] The full backup method based on the shared storage cluster according to the embodiments of the present application can close the forced full page write of each node after copying the full backup data set cluster, and generate a backup end log to record the state and information of each node at the time of backup end. Meanwhile, each node performs a log switching operation to enable the log file to be updated and archived in time, and provides a clear boundary for the separation and storage of backup data and logs. In addition, the full backup is determined to be complete in response to all the backup end logs being archived, which ensures that the backup process is determined to be truly complete only after all the related logs have been safely archived, thereby avoiding the problem of incomplete or unrecoverable backup data due to unarchived logs, and ensuring the integrity and availability of the backup data, and further improving the reliability of the backup.
[0087] In some embodiments, after the step S102, the full backup method based on the shared storage cluster according to the present application can further include the following step: determining whether there is a node joining or exiting the full backup; if yes, determining that the backup fails. That is, all active nodes need to participate in the backup during the backup process, and no node is allowed to join or exit during the backup process. If a node joins or exits, the backup will fail and needs to be re-backed up.
[0088] In one embodiment, as shown in FIG. 6, the flow of performing the full backup start can include the following steps: Figure 2
[0089] (1) Pre-check: Check in each node in the shared storage cluster. If the exclusive mode full backup is performed, check whether the backup exclusive lock can be held in the node in the order of the node SCN from small to large. If any node is unsuccessful, it is considered that there is already an exclusive backup in the cluster, and the backup is determined to fail. In addition, if the non-exclusive mode full backup is performed, the session level backup lock check is performed in the order of the node SCN from small to large.
[0090] (2) Change the shared memory state: In the shared storage cluster, change the value of the shared memory state in the order of the participating node SCN from small to large until each node is successfully changed. If a node fails to change, the nodes that have been changed need to be reset, thereby ensuring the synchronization between the nodes in the shared storage cluster.
[0091] (3) Start forced full page write: in order to start forced full page write (FPW) in the modification shared memory phase, and notify other nodes to start FPW through RPC (Remote Procedure Call), the entire data page will be written into the log. When the redo operation is performed, the "partial write" data page will be found by calculating the checksum, and the complete data page saved in the log will be used to overwrite the current damaged data page, so as to recover the database.
[0092] (4) Perform log switching: specifically, forced log switching is performed. The log switching is requested by the backup node, and the other nodes are notified to perform the log switching through broadcasting.
[0093] (5) Create checkpoint: the node initiating the backup requests a global checkpoint participated by all nodes. Thus, the previous content can be flushed to the disk, and since the FPW is started, the influence of the damaged data page caused by copying during recovery can be avoided. In addition, the global checkpoint can be used as the startpoint of the backup.
[0094] (6) Obtain startpoint: after the startpoint value is obtained by requesting the global checkpoint, it can be determined on the minimum node whether the startpoint is consistent with the checkpoint requested this time. If it is consistent, it is determined that the startpoint is unique, and if it is not consistent, the global checkpoint is requested again until the obtained startpoint is unique.
[0095] (7) Record backup start information: for exclusive mode full backup, a backup tag file is written in the data cluster to record the information of this backup for recovery. The main content of the backup tag file includes: the startpoint of all nodes, the nodes participating in the backup, the backup mode, and the timeline of the backup. For non-exclusive mode full backup, since there can be multiple non-exclusive backups in the shared storage cluster, it is not suitable to write a backup tag file in the data cluster. At the end of the backup, all information consistent with the content of the backup tag file can be directly output as the return value.
[0096] Using the above method, the entire process of performing full backup start is completed, the full-link consistency anchoring from the physical state to the logical identification is realized, a silent environment is provided for subsequent data copying operations, the consistency and safety of the cluster data during the backup process are guaranteed, that is, the data consistency of the full backup is improved, and the accuracy of subsequent data recovery is further improved.
[0097] In another embodiment, as shown in FIG. 4, the process of performing full backup stop can include the following steps: Figure 3
[0098] (1) Delete backup tag file: This step is an optional step only for exclusive mode full backup. Since exclusive mode full backup will write backup tag file in the process of performing full backup start, after the copy of data set cluster is completed, the backup tag file should be deleted accordingly, so as to avoid the impact of backup tag file on the running database.
[0099] (2) Close forced full page write: At this time, the copy of data set cluster has been completed, and the high risk period of page break has been passed, therefore, the coordinator node can send a broadcast to notify all nodes to close forced full page write.
[0100] (3) Write backup end log: Each node independently generates backup end log. All nodes participating in backup need to write backup end record, which records the start point of the node. In the playback process, the records of each node are played back in the priority queue according to the principle of minimum SCN, and the record of any participating backup node BACKUP END type is played back, that is, the recovery is considered to be consistent.
[0101] (4) Perform log switching: After writing the record of BACKUP END type, in order to make this backup available as soon as possible, it is not necessary to wait for the completion of this log file, and the log switching operation is directly performed, and the coordinator node sends a broadcast to notify all nodes to perform log switching.
[0102] (5) Wait for archiving to complete: This step can also be an optional step. In order to protect the complete availability of this backup, it is necessary to wait for all the log files on which this backup depends to be archived, then the coordinator node waits for all the log files on which the record of BACKUP END type of all nodes depends to be archived before considering the backup to be completed.
[0103] (6) Release backup lock protection: At the end of the backup, the locks are released in the reverse order of the locks added at the beginning of the backup, and the backup locks are released in the order of node SCN from large to small.
[0104] Using the above method, the entire process of performing full backup stop is completed, the safety handling of the backup end phase is realized, the timely recording and availability of the backup end information are ensured, the integrity of the log on which the backup depends is guaranteed, thereby ensuring the complete availability of the full backup, and further improving the reliability of the backup end phase.
[0105] Figure 4 is a control flow chart of a full backup method based on a shared storage cluster according to an embodiment of the present application. The flow steps of the present embodiment are described in detail below with the exclusive mode as an example. Figure 4
[0106] In step S402, in response to the full backup start, each node in the shared storage cluster checks the backup exclusive lock in turn according to a preset order.
[0107] In step S404, the shared memory state of each node is changed in turn according to the preset order.
[0108] In step S406, each node starts forced full page writing and performs forced log switching operation.
[0109] In step S408, each node creates a checkpoint.
[0110] In step S410, the startpoint of each node is obtained, and the uniqueness of the startpoint of each node is checked according to the checkpoint.
[0111] In step S412, backup start information is recorded. It should be noted that the backup start information includes the SCN, startpoint, backup mode and backup timestamp of each node.
[0112] In step S414, the data set cluster of the full backup is copied. It should be noted that the data set cluster contains all the files required for the full backup.
[0113] In step S416, in response to the full backup stop, the backup tag file is deleted in the case of performing the exclusive mode full backup.
[0114] In step S418, each node closes forced full page writing and generates a backup end log respectively.
[0115] In step S420, each node performs log switching operation.
[0116] In step S422, each node releases the backup exclusive lock in turn in the reverse order of the preset order. Thus, the execution process of the full backup is completed, and the present flow ends.
[0117] Thus, the full backup method of the present embodiment sets the order of applying the backup lock and the order of releasing the backup lock of each node in the shared storage cluster, ensures the orderly performance of the full backup process, avoids the backup failure, data inconsistency and other problems caused by concurrent backup or resource contention among multiple nodes, improves the reliability and success rate of the backup, thereby improving the accuracy of subsequent data recovery, and further improves the overall performance of the shared storage cluster.
[0118] Further, the full backup method based on the shared storage cluster according to the embodiment of the present application realizes full-link consistency anchoring from a physical state to a logical identification through the preparation operation before full backup by multiple flows, provides a silent environment for subsequent data copy operation, guarantees the consistency and safety of cluster data in the backup process, that is, improves the data consistency of full backup, and further improves the accuracy of subsequent data recovery.
[0119] Further, the full backup method based on the shared storage cluster according to the embodiment of the present application realizes safe processing of the backup end stage through the steps of sequentially executing deletion of the backup tag file, closing forced full-page writing, generating a backup end log, performing log switching, waiting for log archiving, and sequentially releasing the backup exclusive lock after copying the data set cluster, ensures the timely recording and availability of the backup end information, guarantees the log integrity relied on by the backup, thereby guaranteeing the full availability of the full backup, and further improves the reliability of the backup end stage.
[0120] The embodiment also provides a computer program product 10, a computer readable storage medium 20, and a computer device 30. Figure 5 is a schematic diagram of the computer program product 10 according to an embodiment of the present application, Figure 6 is a schematic diagram of the computer readable storage medium 20 according to an embodiment of the present application, Figure 7 is a schematic block diagram of the computer device 30 according to an embodiment of the present application.
[0121] The computer program product 10 includes a computer program 11, which, when executed by the processor 32, implements the steps of any of the energy storage scheduling control methods of the energy storage system described above. The computer readable storage medium 20 has the computer program 11 stored thereon, and the computer program 11, when executed by the processor 32, implements the steps of the energy storage scheduling control method of the energy storage system according to any of the embodiments described above. The computer device 30 can include a memory 31, a processor 32, and a computer program 11 stored on the memory 31 and running on the processor 32.
[0122] The computer program 11 for performing the operation of the present application can be assembly instructions, Instruction Set Architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages and process programming languages.
[0123] The computer program 11 can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present application.
[0124] For the description of this embodiment, the computer program product 10 is a product of manufacture that contains the computer program 11.
[0125] For the description of this embodiment, the computer readable storage medium 20 is a tangible device that can retain and store computer program 11, which can be any medium (inexhaustive list) that can contain, store, communicate, propagate or transport the program 811 for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer readable storage medium 20 include the following: portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, a floppy disk, a mechanical encoding device, and any suitable combination of the foregoing. A computer readable storage medium 20, as used herein, is expressly intended to include a computer readable storage medium 20 tangibly embodying the computer program 11.
[0126] At this point, those skilled in the art will appreciate that although specific embodiments of the application have been described herein in some detail, various modifications and substitutions can be made by those skilled in the art without departing from the spirit and scope of the application as defined by the appended claims. Therefore, the scope of the application should be limited only by the appended claims and not by the foregoing description.
Claims
1. A full backup method based on a shared storage cluster, comprising: In response to the start of a full backup, each node in the shared storage cluster checks the backup lock in a preset order; Copy the dataset cluster from the full backup, wherein the dataset cluster contains all the files required for the full backup; In response to the completion of the full backup, each of the nodes releases the backup lock in reverse order of the preset sequence.
2. The full backup method based on a shared storage cluster according to claim 1, wherein, The steps for each node to check the backup lock in a preset order include: Determine whether the full backup is in exclusive mode; If it is an exclusive mode, then check in a preset order whether all the nodes can hold a backup exclusive lock; If so, then apply for the backup exclusive lock for the node in sequence; If not, the backup is considered to have failed; If it is not an exclusive mode, then backup shared locks will be requested for each of the nodes in a preset order.
3. The full backup method based on a shared storage cluster according to claim 1, wherein, After the step of checking the backup locks sequentially at each node according to a preset order, the full backup method based on the shared storage cluster further includes: The shared memory state of each node is changed sequentially according to the preset order; Each of the aforementioned nodes enables forced full-page write and performs a forced log switching operation; Each of the aforementioned nodes creates a checkpoint; Obtain the backup start point of each node, and check the uniqueness of the backup start point of each node based on the checkpoint; Record backup start information, wherein the backup start information includes the number of each node, the backup start point, the backup method, and the backup timestamp.
4. The full backup method based on a shared storage cluster according to claim 3, wherein, The step of checking the uniqueness of the backup start point of each node based on the checkpoint includes: Determine whether the backup start point of the first node in the preset order arrangement of the nodes is consistent with the checkpoint; If so, then the backup start point of each node is determined to be unique; If not, the steps for creating checkpoints for each node are repeated until the backup start point for each node is unique.
5. The full backup method based on a shared storage cluster according to claim 3, wherein, The steps for recording backup start information include: When the full backup is in exclusive mode, the backup start information is written into the backup tag file in the dataset cluster; In the case that the full backup is in non-exclusive mode, the backup start information is output as a return value.
6. The full backup method based on a shared storage cluster according to claim 5, wherein, Following the step of copying the full backup dataset cluster, the full backup method based on the shared storage cluster further includes: In the case of performing a full backup in exclusive mode, delete the backup tag file.
7. The full backup method based on a shared storage cluster according to claim 1, wherein, Following the step of copying the full backup dataset cluster, the full backup method based on the shared storage cluster further includes: Each node disables forced full-page write and generates a backup completion log. Each of the aforementioned nodes performs a log switching operation; Once all backup logs have been archived, the full backup is confirmed to be complete.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the full backup method based on a shared storage cluster as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that... When the computer program is executed by the processor, it implements the steps of the full backup method based on a shared storage cluster as described in any one of claims 1 to 7.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the full backup method based on a shared storage cluster as described in any one of claims 1 to 7.