WO2016180160A1 - Data snapshot recovery method and apparatus - Google Patents

Data snapshot recovery method and apparatus Download PDF

Info

Publication number
WO2016180160A1
WO2016180160A1 PCT/CN2016/079475 CN2016079475W WO2016180160A1 WO 2016180160 A1 WO2016180160 A1 WO 2016180160A1 CN 2016079475 W CN2016079475 W CN 2016079475W WO 2016180160 A1 WO2016180160 A1 WO 2016180160A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
data
time
snapshot
cluster manager
Prior art date
Application number
PCT/CN2016/079475
Other languages
French (fr)
Chinese (zh)
Inventor
汪彦舒
陈河堆
贾新华
白涛
郭龙波
张宗禹
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016180160A1 publication Critical patent/WO2016180160A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation

Definitions

  • the embodiment of the invention relates to the field of databases, and in particular to a method and a device for restoring data snapshots.
  • the mainstream database in the industry is a stand-alone database, such as Oracle, DB2, MySQL and so on.
  • database such as Oracle, DB2, MySQL and so on.
  • single-machine databases are increasingly unable to meet the needs of users for large storage and high performance, and the application of distributed databases is gradually becoming wider.
  • Solution 1 Use a backup tool on a single node for logical backup recovery or direct disk image backup and daily archive transaction logs. After the backup data is used to restore the backup data of each node, each node uses the transaction log to re-do the specified time.
  • the problems of this scheme are as follows: (1) Because the methods of backup and recovery of each node are adopted, and no mechanism is adopted to ensure the global consistency of the distributed database, the recovery of the database snapshot at any given time cannot be guaranteed. Global consistency; (2) During the backup process, logical backups are backed up in file units, and operations such as searching are performed to reduce the throughput of the disk, which has a great impact on the performance of the online service, resulting in low backup efficiency. (3) It takes a very long time to recover the database using the image.
  • Solution 2 Use the distributed transaction manager to coordinate when the distributed database is backed up, and only back up the single-node transaction and the distributed transactions successfully submitted by each node. This only guarantees that the backup data during the backup process and at the end of the backup is in global transactional consistency (that is, the database snapshot in the time period can be restored to be in the global transaction consistency state). If you want to restore to any time, you must rely on the transaction log and distributed transaction manager, in the playback process through the resource pool, lock and other mechanisms to achieve global transaction consistency at the moment of playback.
  • this scheme controls the data consistency at all times, resulting in performance degradation, which has a great impact on the online service; and in the process of redoing the transaction log, the data consistency at each moment is also guaranteed, and it is necessary to The resource is locked, causing the playback speed to be very slow.
  • the object of the embodiments of the present invention is to provide a method and a device for restoring a data snapshot, so as to solve at least the problem that the database snapshot of the distributed database recovery history in the related art cannot recover the database snapshot at any specified time and meet the global transaction consistency. .
  • a data snapshot recovery method including: a cluster manager in a distributed database restores data of each node connected to the cluster manager itself to a time before a specified time Data at the end of the physical backup; the cluster manager redoing the operation indicated by the transaction in the transaction log based on the execution time of the transaction in the transaction log based on the data of the last physical backup end time is obtained in the specified a data snapshot of each node at a time; wherein the transaction log is an operation performed on the data archived between the physical backup end time and the specified time.
  • the data that the cluster manager in the distributed database restores the data of each node connected to the cluster manager to the last physical backup end time before the specified time includes: the cluster manager acquires the location An active transaction list snapshot of the respective nodes acquired before the specified time, wherein the active transaction list snapshot records that one or more nodes connected to the cluster manager are active at the specified time a transaction for operating data; the cluster manager looks for a start time of the first active transaction in the active transaction list; when the start time of the first active transaction is less than the physical backup end time Retrieving, by the cluster manager, a transaction that is still active before the physical backup end time in the active transaction list snapshot to obtain data of the last physical backup end time; the start time is greater than the physical At the end of the backup, the cluster manager obtains the nodes before the specified time Near the end of a physical data backup time.
  • the cluster manager redoes the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time, and obtains each of the specified moments
  • the data snapshot of the node includes: the cluster manager is based on the The data of the last physical backup end time is redoed in the order of the execution time of the transaction in the transaction log, and the single-node transaction operation of the respective nodes indicated by the transaction in the transaction log, and at the end of the physical backup The sequence of execution times of the transactions in the transaction log between the specified times is redoed.
  • the distributed transaction operation indicated by the transaction in the transaction log obtains a snapshot of the data of the respective nodes at the specified time.
  • the method further includes: the cluster The manager periodically sends a physical backup instruction to each node connected to the cluster manager, wherein the physical backup instruction includes: a full backup instruction and/or an incremental backup instruction.
  • the method further includes: the cluster The manager periodically performs a snapshot operation on the respective nodes to obtain a snapshot of the active transaction list.
  • a data snapshot recovery apparatus which is applied to a cluster manager side in a distributed database, and includes: a recovery module, which is configured to connect each node connected to the cluster manager itself. The data is restored to the data of the last physical backup end time before the specified time; the redo module is set to redo the data in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time. The operations indicated by the office obtain a snapshot of the data of the respective nodes at the specified time, wherein the transaction log is an operation performed on the data archived between the physical backup end time and the specified time.
  • the recovery module includes: a first obtaining unit, configured to acquire an active transaction list snapshot of the respective nodes acquired last time before the specified time, where the active transaction list snapshot records a transaction for operating data that is active on one or more nodes connected to the cluster manager at a specified time; a lookup unit configured to look up a start time of the first active transaction in the active transaction list; a rollback unit, configured to roll back a transaction that is still active before the physical backup end time in the active transaction list snapshot when the start time of the first active transaction is less than the physical backup end time Obtaining data of the last physical backup end time; the second obtaining unit is set to start at the first start When the start time of the hop transaction is greater than the physical backup end time, the data of the last physical backup end time of each node before the specified time is acquired.
  • a first obtaining unit configured to acquire an active transaction list snapshot of the respective nodes acquired last time before the specified time, where the active transaction list snapshot records a transaction for operating data that is active on one or more nodes connected to the cluster manager
  • the redo module is further configured to redo the data indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time a single transaction operation of each node, and redoing the distributed transaction operation indicated by the transaction in the transaction log in an order of execution time of the transaction in the transaction log between the physical backup end time and the specified time Obtaining a snapshot of the data of each node in the specified time.
  • the apparatus further includes: a sending module, configured to periodically send a physical backup instruction to each node connected to the cluster manager, where the physical backup instruction comprises: a full backup instruction and/or an increment Backup instructions.
  • a sending module configured to periodically send a physical backup instruction to each node connected to the cluster manager, where the physical backup instruction comprises: a full backup instruction and/or an increment Backup instructions.
  • the apparatus further includes: an execution module, configured to periodically perform a snapshot operation on the respective nodes to obtain the active transaction list snapshot.
  • the embodiment of the invention further provides a computer readable storage medium storing computer executable instructions for performing a method for restoring a data snapshot of any of the above.
  • data of each node connected to the cluster manager is restored in the cluster manager in the distributed database to the data of the last physical backup end time before the specified time, and according to the data according to the transaction log.
  • the order of the execution time of the transaction rewritates the operation indicated by the transaction in the transaction log to obtain a snapshot of the data of each node at the specified time, that is, in the present embodiment, the data based on the last physical backup end time is redone according to the transaction log transaction.
  • the data snapshot of each node is obtained, so that the snapshot satisfies the global consistency, and the problem that the database snapshot of the distributed database recovery history moment cannot recover the database snapshot at any given time and meet the global transaction consistency is solved.
  • FIG. 1 is a flowchart of a method for restoring a data snapshot according to an embodiment of the present invention
  • FIG. 2 is a structural block diagram of a data snapshot recovery apparatus according to an embodiment of the present invention.
  • FIG. 3 is a block diagram 1 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention.
  • FIG. 4 is a block diagram 2 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention.
  • FIG. 5 is a block diagram 3 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a database snapshot recovery system in accordance with an alternate embodiment of the present invention.
  • FIG. 7 is a flow chart of a database snapshot recovery method in accordance with an alternative embodiment of the present invention.
  • FIG. 8 is a timing diagram of database snapshot recovery in accordance with an alternate embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for restoring a data snapshot according to an embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
  • Step 102 The cluster manager in the distributed database restores data of each node connected to the cluster manager to the data of the last physical backup end time before the specified time;
  • Step 104 The cluster manager redoes the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time, and obtains a snapshot of the data of each node at the specified time;
  • the transaction log is an operation performed on the data archived between the end of the physical backup and the specified time.
  • the data of each node connected to the cluster manager is restored to the data of the last physical backup end time before the specified time in the cluster manager in the distributed database, and based on the The data is redoed in the order of the execution time of the transaction in the transaction log, and the operation indicated by the transaction in the transaction log obtains a snapshot of the data of each node at the specified time, that is, in this embodiment, the data based on the last physical backup end time is used.
  • the transaction log transaction is redoed to obtain a snapshot of the data of each node, so that the snapshot satisfies the global consistency, thereby solving the problem that the database snapshot of the distributed database recovery history in the related art cannot be restored at any specified time and meets the global transaction consistency.
  • the data of each node connected to the cluster manager itself is restored to the data of the last physical backup end time before the specified time.
  • the implementation may be implemented as follows:
  • Step 102-1 The cluster manager obtains a snapshot of the active transaction list of each node acquired last time before the specified time, wherein the active transaction list snapshot records that one or more nodes connected to the cluster manager at the specified time are being An active transaction for operating data;
  • Step 102-2 The cluster manager searches for the start time of the first active transaction in the active transaction list
  • Step 102-3 When the start time of the first active transaction is less than the physical backup end time, the cluster manager rolls back the transaction that is still active before the physical backup end time in the active transaction list snapshot to obtain the last physical backup end. Time data
  • Step 102-4 When the start time of the first active transaction is greater than the physical backup end time, the cluster manager acquires data of the last physical backup end time of each node before the specified time.
  • the active transaction list involved in the above step 102-1 it is obtained periodically, and the earliest active transaction in the obtained active transaction list may be before the physical backup end time or After the physical backup, the corresponding transaction log is obtained according to different situations.
  • the transaction log is redoed according to the execution time of the transaction in the transaction log.
  • the operation indicated by the office is obtained by taking a snapshot of the data of each node at a specified time.
  • the method can be implemented as follows:
  • the cluster manager redoes the single-node transaction operation of each node indicated by the transaction in the transaction log based on the execution time of the transaction in the transaction log based on the data of the last physical backup end time, and according to the physical backup end time to the specified time
  • the order of execution time of transactions in the transaction log is redoed.
  • the distributed transaction operation indicated by the transaction in the transaction log obtains a snapshot of the data of each node at the specified time.
  • the first active transaction in the active transaction list is that before the end of the physical backup, when the database snapshot is obtained at the specified time, the active transaction needs to be active between the start time and the physical backup end time in the active transaction list.
  • Rollback is performed to ensure the global consistency of the snapshot before the physical backup ends. For the snapshot to the specified time after the physical backup ends, only the transaction log of the period of time is required to roll forward to obtain the global consistency data. Snapshot.
  • the cluster manager in the distributed database may restore the data of each node connected to the cluster manager to the data of the last physical backup end time before the specified time.
  • the method in this embodiment may further include: :
  • the cluster manager periodically sends a physical backup command to each node connected to itself, where the physical backup command includes: a full backup command and/or an incremental backup command, and the backup mode and the logical backup are performed by the backup mode in this embodiment. It must be much faster.
  • the database is backed up in full increments. When recovering, only one full backup data and one incremental backup data are needed to quickly recover the database, and the physical backup of the database is used. During the backup process, only the database files are copied, which has little impact on the online business.
  • the cluster manager in the distributed database may restore the data of each node connected to the data to the data of the last physical backup end time before the specified time.
  • the method in this embodiment may further include: The manager periodically performs a snapshot operation on each node to get a snapshot of the active transaction list.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention may contribute to the prior art in part or in the software product.
  • the computer software product is stored in a storage medium (such as ROM/RAM, disk, optical disk), and includes a plurality of instructions for making a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) Methods of various embodiments of the invention are performed.
  • a recovery device for the database snapshot is provided.
  • the recovery device is used to implement the foregoing embodiments and preferred embodiments, and details are not described herein.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 2 is a structural block diagram of a data snapshot recovery apparatus according to an alternative embodiment of the present invention, which is applied to a cluster manager in a distributed database. As shown in FIG. 2, the apparatus includes:
  • the recovery module 22 is configured to restore data of each node connected to the cluster manager itself to data of the last physical backup end time before the specified time;
  • the redo module 24 is coupled to the recovery module 22, and is configured to redo the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time to obtain the operation at the specified time.
  • FIG. 3 is a block diagram of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention.
  • the recovery module 22 shown in FIG. 2 includes:
  • the first obtaining unit 32 is configured to acquire an active transaction list snapshot of each node acquired last time before the specified time, wherein the active transaction list snapshot records that one or more nodes connected to the cluster manager at the specified time are being An active transaction for operating data;
  • the searching unit 34 is coupled to the first obtaining unit 32 and configured to search for a starting moment of the first active transaction in the active transaction list;
  • the rollback unit 36 is coupled to the search unit 34 and configured to roll back a transaction that is still active before the physical backup end time in the active transaction list snapshot to obtain the last physical backup end time when the start time is less than the physical backup end time.
  • the second obtaining unit 38 is coupled to the rollback unit 36, and is configured to acquire, when the start time is greater than the physical backup end time, the end of the last physical backup of each node before the specified time. Engraved data.
  • the redo module 24 involved in this embodiment is further configured to redo the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time.
  • FIG. 4 is a block diagram 2 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention.
  • a cluster manager in a distributed database restores data of each node connected to the cluster manager to a specified Before the data of the last physical backup end time before the moment, the recovery device further includes:
  • the sending module 42 is coupled to the recovery module 22 and configured to periodically send a physical backup instruction to each node connected to the cluster manager, wherein the physical backup instruction comprises: a full backup instruction and/or an incremental backup instruction.
  • FIG. 5 is a block diagram 3 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention.
  • a cluster manager in a distributed database restores data of each node connected to the cluster manager to a specified one.
  • the recovery device further includes:
  • the execution module 52 is coupled to the recovery module 22 and is configured to perform a snapshot operation on each node periodically to obtain an active transaction list snapshot.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
  • the optional embodiment adopts a periodic distributed database physical backup (including full backup and incremental backup), a daily archived transaction log, and an active transaction list snapshot captured according to a certain frequency.
  • the three basic data can be used. Restores a database snapshot at any given time and meets the global transaction consistency, and all of the above processes have no effect on the online business. That is, the embodiment used in this embodiment It is global consistency processing on the data recovered by a single node.
  • the global data consistency problem scenario caused by the distributed transaction that the snapshot time is abnormally ended in the optional embodiment includes: (1) a distributed transaction in which some nodes submit successfully and some nodes have not yet submitted; There is a distributed transaction in a part of the node submitted successfully and some of the node failed to submit, and the distributed database has not rolled back the transaction in the node that successfully submitted; (3) there are transactions that all nodes have not submitted or submitted failed.
  • the physical hot backup method is used to obtain the database backup, which has almost no negative impact on the execution of the structured query language SQL, and the backup data can be quickly recovered by using the full-time and one-time incremental backup data. .
  • FIG. 6 is a schematic diagram of a database snapshot recovery system according to an alternative embodiment of the present invention.
  • the system includes: a Data Node Cluster: a data node cluster for storing data; and a SQL Node Cluster: SQL node cluster.
  • a Data Node Cluster a data node cluster for storing data
  • a SQL Node Cluster SQL node cluster.
  • For SQL splitting and parsing Global Transaction Manager GTM (Global Transaction Manager): used to manage global transactions.
  • Cluster Manager Cluster manager for managing Data Node Cluster and SQL Node Cluster.
  • FIG. 7 is a flowchart of a database snapshot recovery method according to an alternative embodiment of the present invention. As shown in FIG. 7, the steps of the method include:
  • Step 41 Obtain an active transaction list snapshot.
  • Step 42 physical hot backup database
  • Step 43 periodically archiving the transaction log
  • the above steps 41 to 43 are used to generate basic data, and the Cluster Manager periodically issues a full or incremental backup command to each node according to the backup policy, and the Cluster Manager periodically (configurable) obtains an active transaction list snapshot from the GTM. Persistence to disk files (active transaction list files); database nodes periodically archive database transaction logs.
  • the method also includes:
  • Step 44 Obtain a backup database file, a log file, and an active transaction list file.
  • Step 45 restoring single node consistency data
  • Step 46 Restore global consistency data
  • the step 44 to the step 46 refers to restoring to a distributed database snapshot at any given time, wherein for each database node, according to the full amount + incremental backup data, the data of the single node database is restored to the backup end time.
  • sexual state A snapshot of the active transaction list at the specified time is retrieved from the active transaction list file, and the corresponding archived transaction log is retrieved. According to the active transaction list snapshot and the transaction log, all database transactions from the backup time to the specified time are rolled forward or rolled back, so that the snapshot satisfies the global consistency of the distributed database.
  • the physical hot backup of the database is adopted, and the backup and recovery are much faster than the logical backup.
  • the optional embodiment uses a full amount of incremental data to back up the database. When recovering, only one full backup data and one incremental backup data are needed to quickly recover the database.
  • This alternative embodiment adopts a physical hot backup method for the database. In the backup process, only the database file is copied, which has little impact on the online service.
  • the database snapshot can satisfy the global transaction consistency. At the specified time, the database snapshot does not exist, and some data nodes have not submitted or submitted the failed transaction. A database snapshot can be restored at any given time (to get the granularity of the active transaction list period).
  • FIG. 8 is a database snapshot according to an alternative embodiment of the present invention. Time map of recovery
  • the optional embodiment takes the MariaDB distributed system as an example, and the step of obtaining the database data consistency snapshot method includes: the initial basic data generation process includes steps 201 to 203, and the database snapshot of the specified time t7 is restored based on the initial basic data.
  • the steps include steps 204 through 211.
  • step 201 the distributed database and the hypervisor (ClusterManager, GTM) are started.
  • the time point is t0.
  • the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
  • Step 202 At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup.
  • the backup end time of node 1 is t3
  • the backup end time of node 2 is t4
  • the backup of node 3 is performed.
  • the end time is t5.
  • each node names the backup data with the backup start time and returns the backup result.
  • the Cluster Manager records the result. And persist.
  • step 203 the data node routinely archives the transaction log file, and the Cluster Manager archives the active transaction list snapshot file, wherein the archive period is configurable.
  • Step 204 Obtain a backup result file, and analyze the result file, and then obtain the latest backup data before time t7, that is, the data file backed up at time t1;
  • step 205 the physical backup data is used to restore the backup data of each node, and the node 1 is restored to the time t3.
  • Step 206 Matching the record in the snapshot file of the active transaction list to the time t6 when the snapshot of the active transaction list is obtained last time before the specified time t7, wherein the granularity of the restored snapshot is the period for obtaining the snapshot of the active transaction list;
  • Step 207 analyzing the active transaction list at time t6, obtaining the start time t2 of the first transaction in the active transaction list;
  • Step 208 Obtain a transaction log of the node time [tmin, tmax];
  • Step 209 when tmin is less than t3, use a tool to generate a rollback statement of the distributed transaction that is still active at time t6 between [tmin, t3]; when tmin is not less than t3, the step is ignored;
  • Step 210 using the tool to redo all the single-machine transactions between [t3, t6] and all distributed transactions in the set: ⁇ gtid does not exist in the active transaction list at time t6 ⁇ ⁇ ⁇ less than the next_gtid at time t6 ⁇ ;
  • step 211 the generated rollback statement is executed.
  • the application scenario of the optional embodiment is: disaster recovery of an online payment system based on a MySQL distributed cluster database;
  • the physical hot backup tool is used to back up single-node data
  • the ClusterManager periodically obtains a snapshot of the active transaction list data from the GTM, and archives the binlog log daily.
  • the steps of the alternative embodiment include:
  • step 301 the distributed database and the hypervisor (ClusterManager, GTM) are started.
  • the time point is t0.
  • the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
  • Step 302 At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup.
  • the backup end time of node 1 is t3
  • the backup end time of node 2 is t4
  • the backup of node 3 is performed.
  • the end time is t5.
  • each node names the backup data with the backup start time and returns the backup result.
  • Cluster Manager records the result file and persists it.
  • step 303 the data node archives the transaction log file daily, and the Cluster Manager archives the active transaction list snapshot file, wherein the archiving period can be 10 minutes.
  • the snapshot of the cluster database t7 is required to be restored in another production environment or an intermediate machine, and the steps of the recovery include:
  • Step 304 Obtain a backup result file, and analyze the result file, and then obtain the latest backup data before time t7, that is, the data file backed up at time t1;
  • Step 305 if it is necessary to restore the data within the last ten minutes, it is also necessary to manually copy the transaction log that is still archived in the future to the target machine;
  • Step 306 recovering the backup data of each node by using a physical hot backup tool, and the new node 1 is restored to the time t3;
  • Step 307 Matching the record in the active transaction list snapshot file to the time t6 when the snapshot of the active transaction list was last acquired before the specified time t7. (The granularity of restoring snapshots is the period of taking snapshots of active transaction lists)
  • Step 308 analyzing the active transaction list at time t6, and obtaining the start time t2 of the first transaction in the active transaction list.
  • Step 309 obtaining a transaction log of the node time [tmin, tmax];
  • Step 310 when tmin is less than t3, use the tool to generate [tmin, t3] at time t6 A rollback statement for a distributed transaction that is still active; ignore this step when tmin is not less than t3.
  • Step 311 using the tool to redo all the single-machine transactions between [t3, t6] and all distributed transactions in the set: ⁇ gtid does not exist in the active transaction list at time t6 ⁇ ⁇ ⁇ less than the next_gtid at time t6 ⁇ .
  • the physical hot backup tool is used to back up the single node data
  • the ClusterManager periodically obtains a snapshot of the active transaction list data from the GTM, and archives the binlog log daily.
  • the single-node backup data, the binlog log, and the active transaction list snapshot are taken for recovery, rollback, and redo operations, so that the database snapshot of the global transaction consistency before the operation and maintenance personnel deletes the data table by mistake.
  • the erroneous deletion data table can be exported and imported into the online system manually. The specific steps are as follows.
  • step 401 the distributed database and the hypervisor (ClusterManager, GTM) are started.
  • the time point is t0.
  • the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
  • Step 402 At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup.
  • the backup end time of node 1 is t3
  • the backup end time of node 2 is t4
  • the backup of node 3 is performed.
  • the end time is t5.
  • each node names the backup data with the backup start time and returns the backup result.
  • Cluster Manager records the result file and persists it.
  • step 403 the data node daily archives the transaction log file, and the Cluster Manager archives the active transaction list snapshot file.
  • the archiving cycle is 10 minutes.
  • the recovery of the cluster database t7 time snapshot in other production environments or intermediate machines includes the following steps:
  • Step 404 Obtain a backup result file, and analyze the result file, and then obtain the latest backup data before time t7, that is, the data file backed up at time t1.
  • Step 405 if it is necessary to restore the data within the last ten minutes, it is also necessary to manually The archived transaction log is copied to the target machine.
  • step 406 the physical backup data is used to restore the backup data of each node.
  • the new node 1 is restored to time t3.
  • Step 407 Matching the record in the active transaction list snapshot file to the time t6 when the snapshot of the active transaction list was last acquired before the specified time t7. (The granularity of restoring snapshots is the period of taking snapshots of active transaction lists)
  • step 408 the active transaction list at time t6 is analyzed, and the start time t2 of the first transaction in the active transaction list is obtained.
  • Step 409 obtaining a transaction log of the node time [tmin, tmax];
  • Step 410 When tmin is less than t3, use the tool to generate a rollback statement of the distributed transaction that is still active at time t6 between [tmin, t3]; when tmin is not less than t3, the step is ignored.
  • step 411 the tool is used to redo all the single-machine transactions between [t3, t6] and all distributed transactions in the set: ⁇ gtid does not exist in the active transaction list at time t6 ⁇ ⁇ ⁇ less than the next_gtid at time t6 ⁇ .
  • the data table file that was accidentally deleted can be derived by the above steps of the alternative embodiment. That is, you can restore to the time before the database was accidentally deleted.
  • the snapshot of the time before the deletion of the information in the alternative embodiment may be utilized.
  • the deleted data table in the database snapshot at this moment still exists, and the data table can be exported by using the database tool and re-imported into the current time database.
  • the physical hot backup tool is used to back up the single node data
  • the ClusterManager periodically obtains a snapshot of the active transaction list data from the GTM, and archives the redo log daily.
  • the single-node backup data, the redo log, and the active transaction list snapshot are obtained, and recovery, rollback, and redo operations are performed to obtain a database snapshot of the global transaction consistency before the data mutation. With this snapshot, it is possible to test the database and the room separately after improving the data distribution.
  • the steps of the process include:
  • step 501 the distributed database and the hypervisor (ClusterManager, GTM) are started.
  • the time point is t0.
  • the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
  • Step 502 At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup.
  • the backup end time of node 1 is t3
  • the backup end time of node 2 is t4
  • the backup of node 3 is performed.
  • the end time is t5.
  • each node names the backup data with the backup start time and returns the backup result.
  • Cluster Manager records the result file and persists it.
  • step 503 the data node daily archives the transaction log file, and the Cluster Manager archives the active transaction list snapshot file.
  • the archiving cycle is 10 minutes.
  • the steps involved in the present embodiment for restoring the snapshot of the cluster database t7 in other production environments or intermediate machines include:
  • Step 504 Obtain a backup result file, and analyze the result file, and then obtain the latest backup data before time t7, that is, the data file backed up at time t1.
  • step 505 if it is necessary to restore the data within the last ten minutes, it is also necessary to manually copy the transaction log that is still archived in the future to the target machine.
  • step 506 the physical backup data is used to restore the backup data of each node.
  • the new node 1 is restored to time t3.
  • step 507 the time t6 of the latest acquisition of the active transaction list snapshot before the specified time t7 is matched according to the record in the active transaction list snapshot file. (The granularity of restoring snapshots is the period of taking snapshots of active transaction lists)
  • Step 508 analyzing the active transaction list at time t6, and obtaining the start time t2 of the first transaction in the active transaction list.
  • Step 509 Obtain a transaction log of the node time [tmin, tmax];
  • Step 510 when tmin is less than t3, use the tool to generate a rollback statement of the distributed transaction that is still active at time t6 between [tmin, t3]; when tmin is not less than t3, the step is ignored.
  • Step 512 using the tool to redo all the single-machine transactions between [t3, t6] and in the collection: ⁇ gtid in There is no distributed transaction in the active transaction list at t6 ⁇ ⁇ less than next_gtid ⁇ at time t6.
  • the physical hot backup tool is used to back up single-node data before the upgrade.
  • the ClusterManager periodically obtains a snapshot of the active transaction list data from the GTM, and archives the binlog log daily.
  • the single-node backup data, the binlog log, and the active transaction list snapshot are obtained, and the recovery and rollback operations are performed to obtain a database snapshot of the global transaction consistency before the upgrade.
  • the steps of the process include:
  • step 601 the distributed database and the hypervisor (ClusterManager, GTM) are started.
  • the time point is t0.
  • the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
  • Step 602 At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup.
  • the backup end time of node 1 is t3
  • the backup end time of node 2 is t4
  • the backup of node 3 is performed.
  • the end time is t5.
  • each node names the backup data with the backup start time and returns the backup result.
  • Cluster Manager records the result file and persists it.
  • step 603 the data node daily archives the transaction log file, and the Cluster Manager archives the active transaction list snapshot file.
  • the archiving cycle is 10 minutes.
  • the steps of restoring the snapshot of the cluster database t7 in other production environments or intermediate machines include:
  • step 604 the backup result file is obtained, and the result file is analyzed, and then the latest backup data before time t7, that is, the data file backed up at time t1 is obtained.
  • step 605 if it is necessary to restore the data within the last ten minutes, it is also necessary to manually copy the transaction log that is still archived in the future to the target machine.
  • step 606 the physical backup data is used to restore the backup data of each node.
  • the new node 1 is restored to time t3.
  • Step 607 Matching the record in the active transaction list snapshot file before the specified time t7 The time t6 at which the snapshot of the active transaction list was last taken. (The granularity of restoring snapshots is the period of taking snapshots of active transaction lists)
  • step 608 the active transaction list at time t6 is analyzed, and the start time t2 of the first transaction in the active transaction list is obtained.
  • Step 609 Obtain a transaction log of the node time [tmin, tmax];
  • step 610 when tmin is less than t3, the tool is used to generate a rollback statement of the distributed transaction that is still active at time t6 between [tmin, t3]; when tmin is not less than t3, the step is ignored.
  • step 611 the tool is used to redo all the single-machine transactions between [t3, t6] and all distributed transactions in the set: ⁇ gtid does not exist in the active transaction list at time t6 ⁇ ⁇ ⁇ less than the next_gtid at time t6 ⁇ .
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the cluster manager in the distributed database restores data of each node connected to the cluster manager to data at the end of the last physical backup before the specified time;
  • the cluster manager re-does the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log according to the data of the last physical backup end time, and obtains a data snapshot of each node at the specified time, wherein the transaction log The operation of the data archived between the end of the physical backup and the specified time.
  • the method and device for restoring a data snapshot proposed by the embodiment of the present invention, wherein the method includes: the cluster manager in the distributed database restores data of each node connected to the cluster manager to a specified The data of the last physical backup end time before the moment; the cluster manager redoes the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time, and obtains the operation at the specified time at each specified time.
  • the invention solves the problem that the database snapshot of the distributed database recovery historical moment in the related art cannot recover the database snapshot that meets the specified transaction time and meets the global transaction consistency.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Retry When Errors Occur (AREA)

Abstract

A data snapshot recovery method and apparatus. The method comprises: a cluster manager in a distributed database recovering data of various nodes connected to the cluster manager up to data generated until a moment before a designated moment, when a latest physical backup ends (102); and the cluster manager redoing, on the basis of the data generated until the moment when the latest physical backup ends, operations indicated by transactions in a transaction log in an order of execution time of the transactions in the transaction log, so as to obtain data snapshots, of the various nodes, generated at the designated moment, wherein the transaction log relates to operations on data which are filed between the moment when the physical backup ends and the designated moment (104). The method solves the problem in the relevant art that a distributed database cannot recover a database snapshot which is generated at any designated moment and satisfies global transaction consistency when recovering the database snapshot generated at a historical moment.

Description

数据快照的恢复方法和装置Data snapshot recovery method and device 技术领域Technical field
本发明实施例涉及数据库领域,尤指一种数据快照的恢复方法及装置。The embodiment of the invention relates to the field of databases, and in particular to a method and a device for restoring data snapshots.
背景技术Background technique
目前,业内主流的数据库是单机数据库,如Oracle、DB2、MySQL等。随着数据量膨胀,单机数据库越来越不能满足用户对于大存储和高性能的需求,而分布式数据库的应用逐渐广泛起来。At present, the mainstream database in the industry is a stand-alone database, such as Oracle, DB2, MySQL and so on. With the expansion of data volume, single-machine databases are increasingly unable to meet the needs of users for large storage and high performance, and the application of distributed databases is gradually becoming wider.
相关技术中,分布式数据库恢复历史时刻的数据库快照主要有两种方案:In the related art, there are two main schemes for database snapshots in the history of distributed database recovery:
方案一:在单节点使用备份工具进行逻辑备份恢复或是直接进行磁盘镜像备份并日常归档事务日志。利用备份数据恢复出各个节点备份数据后,各个节点分别利用事务日志重做到指定时刻。这种方案存在的问题是:(1)由于采用的是各个节点分别备份恢复的方法,且没有采取任何机制去保证分布式数据库全局一致性,因此,不能保证恢复出的任意指定时刻数据库快照的全局一致性;(2)在备份过程中,逻辑备份以文件为单位进行备份,多了查找等操作,降低了磁盘的吞吐量,这样会对在线业务的性能影响很大,导致备份效率较低;(3)利用镜像恢复数据库花费时间非常的长。Solution 1: Use a backup tool on a single node for logical backup recovery or direct disk image backup and daily archive transaction logs. After the backup data is used to restore the backup data of each node, each node uses the transaction log to re-do the specified time. The problems of this scheme are as follows: (1) Because the methods of backup and recovery of each node are adopted, and no mechanism is adopted to ensure the global consistency of the distributed database, the recovery of the database snapshot at any given time cannot be guaranteed. Global consistency; (2) During the backup process, logical backups are backed up in file units, and operations such as searching are performed to reduce the throughput of the disk, which has a great impact on the performance of the online service, resulting in low backup efficiency. (3) It takes a very long time to recover the database using the image.
方案二:利用分布式事务管理器,在分布式数据库备份的时候做协调,只备份单节点事务和各个节点均成功提交的分布式事务。这只能保证在备份过程中和备份结束时刻的备份数据处于全局事务一致性(即恢复该时间段中的数据库快照才能处于全局事务一致性状态)。若要求恢复到任意时刻,则必须依赖事务日志和分布式事务管理器,在回放过程中通过资源池、加锁等机制实现回放过程中每一刻全局事务一致性。也就是说,这种方案在备份过程中,时刻控制数据一致性,导致了性能下降,对在线业务的影响很大;而在重做事务日志过程中也保证每一刻的数据一致性,需要对资源加锁,导致了回放速度非常慢。Solution 2: Use the distributed transaction manager to coordinate when the distributed database is backed up, and only back up the single-node transaction and the distributed transactions successfully submitted by each node. This only guarantees that the backup data during the backup process and at the end of the backup is in global transactional consistency (that is, the database snapshot in the time period can be restored to be in the global transaction consistency state). If you want to restore to any time, you must rely on the transaction log and distributed transaction manager, in the playback process through the resource pool, lock and other mechanisms to achieve global transaction consistency at the moment of playback. That is to say, in the backup process, this scheme controls the data consistency at all times, resulting in performance degradation, which has a great impact on the online service; and in the process of redoing the transaction log, the data consistency at each moment is also guaranteed, and it is necessary to The resource is locked, causing the playback speed to be very slow.
针对相关技术中分布式数据库恢复历史时刻的数据库快照不能恢复出任意指定时刻且满足全局事务一致性的数据库快照的问题,目前尚未存在有效 的解决方案。The problem that the database snapshot of the distributed database recovery history moment in the related art cannot recover the database snapshot at any given time and meets the global transaction consistency does not exist yet. s solution.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本发明实施例的目的在于提供一种数据快照的恢复方法及装置,以至少解决相关技术中分布式数据库恢复历史时刻的数据库快照不能恢复出任意指定时刻且满足全局事务一致性的数据库快照的问题。The object of the embodiments of the present invention is to provide a method and a device for restoring a data snapshot, so as to solve at least the problem that the database snapshot of the distributed database recovery history in the related art cannot recover the database snapshot at any specified time and meet the global transaction consistency. .
根据本发明实施例的一个方面,提供了一种数据快照的恢复方法,包括:分布式数据库中的集群管理器将与所述集群管理器自身连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据;所述集群管理器基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做所述事务日志中的事务所指示的操作得到在所述指定时刻所述各个节点的数据快照;其中,所述事务日志为所述物理备份结束时刻至所述指定时刻之间归档的对数据进行的操作。According to an aspect of the embodiments of the present invention, a data snapshot recovery method is provided, including: a cluster manager in a distributed database restores data of each node connected to the cluster manager itself to a time before a specified time Data at the end of the physical backup; the cluster manager redoing the operation indicated by the transaction in the transaction log based on the execution time of the transaction in the transaction log based on the data of the last physical backup end time is obtained in the specified a data snapshot of each node at a time; wherein the transaction log is an operation performed on the data archived between the physical backup end time and the specified time.
可选地,所述分布式数据库中的集群管理器将与所述集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据包括:所述集群管理器获取在所述指定时刻之前最近一次获取的所述各个节点的活跃事务列表快照,其中,所述活跃事务列表快照中记录有在所述指定时刻与所述集群管理器连接的一个或多个节点上正在活跃的用于操作数据的事务;所述集群管理器查找所述活跃事务列表中最先开始的活跃事务的开始时刻;在所述最先开始的活跃事务的开始时刻小于所述物理备份结束时刻时,所述集群管理器对所述活跃事务列表快照中在所述物理备份结束时刻之前仍活跃的事务进行回滚得到所述最近一次物理备份结束时刻的数据;在所述开始时刻大于所述物理备份结束时刻时,所述集群管理器获取所述各个节点在指定时刻之前最近一次物理备份结束时刻的数据。Optionally, the data that the cluster manager in the distributed database restores the data of each node connected to the cluster manager to the last physical backup end time before the specified time includes: the cluster manager acquires the location An active transaction list snapshot of the respective nodes acquired before the specified time, wherein the active transaction list snapshot records that one or more nodes connected to the cluster manager are active at the specified time a transaction for operating data; the cluster manager looks for a start time of the first active transaction in the active transaction list; when the start time of the first active transaction is less than the physical backup end time Retrieving, by the cluster manager, a transaction that is still active before the physical backup end time in the active transaction list snapshot to obtain data of the last physical backup end time; the start time is greater than the physical At the end of the backup, the cluster manager obtains the nodes before the specified time Near the end of a physical data backup time.
可选地,所述集群管理器基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做所述事务日志中的事务所指示的操作得到所述指定时刻所述各个节点的数据快照包括:所述集群管理器基于所述 最近一次物理备份结束时刻的数据按照所述事务日志中的事务的执行时间的顺序重做所述事务日志中事务所指示的所述各个节点的单机事务操作,以及按照在所述物理备份结束时刻到所述指定时刻之间所述事务日志中的事务的执行时间的顺序重做所述事务日志中事务所指示的分布式事务操作得到所述指定时刻所述各个节点的数据快照。Optionally, the cluster manager redoes the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time, and obtains each of the specified moments The data snapshot of the node includes: the cluster manager is based on the The data of the last physical backup end time is redoed in the order of the execution time of the transaction in the transaction log, and the single-node transaction operation of the respective nodes indicated by the transaction in the transaction log, and at the end of the physical backup The sequence of execution times of the transactions in the transaction log between the specified times is redoed. The distributed transaction operation indicated by the transaction in the transaction log obtains a snapshot of the data of the respective nodes at the specified time.
可选地,在分布式数据库中的集群管理器将与所述集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据之前,所述方法还包括:所述集群管理器周期性向与所述集群管理器连接的各个节点发送物理备份指令,其中,所述物理备份指令包括:全量备份指令和/或增量备份指令。Optionally, before the cluster manager in the distributed database restores the data of each node connected to the cluster manager to the data of the last physical backup end time before the specified time, the method further includes: the cluster The manager periodically sends a physical backup instruction to each node connected to the cluster manager, wherein the physical backup instruction includes: a full backup instruction and/or an incremental backup instruction.
可选地,在分布式数据库中的集群管理器将与所述集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据之前,所述方法还包括:所述集群管理器周期性对所述各个节点执行快照操作得到所述活跃事务列表快照。Optionally, before the cluster manager in the distributed database restores the data of each node connected to the cluster manager to the data of the last physical backup end time before the specified time, the method further includes: the cluster The manager periodically performs a snapshot operation on the respective nodes to obtain a snapshot of the active transaction list.
根据本发明实施例的另一个方面,提供了一种数据快照的恢复装置,应用于分布式数据库中的集群管理器侧,包括:恢复模块,设置为将与自身所在集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据;重做模块,设置为基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做所述事务日志中的事务所指示的操作得到在所述指定时刻所述各个节点的数据快照,其中,所述事务日志为所述物理备份结束时刻至所述指定时刻之间归档的对数据进行的操作。According to another aspect of the embodiments of the present invention, a data snapshot recovery apparatus is provided, which is applied to a cluster manager side in a distributed database, and includes: a recovery module, which is configured to connect each node connected to the cluster manager itself. The data is restored to the data of the last physical backup end time before the specified time; the redo module is set to redo the data in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time The operations indicated by the office obtain a snapshot of the data of the respective nodes at the specified time, wherein the transaction log is an operation performed on the data archived between the physical backup end time and the specified time.
可选地,所述恢复模块包括:第一获取单元,设置为获取在所述指定时刻之前最近一次获取的所述各个节点的活跃事务列表快照,其中,所述活跃事务列表快照中记录有在所述指定时刻与所述集群管理器连接的一个或多个节点上正在活跃的用于操作数据的事务;查找单元,设置为查找所述活跃事务列表中最先开始的活跃事务的开始时刻;回滚单元,设置为在所述最先开始的活跃事务的开始时刻小于所述物理备份结束时刻时,对所述活跃事务列表快照中在所述物理备份结束时刻之前仍活跃的事务进行回滚得到所述最近一次物理备份结束时刻的数据;第二获取单元,设置为在所述最先开始的活 跃事务的开始时刻大于所述物理备份结束时刻时,获取所述各个节点在指定时刻之前最近一次物理备份结束时刻的数据。Optionally, the recovery module includes: a first obtaining unit, configured to acquire an active transaction list snapshot of the respective nodes acquired last time before the specified time, where the active transaction list snapshot records a transaction for operating data that is active on one or more nodes connected to the cluster manager at a specified time; a lookup unit configured to look up a start time of the first active transaction in the active transaction list; a rollback unit, configured to roll back a transaction that is still active before the physical backup end time in the active transaction list snapshot when the start time of the first active transaction is less than the physical backup end time Obtaining data of the last physical backup end time; the second obtaining unit is set to start at the first start When the start time of the hop transaction is greater than the physical backup end time, the data of the last physical backup end time of each node before the specified time is acquired.
可选地,所述重做模块,还设置为基于所述最近一次物理备份结束时刻的数据按照所述事务日志中的事务的执行时间的顺序重做所述事务日志中事务所指示的所述各个节点的单机事务操作,以及按照在所述物理备份结束时刻到所述指定时刻之间所述事务日志中的事务的执行时间的顺序重做所述事务日志中事务所指示的分布式事务操作得到所述指定时刻所述各个节点的数据快照。Optionally, the redo module is further configured to redo the data indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time a single transaction operation of each node, and redoing the distributed transaction operation indicated by the transaction in the transaction log in an order of execution time of the transaction in the transaction log between the physical backup end time and the specified time Obtaining a snapshot of the data of each node in the specified time.
可选地,在所述装置还包括:发送模块,设置为周期性向与所述集群管理器连接的各个节点发送物理备份指令,其中,所述物理备份指令包括:全量备份指令和/或增量备份指令。Optionally, the apparatus further includes: a sending module, configured to periodically send a physical backup instruction to each node connected to the cluster manager, where the physical backup instruction comprises: a full backup instruction and/or an increment Backup instructions.
可选地,所述装置还包括:执行模块,设置为周期性对所述各个节点执行快照操作得到所述活跃事务列表快照。Optionally, the apparatus further includes: an execution module, configured to periodically perform a snapshot operation on the respective nodes to obtain the active transaction list snapshot.
本发明实施例还提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行上述任一项的数据快照的恢复方法。The embodiment of the invention further provides a computer readable storage medium storing computer executable instructions for performing a method for restoring a data snapshot of any of the above.
通过本发明实施例,采用在分布式数据库中的集群管理器中将与集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据,并基于该数据按照事务日志中的事务的执行时间的顺序重做事务日志中的事务所指示的操作得到在指定时刻各个节点的数据快照,即在本实施例中采用基于最近一次物理备份结束时刻的数据按照事务日志事务重做得到各个节点的数据快照,从而使得该快照满足了全局一致性,进而解决了相关技术中分布式数据库恢复历史时刻的数据库快照不能恢复出任意指定时刻且满足全局事务一致性的数据库快照的问题。According to the embodiment of the present invention, data of each node connected to the cluster manager is restored in the cluster manager in the distributed database to the data of the last physical backup end time before the specified time, and according to the data according to the transaction log. The order of the execution time of the transaction rewritates the operation indicated by the transaction in the transaction log to obtain a snapshot of the data of each node at the specified time, that is, in the present embodiment, the data based on the last physical backup end time is redone according to the transaction log transaction. The data snapshot of each node is obtained, so that the snapshot satisfies the global consistency, and the problem that the database snapshot of the distributed database recovery history moment cannot recover the database snapshot at any given time and meet the global transaction consistency is solved.
本发明实施例的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the embodiments of the invention will be set forth in the description in the description which The objectives and other advantages of the invention may be realized and obtained by means of the structure particularly pointed in the appended claims.
在阅读并理解了附图和详细描述后,可以明白其他方面。 Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
此处所说明的附图用来提供对本发明实施例的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings are intended to provide a further understanding of the embodiments of the present invention, and are intended to be a part of the present invention, and the description of the present invention is not intended to limit the invention. In the drawing:
图1是根据本发明实施例的数据快照的恢复方法的流程图;1 is a flowchart of a method for restoring a data snapshot according to an embodiment of the present invention;
图2是根据本发明实施例的数据快照的恢复装置的结构框图;2 is a structural block diagram of a data snapshot recovery apparatus according to an embodiment of the present invention;
图3是根据本发明实施例的数据快照的恢复装置的可选结构框图一;3 is a block diagram 1 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention;
图4是根据本发明实施例的数据快照的恢复装置的可选结构框图二;4 is a block diagram 2 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention;
图5是根据本发明实施例的数据快照的恢复装置的可选结构框图三;FIG. 5 is a block diagram 3 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention; FIG.
图6是根据本发明可选实施例的数据库快照恢复系统的示意图;6 is a schematic diagram of a database snapshot recovery system in accordance with an alternate embodiment of the present invention;
图7是根据本发明可选实施例的数据库快照恢复方法的流程图;7 is a flow chart of a database snapshot recovery method in accordance with an alternative embodiment of the present invention;
图8是根据本发明可选实施例的数据库快照恢复的时间图。8 is a timing diagram of database snapshot recovery in accordance with an alternate embodiment of the present invention.
本发明的较佳实施方式Preferred embodiment of the invention
为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It is to be understood that the terms "first", "second" and the like in the specification and claims of the present invention are used to distinguish similar objects, and are not necessarily used to describe a particular order or order.
在本实施例中提供了一种数据快照的恢复方法,图1是根据本发明实施例的数据快照的恢复方法的流程图,如图1所示,该流程包括如下步骤:A method for restoring a data snapshot is provided in this embodiment. FIG. 1 is a flowchart of a method for restoring a data snapshot according to an embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
步骤102,分布式数据库中的集群管理器将与集群管理器连接自身的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据;Step 102: The cluster manager in the distributed database restores data of each node connected to the cluster manager to the data of the last physical backup end time before the specified time;
步骤104,集群管理器基于最近一次物理备份结束时刻的数据,按照事务日志中的事务的执行时间的顺序重做事务日志中的事务所指示的操作,得到在指定时刻各个节点的数据快照;其中,事务日志为物理备份结束时刻至指定时刻之间归档的对数据进行的操作。 Step 104: The cluster manager redoes the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time, and obtains a snapshot of the data of each node at the specified time; The transaction log is an operation performed on the data archived between the end of the physical backup and the specified time.
由本实施例的上述步骤102至步骤104可知,在分布式数据库中的集群管理器中将与集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据,并基于该数据按照事务日志中的事务的执行时间的顺序重做事务日志中的事务所指示的操作得到在指定时刻各个节点的数据快照,即在本实施例中采用基于最近一次物理备份结束时刻的数据按照事务日志事务重做得到各个节点的数据快照,从而使得该快照满足了全局一致性,进而解决了相关技术中分布式数据库恢复历史时刻的数据库快照不能恢复出任意指定时刻且满足全局事务一致性的数据库快照的问题。It can be seen from the above steps 102 to 104 of the embodiment that the data of each node connected to the cluster manager is restored to the data of the last physical backup end time before the specified time in the cluster manager in the distributed database, and based on the The data is redoed in the order of the execution time of the transaction in the transaction log, and the operation indicated by the transaction in the transaction log obtains a snapshot of the data of each node at the specified time, that is, in this embodiment, the data based on the last physical backup end time is used. The transaction log transaction is redoed to obtain a snapshot of the data of each node, so that the snapshot satisfies the global consistency, thereby solving the problem that the database snapshot of the distributed database recovery history in the related art cannot be restored at any specified time and meets the global transaction consistency. The problem with database snapshots.
对于本实施例中上述步骤102中涉及到的分布式数据库中的集群管理器将与集群管理器自身连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据的方式,在本实施例的可选实施方式中,可以通过如下方式来实现:For the cluster manager in the distributed database involved in the above step 102 in the embodiment, the data of each node connected to the cluster manager itself is restored to the data of the last physical backup end time before the specified time. In an optional implementation manner of the embodiment, the implementation may be implemented as follows:
步骤102-1:集群管理器获取在指定时刻之前最近一次获取的各个节点的活跃事务列表快照,其中,活跃事务列表快照中记录有在指定时刻与集群管理器连接的一个或多个节点上正在活跃的用于操作数据的事务;Step 102-1: The cluster manager obtains a snapshot of the active transaction list of each node acquired last time before the specified time, wherein the active transaction list snapshot records that one or more nodes connected to the cluster manager at the specified time are being An active transaction for operating data;
步骤102-2:集群管理器查找活跃事务列表中最先开始的活跃事务的开始时刻;Step 102-2: The cluster manager searches for the start time of the first active transaction in the active transaction list;
步骤102-3:在最先开始的活跃事务的开始时刻小于物理备份结束时刻时,集群管理器对活跃事务列表快照中在物理备份结束时刻之前仍活跃的事务进行回滚得到最近一次物理备份结束时刻的数据;Step 102-3: When the start time of the first active transaction is less than the physical backup end time, the cluster manager rolls back the transaction that is still active before the physical backup end time in the active transaction list snapshot to obtain the last physical backup end. Time data
步骤102-4:在最先开始的活跃事务的开始时刻大于物理备份结束时刻时,集群管理器获取各个节点在指定时刻之前最近一次物理备份结束时刻的数据。Step 102-4: When the start time of the first active transaction is greater than the physical backup end time, the cluster manager acquires data of the last physical backup end time of each node before the specified time.
需要说明的是,对于上述步骤102-1中涉及到的活跃事务列表,是通过周期性进行获取的,而获取到的活跃事务列表中的最早开始的活跃事务可以是在物理备份结束时刻之前或物理备份之后,进而根据不同的情况分别获取对应的事务日志。It should be noted that, for the active transaction list involved in the above step 102-1, it is obtained periodically, and the earliest active transaction in the obtained active transaction list may be before the physical backup end time or After the physical backup, the corresponding transaction log is obtained according to different situations.
对于本实施例中步骤104中涉及到的集群管理器基于最近一次物理备份结束时刻的数据,按照事务日志中的事务的执行时间的顺序重做事务日志中 的事务所指示的操作得到在指定时刻各个节点的数据快照的方式,在本实施例的可选实施方式中,可以通过如下方式来实现:For the cluster manager involved in step 104 in this embodiment, based on the data of the last physical backup end time, the transaction log is redoed according to the execution time of the transaction in the transaction log. The operation indicated by the office is obtained by taking a snapshot of the data of each node at a specified time. In an optional implementation manner of this embodiment, the method can be implemented as follows:
集群管理器基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做事务日志中事务所指示的各个节点的单机事务操作,以及按照在物理备份结束时刻到指定时刻之间事务日志中的事务的执行时间的顺序重做事务日志中事务所指示的分布式事务操作得到指定时刻各个节点的数据快照。The cluster manager redoes the single-node transaction operation of each node indicated by the transaction in the transaction log based on the execution time of the transaction in the transaction log based on the data of the last physical backup end time, and according to the physical backup end time to the specified time The order of execution time of transactions in the transaction log is redoed. The distributed transaction operation indicated by the transaction in the transaction log obtains a snapshot of the data of each node at the specified time.
也就是说,在活跃事务列表中最先开始的活跃事务是在物理备份结束之前时,在得到指定时刻的数据库快照时,需要对活跃事务列表中在开始时刻到物理备份结束时刻之间活跃事务进行回滚,这样才能保证物理备份结束前的快照的全局一致性,而对于物理备份结束之后到指定时刻的快照,只需要根据该段时间的事务日志进行前滚就能得到全局一致性的数据快照。That is to say, the first active transaction in the active transaction list is that before the end of the physical backup, when the database snapshot is obtained at the specified time, the active transaction needs to be active between the start time and the physical backup end time in the active transaction list. Rollback is performed to ensure the global consistency of the snapshot before the physical backup ends. For the snapshot to the specified time after the physical backup ends, only the transaction log of the period of time is required to roll forward to obtain the global consistency data. Snapshot.
而在本实施例的步骤102分布式数据库中的集群管理器将与集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据之前,本实施例的方法还可以包括:In the step 102 of the embodiment, the cluster manager in the distributed database may restore the data of each node connected to the cluster manager to the data of the last physical backup end time before the specified time. The method in this embodiment may further include: :
集群管理器周期性向与自身连接的各个节点发送物理备份指令,其中,物理备份指令包括:全量备份指令和/或增量备份指令,通过本实施例的该备份方式,执行备份和恢复较逻辑备份都要快很多。除此之外,采取全量加增量的方式备份数据库,恢复的时候只需要一份全量的备份数据和一份增量的备份数据就可快速恢复数据库,而采用对数据库物理备份的方式,在备份过程中只是拷贝数据库文件,对在线业务影响极小。The cluster manager periodically sends a physical backup command to each node connected to itself, where the physical backup command includes: a full backup command and/or an incremental backup command, and the backup mode and the logical backup are performed by the backup mode in this embodiment. It must be much faster. In addition, the database is backed up in full increments. When recovering, only one full backup data and one incremental backup data are needed to quickly recover the database, and the physical backup of the database is used. During the backup process, only the database files are copied, which has little impact on the online business.
而在本实施例的步骤102分布式数据库中的集群管理器将与自身连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据之前,本实施例的方法还可以包括:集群管理器周期性对各个节点执行快照操作得到活跃事务列表快照。In the step 102 of the embodiment, the cluster manager in the distributed database may restore the data of each node connected to the data to the data of the last physical backup end time before the specified time. The method in this embodiment may further include: The manager periodically performs a snapshot operation on each node to get a snapshot of the active transaction list.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的 形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation. Based on such understanding, the technical solution of the present invention may contribute to the prior art in part or in the software product. Formally embodied, the computer software product is stored in a storage medium (such as ROM/RAM, disk, optical disk), and includes a plurality of instructions for making a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) Methods of various embodiments of the invention are performed.
在本实施例中还提供了一种数据库快照的恢复装置,该恢复装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In the embodiment, a recovery device for the database snapshot is provided. The recovery device is used to implement the foregoing embodiments and preferred embodiments, and details are not described herein. As used below, the term "module" may implement a combination of software and/or hardware of a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
图2是根据本发明可选实施例的数据快照的恢复装置的结构框图,应用于分布式数据库中的集群管理器中,如图2所示,该装置包括:2 is a structural block diagram of a data snapshot recovery apparatus according to an alternative embodiment of the present invention, which is applied to a cluster manager in a distributed database. As shown in FIG. 2, the apparatus includes:
恢复模块22,设置为将与自身所在集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据;The recovery module 22 is configured to restore data of each node connected to the cluster manager itself to data of the last physical backup end time before the specified time;
重做模块24,与恢复模块22耦合连接,设置为基于最近一次物理备份结束时刻的数据,按照事务日志中的事务的执行时间的顺序重做事务日志中的事务所指示的操作得到在指定时刻各个节点的数据快照,其中,事务日志为物理备份结束时刻至指定时刻之间归档的对数据进行的操作。The redo module 24 is coupled to the recovery module 22, and is configured to redo the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time to obtain the operation at the specified time. A snapshot of the data of each node, wherein the transaction log is an operation performed on the data archived between the physical backup end time and the specified time.
图3是根据本发明实施例的数据快照的恢复装置的可选结构框图一,如图3所示,图2中所示的恢复模块22包括:FIG. 3 is a block diagram of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention. As shown in FIG. 3, the recovery module 22 shown in FIG. 2 includes:
第一获取单元32,设置为获取在指定时刻之前最近一次获取的各个节点的活跃事务列表快照,其中,活跃事务列表快照中记录有在指定时刻与集群管理器连接的一个或多个节点上正在活跃的用于操作数据的事务;The first obtaining unit 32 is configured to acquire an active transaction list snapshot of each node acquired last time before the specified time, wherein the active transaction list snapshot records that one or more nodes connected to the cluster manager at the specified time are being An active transaction for operating data;
查找单元34,与第一获取单元32耦合连接,设置为查找活跃事务列表中最先开始的活跃事务的开始时刻;The searching unit 34 is coupled to the first obtaining unit 32 and configured to search for a starting moment of the first active transaction in the active transaction list;
回滚单元36,与查找单元34耦合连接,设置为在开始时刻小于物理备份结束时刻时,对活跃事务列表快照中在物理备份结束时刻之前仍活跃的事务进行回滚得到最近一次物理备份结束时刻的数据;The rollback unit 36 is coupled to the search unit 34 and configured to roll back a transaction that is still active before the physical backup end time in the active transaction list snapshot to obtain the last physical backup end time when the start time is less than the physical backup end time. The data;
第二获取单元38,与回滚单元36耦合连接,设置为在开始时刻大于物理备份结束时刻时,获取各个节点在指定时刻之前最近一次物理备份结束时 刻的数据。The second obtaining unit 38 is coupled to the rollback unit 36, and is configured to acquire, when the start time is greater than the physical backup end time, the end of the last physical backup of each node before the specified time. Engraved data.
基于图3中恢复模块22中的单元,本实施例中涉及到的重做模块24,还用于基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做事务日志中事务所指示的各个节点的单机事务操作,以及按照在物理备份结束时刻到指定时刻之间事务日志中的事务的执行时间的顺序重做事务日志中事务所指示的分布式事务操作得到指定时刻各个节点的数据快照Based on the unit in the recovery module 22 in FIG. 3, the redo module 24 involved in this embodiment is further configured to redo the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time. The single transaction operation of each node indicated by the medium office, and the distributed transaction operation indicated by the transaction in the transaction log in the order of the execution time of the transaction in the transaction log between the physical backup end time and the specified time to obtain the specified time Data snapshot of each node
图4是根据本发明实施例的数据快照的恢复装置的可选结构框图二,如图4所示,在分布式数据库中的集群管理器将与集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据之前,恢复装置还包括:4 is a block diagram 2 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention. As shown in FIG. 4, a cluster manager in a distributed database restores data of each node connected to the cluster manager to a specified Before the data of the last physical backup end time before the moment, the recovery device further includes:
发送模块42,与恢复模块22耦合连接,设置为周期性向与集群管理器连接的各个节点发送物理备份指令,其中,物理备份指令包括:全量备份指令和/或增量备份指令。The sending module 42 is coupled to the recovery module 22 and configured to periodically send a physical backup instruction to each node connected to the cluster manager, wherein the physical backup instruction comprises: a full backup instruction and/or an incremental backup instruction.
图5是根据本发明实施例的数据快照的恢复装置的可选结构框图三,如图5所示,在分布式数据库中的集群管理器将与集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据之前,恢复装置还包括:5 is a block diagram 3 of an optional structure of a data snapshot recovery apparatus according to an embodiment of the present invention. As shown in FIG. 5, a cluster manager in a distributed database restores data of each node connected to the cluster manager to a specified one. Before the data of the last physical backup end time before the moment, the recovery device further includes:
执行模块52,与恢复模块22耦合连接,设置为周期性对各个节点执行快照操作得到活跃事务列表快照。The execution module 52 is coupled to the recovery module 22 and is configured to perform a snapshot operation on each node periodically to obtain an active transaction list snapshot.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。It should be noted that each of the above modules may be implemented by software or hardware. For the latter, the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
下面结合本发明的可选实施例对本发明进行举例说明;The invention is exemplified below in conjunction with an alternative embodiment of the invention;
本可选实施例采用了基于定期的分布式数据库物理备份(包括全量备份和增量备份)、日常归档的事务日志、按照某种频率抓取的活跃事务列表快照,这3种基础数据来可恢复出任意指定时刻且满足全局事务一致性的数据库快照,并且以上所有过程均对在线业务不产生影响。即本实施例中采用的 是在单节点恢复的数据上,做全局一致性的处理。The optional embodiment adopts a periodic distributed database physical backup (including full backup and incremental backup), a daily archived transaction log, and an active transaction list snapshot captured according to a certain frequency. The three basic data can be used. Restores a database snapshot at any given time and meets the global transaction consistency, and all of the above processes have no effect on the online business. That is, the embodiment used in this embodiment It is global consistency processing on the data recovered by a single node.
对于本可选实施例中涉及到的快照时刻非正常结束的分布式事务引发的全局数据一致性问题场景包括:(1)存在部分节点提交成功而部分节点还未提交的分布式事务;(2)存在分布式事务在部分节点中提交成功而部分节点提交失败,且分布式数据库还未将提交成功的节点中该事务回滚;(3)存在所有节点均未提交或提交失败的事务。The global data consistency problem scenario caused by the distributed transaction that the snapshot time is abnormally ended in the optional embodiment includes: (1) a distributed transaction in which some nodes submit successfully and some nodes have not yet submitted; There is a distributed transaction in a part of the node submitted successfully and some of the node failed to submit, and the distributed database has not rolled back the transaction in the node that successfully submitted; (3) there are transactions that all nodes have not submitted or submitted failed.
此外,在本可选实施例中采用物理热备份的方法获取数据库备份,对结构化查询语言SQL的执行几乎不产生负面影响,并且利用一次全量和一次增量备份数据,可以快速恢复出备份数据。In addition, in the alternative embodiment, the physical hot backup method is used to obtain the database backup, which has almost no negative impact on the execution of the structured query language SQL, and the backup data can be quickly recovered by using the full-time and one-time incremental backup data. .
图6是根据本发明可选实施例的数据库快照恢复系统的示意图,如图6所示,该系统包括:Data Node Cluster:数据节点集群,用于对数据进行存储;SQL Node Cluster:SQL节点集群,用于SQL拆分和解析;全局事务协调器GTM(Global Transaction Manager):用于管理全局事务。Cluster Manager:集群管理器,用于管理Data Node Cluster和SQL Node Cluster。6 is a schematic diagram of a database snapshot recovery system according to an alternative embodiment of the present invention. As shown in FIG. 6, the system includes: a Data Node Cluster: a data node cluster for storing data; and a SQL Node Cluster: SQL node cluster. For SQL splitting and parsing; Global Transaction Manager GTM (Global Transaction Manager): used to manage global transactions. Cluster Manager: Cluster manager for managing Data Node Cluster and SQL Node Cluster.
基于图6中该系统的组成部分,图7是根据本发明可选实施例的数据库快照恢复方法的流程图,如图7所示,该方法的步骤包括:Based on the components of the system in FIG. 6, FIG. 7 is a flowchart of a database snapshot recovery method according to an alternative embodiment of the present invention. As shown in FIG. 7, the steps of the method include:
步骤41,获取活跃事务列表快照;Step 41: Obtain an active transaction list snapshot.
步骤42,物理热备份数据库; Step 42, physical hot backup database;
步骤43,定时归档事务日志; Step 43, periodically archiving the transaction log;
也就说,上述步骤41至步骤43是用来生成基础数据,Cluster Manager定期根据备份策略给各个节点下发全量或增量备份命令,Cluster Manager定时(可配置)向GTM获取活跃事务列表快照并持久化到磁盘文件(活跃事务列表文件)中;数据库节点定期归档数据库的事务日志。In other words, the above steps 41 to 43 are used to generate basic data, and the Cluster Manager periodically issues a full or incremental backup command to each node according to the backup policy, and the Cluster Manager periodically (configurable) obtains an active transaction list snapshot from the GTM. Persistence to disk files (active transaction list files); database nodes periodically archive database transaction logs.
该方法还包括:The method also includes:
步骤44,获取备份数据库文件、日志文件和活跃事务列表文件;Step 44: Obtain a backup database file, a log file, and an active transaction list file.
步骤45,恢复单节点一致性数据; Step 45, restoring single node consistency data;
步骤46,恢复全局一致性数据; Step 46: Restore global consistency data;
也就是说,该步骤44至步骤46是指恢复到任意指定时刻分布式数据库快照,其中,对每个数据库节点,根据全量+增量备份数据,把单节点数据库恢复到备份结束时刻的数据一致性状态。从活跃事务列表文件中检索到指定时刻的活跃事务列表快照,并取出对应的归档事务日志。根据活跃事务列表快照和事务日志,前滚或回滚从备份时刻到指定时刻的所有数据库事务,使得该快照满足分布式数据库的全局一致性。That is to say, the step 44 to the step 46 refers to restoring to a distributed database snapshot at any given time, wherein for each database node, according to the full amount + incremental backup data, the data of the single node database is restored to the backup end time. Sexual state. A snapshot of the active transaction list at the specified time is retrieved from the active transaction list file, and the corresponding archived transaction log is retrieved. According to the active transaction list snapshot and the transaction log, all database transactions from the backup time to the specified time are rolled forward or rolled back, so that the snapshot satisfies the global consistency of the distributed database.
通过本可选实施例采用对数据库物理热备份的方式,备份和恢复较逻辑备份都要快很多。除此之外,本可选实施例采取全量加增量的方式备份数据库,恢复的时候只需要一份全量的备份数据和一份增量的备份数据就可快速恢复数据库。本可选实施例采用对数据库物理热备份的方式,在备份过程中只是拷贝数据库文件,对在线业务影响极小。另外,使得数据库快照能够满足全局事务一致性,在该指定时刻的数据库快照,不存在部分数据节点已提交,部分数据节点未提交或提交失败的事务。可以恢复任意指定时刻(以获取活跃事务列表周期为粒度)的数据库快照。With this alternative embodiment, the physical hot backup of the database is adopted, and the backup and recovery are much faster than the logical backup. In addition, the optional embodiment uses a full amount of incremental data to back up the database. When recovering, only one full backup data and one incremental backup data are needed to quickly recover the database. This alternative embodiment adopts a physical hot backup method for the database. In the backup process, only the database file is copied, which has little impact on the online service. In addition, the database snapshot can satisfy the global transaction consistency. At the specified time, the database snapshot does not exist, and some data nodes have not submitted or submitted the failed transaction. A database snapshot can be restored at any given time (to get the granularity of the active transaction list period).
下面结合本发明的具体实施例对本可选实施例进行详细的说明,需要说明的是以下可选实施例都是结合图8进行相应的说明,图8是根据本发明可选实施例的数据库快照恢复的时间图;The present invention is described in detail below in conjunction with the specific embodiments of the present invention. It should be noted that the following optional embodiments are respectively described in conjunction with FIG. 8. FIG. 8 is a database snapshot according to an alternative embodiment of the present invention. Time map of recovery;
可选实施例一:Alternative embodiment 1:
该可选实施例以以MariaDB分布式系统为例,获得数据库数据一致性快照方法的步骤包括:初始基础数据生成过程包括步骤201至步骤203,而基于初始基础数据恢复指定时刻t7的数据库快照的步骤包括步骤204至步骤211。The optional embodiment takes the MariaDB distributed system as an example, and the step of obtaining the database data consistency snapshot method includes: the initial basic data generation process includes steps 201 to 203, and the database snapshot of the specified time t7 is restored based on the initial basic data. The steps include steps 204 through 211.
步骤201,开启分布式数据库和管理程序(ClusterManager,GTM),该时间点为t0,从t0时刻开始,ClusterManager定期向GTM获取活跃事务列表快照,写入文件,并持久化。In step 201, the distributed database and the hypervisor (ClusterManager, GTM) are started. The time point is t0. From time t0, the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
步骤202,在t1时刻,Cluster Manager根据备份策略和上次备份的结果文件,分别向数据库节点发起备份请求,节点1的备份结束时刻为t3,节点2的备份结束时刻为t4,节点3的备份结束时刻为t5。备份结束后各个节点以备份开始时间命名备份数据并返回备份结果,Cluster Manager记入结果文 件并持久化。Step 202: At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup. The backup end time of node 1 is t3, the backup end time of node 2 is t4, and the backup of node 3 is performed. The end time is t5. After the backup is completed, each node names the backup data with the backup start time and returns the backup result. The Cluster Manager records the result. And persist.
步骤203,数据节点日常归档事务日志文件,Cluster Manager归档活跃事务列表快照文件,其中,该归档周期可配置。In step 203, the data node routinely archives the transaction log file, and the Cluster Manager archives the active transaction list snapshot file, wherein the archive period is configurable.
步骤204,获取备份结果文件,并分析结果文件,之后获取t7时刻之前的最近一次备份数据即t1时刻备份的数据文件;Step 204: Obtain a backup result file, and analyze the result file, and then obtain the latest backup data before time t7, that is, the data file backed up at time t1;
步骤205,用物理热备份工具分别恢复各个节点备份数据,节点1恢复到时刻t3。In step 205, the physical backup data is used to restore the backup data of each node, and the node 1 is restored to the time t3.
步骤206,根据活跃事务列表快照文件中的记录匹配出指定时刻t7之前最近一次获取活跃事务列表快照的时刻t6,其中,恢复快照的粒度为获取活跃事务列表快照的周期;Step 206: Matching the record in the snapshot file of the active transaction list to the time t6 when the snapshot of the active transaction list is obtained last time before the specified time t7, wherein the granularity of the restored snapshot is the period for obtaining the snapshot of the active transaction list;
步骤207,分析t6时刻的活跃事务列表,得到该活跃事务列表中最先开始的事务的开始时间t2;Step 207, analyzing the active transaction list at time t6, obtaining the start time t2 of the first transaction in the active transaction list;
步骤208,获取该节点时间为[tmin,tmax]的事务日志;Step 208: Obtain a transaction log of the node time [tmin, tmax];
其中,tmin=min{t2,t3},tmax=t7;Where tmin=min{t2, t3}, tmax=t7;
步骤209,当tmin小于t3时,使用工具生成[tmin,t3]之间的在t6时刻仍活跃的分布式事务的回滚语句;当tmin不小于t3时,忽略该步骤;Step 209, when tmin is less than t3, use a tool to generate a rollback statement of the distributed transaction that is still active at time t6 between [tmin, t3]; when tmin is not less than t3, the step is ignored;
步骤210,使用工具重做[t3,t6]之间所有的单机事务和在集合:{gtid在t6时刻活跃事务列表中不存在}∩{小于t6时刻的next_gtid}中的所有分布式事务;Step 210, using the tool to redo all the single-machine transactions between [t3, t6] and all distributed transactions in the set: {gtid does not exist in the active transaction list at time t6} ∩ {less than the next_gtid at time t6};
步骤211,执行生成的回滚语句。In step 211, the generated rollback statement is executed.
可选实施例二:Alternative embodiment 2:
该可选实施例的应用场景为:基于MySQL分布式集群数据库的在线支付系统灾难恢复;The application scenario of the optional embodiment is: disaster recovery of an online payment system based on a MySQL distributed cluster database;
在本可选实施例中,使用物理热备份工具备份单节点数据,ClusterManager定期向GTM获取活跃事务列表数据快照,并且日常归档binlog日志。恢复时,获取单节点备份数据、binlog日志和活跃事务列表快照,进行恢复、回滚和重做的操作,从而得到指定时刻或备份时刻全局事务 一致性的数据库快照且不影响大数据量的在线支付系统正常运行,该可选实施例的步骤包括:In this alternative embodiment, the physical hot backup tool is used to back up single-node data, and the ClusterManager periodically obtains a snapshot of the active transaction list data from the GTM, and archives the binlog log daily. When recovering, obtain single-node backup data, binlog logs, and active transaction list snapshots, and perform recovery, rollback, and redo operations to obtain global transactions at specified time or backup time. A consistent database snapshot does not affect the normal operation of a large amount of online payment system. The steps of the alternative embodiment include:
步骤301,开启分布式数据库和管理程序(ClusterManager,GTM),该时间点为t0,从t0时刻开始,ClusterManager定期向GTM获取活跃事务列表快照,写入文件,并持久化。In step 301, the distributed database and the hypervisor (ClusterManager, GTM) are started. The time point is t0. From time t0, the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
步骤302,在t1时刻,Cluster Manager根据备份策略和上次备份的结果文件,分别向数据库节点发起备份请求,节点1的备份结束时刻为t3,节点2的备份结束时刻为t4,节点3的备份结束时刻为t5。备份结束后各个节点以备份开始时间命名备份数据并返回备份结果,Cluster Manager记入结果文件并持久化。Step 302: At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup. The backup end time of node 1 is t3, the backup end time of node 2 is t4, and the backup of node 3 is performed. The end time is t5. After the backup is completed, each node names the backup data with the backup start time and returns the backup result. Cluster Manager records the result file and persists it.
步骤303,数据节点日常归档事务日志文件,Cluster Manager归档活跃事务列表快照文件,其中,归档周期可以为10分钟。In step 303, the data node archives the transaction log file daily, and the Cluster Manager archives the active transaction list snapshot file, wherein the archiving period can be 10 minutes.
对于本可选实施例中涉及到的恢复数据库快照,要求在其他生产环境或者中间机器恢复该集群数据库t7时刻快照,该恢复的步骤包括:For the recovery database snapshot involved in the alternative embodiment, the snapshot of the cluster database t7 is required to be restored in another production environment or an intermediate machine, and the steps of the recovery include:
步骤304,获取备份结果文件,并分析结果文件,之后获取t7时刻之前的最近一次备份数据即t1时刻备份的数据文件;Step 304: Obtain a backup result file, and analyze the result file, and then obtain the latest backup data before time t7, that is, the data file backed up at time t1;
步骤305,若需要恢复到最近十分钟之内的数据,则还需要手动将还未来得及归档的事务日志拷贝到目标机器;Step 305, if it is necessary to restore the data within the last ten minutes, it is also necessary to manually copy the transaction log that is still archived in the future to the target machine;
步骤306,用物理热备份工具分别恢复各个节点备份数据,新节点1恢复到时刻t3;Step 306, recovering the backup data of each node by using a physical hot backup tool, and the new node 1 is restored to the time t3;
步骤307,根据活跃事务列表快照文件中的记录匹配出指定时刻t7之前最近一次获取活跃事务列表快照的时刻t6。(恢复快照的粒度为获取活跃事务列表快照的周期)Step 307: Matching the record in the active transaction list snapshot file to the time t6 when the snapshot of the active transaction list was last acquired before the specified time t7. (The granularity of restoring snapshots is the period of taking snapshots of active transaction lists)
步骤308,分析t6时刻的活跃事务列表,得到该活跃事务列表中最先开始的事务的开始时间t2。Step 308, analyzing the active transaction list at time t6, and obtaining the start time t2 of the first transaction in the active transaction list.
步骤309,获取该节点时间为[tmin,tmax]的事务日志;Step 309, obtaining a transaction log of the node time [tmin, tmax];
其中,tmin=min{t2,t3},tmax=t7Where tmin=min{t2,t3},tmax=t7
步骤310,当tmin小于t3时,使用工具生成[tmin,t3]之间的在t6时刻 仍活跃的分布式事务的回滚语句;当tmin不小于t3时,忽略该步骤。Step 310, when tmin is less than t3, use the tool to generate [tmin, t3] at time t6 A rollback statement for a distributed transaction that is still active; ignore this step when tmin is not less than t3.
步骤311,使用工具重做[t3,t6]之间所有的单机事务和在集合:{gtid在t6时刻活跃事务列表中不存在}∩{小于t6时刻的next_gtid}中的所有分布式事务。Step 311, using the tool to redo all the single-machine transactions between [t3, t6] and all distributed transactions in the set: {gtid does not exist in the active transaction list at time t6} ∩ {less than the next_gtid at time t6}.
通过本可选实施例的上述步骤可以恢复到数据库当机之前的时刻。The above steps of the alternative embodiment can be restored to the time before the database is down.
可选实施例三Alternative embodiment three
基于MariaDB分布式集群数据库用户储蓄系统单一数据表恢复Single data table recovery based on MariaDB distributed cluster database user savings system
在可选实施例中,使用物理热备份工具备份单节点数据,ClusterManager定期向GTM获取活跃事务列表数据快照,并且日常归档binlog日志。恢复时,获取单节点备份数据、binlog日志和活跃事务列表快照,进行恢复、回滚和重做的操作,从而得到运维人员误删除数据表前时刻全局事务一致性的数据库快照。利用该快照,可以导出误删除数据表,由人工导入在线系统。具体步骤如下所示。In an alternative embodiment, the physical hot backup tool is used to back up the single node data, and the ClusterManager periodically obtains a snapshot of the active transaction list data from the GTM, and archives the binlog log daily. During recovery, the single-node backup data, the binlog log, and the active transaction list snapshot are taken for recovery, rollback, and redo operations, so that the database snapshot of the global transaction consistency before the operation and maintenance personnel deletes the data table by mistake. With this snapshot, the erroneous deletion data table can be exported and imported into the online system manually. The specific steps are as follows.
步骤401,开启分布式数据库和管理程序(ClusterManager,GTM),该时间点为t0,从t0时刻开始,ClusterManager定期向GTM获取活跃事务列表快照,写入文件,并持久化。In step 401, the distributed database and the hypervisor (ClusterManager, GTM) are started. The time point is t0. From time t0, the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
步骤402,在t1时刻,Cluster Manager根据备份策略和上次备份的结果文件,分别向数据库节点发起备份请求,节点1的备份结束时刻为t3,节点2的备份结束时刻为t4,节点3的备份结束时刻为t5。备份结束后各个节点以备份开始时间命名备份数据并返回备份结果,Cluster Manager记入结果文件并持久化。Step 402: At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup. The backup end time of node 1 is t3, the backup end time of node 2 is t4, and the backup of node 3 is performed. The end time is t5. After the backup is completed, each node names the backup data with the backup start time and returns the backup result. Cluster Manager records the result file and persists it.
步骤403,数据节点日常归档事务日志文件,Cluster Manager归档活跃事务列表快照文件。归档周期为10分钟。In step 403, the data node daily archives the transaction log file, and the Cluster Manager archives the active transaction list snapshot file. The archiving cycle is 10 minutes.
对于本可选实施例中涉及到的要求在其他生产环境或者中间机器恢复该集群数据库t7时刻快照,包括如下步骤:For the requirements involved in this alternative embodiment, the recovery of the cluster database t7 time snapshot in other production environments or intermediate machines includes the following steps:
步骤404,获取备份结果文件,并分析结果文件,之后获取t7时刻之前的最近一次备份数据即t1时刻备份的数据文件。Step 404: Obtain a backup result file, and analyze the result file, and then obtain the latest backup data before time t7, that is, the data file backed up at time t1.
步骤405,若需要恢复到最近十分钟之内的数据,则还需要手动将还未 来得及归档的事务日志拷贝到目标机器。Step 405, if it is necessary to restore the data within the last ten minutes, it is also necessary to manually The archived transaction log is copied to the target machine.
步骤406,用物理热备份工具分别恢复各个节点备份数据。新节点1恢复到时刻t3。In step 406, the physical backup data is used to restore the backup data of each node. The new node 1 is restored to time t3.
步骤407,根据活跃事务列表快照文件中的记录匹配出指定时刻t7之前最近一次获取活跃事务列表快照的时刻t6。(恢复快照的粒度为获取活跃事务列表快照的周期)Step 407: Matching the record in the active transaction list snapshot file to the time t6 when the snapshot of the active transaction list was last acquired before the specified time t7. (The granularity of restoring snapshots is the period of taking snapshots of active transaction lists)
步骤408,分析t6时刻的活跃事务列表,得到该活跃事务列表中最先开始的事务的开始时间t2。In step 408, the active transaction list at time t6 is analyzed, and the start time t2 of the first transaction in the active transaction list is obtained.
步骤409,获取该节点时间为[tmin,tmax]的事务日志;Step 409, obtaining a transaction log of the node time [tmin, tmax];
其中,tmin=min{t2,t3},tmax=t7Where tmin=min{t2,t3},tmax=t7
步骤410,当tmin小于t3时,使用工具生成[tmin,t3]之间的在t6时刻仍活跃的分布式事务的回滚语句;当tmin不小于t3时,忽略该步骤。Step 410: When tmin is less than t3, use the tool to generate a rollback statement of the distributed transaction that is still active at time t6 between [tmin, t3]; when tmin is not less than t3, the step is ignored.
步骤411,使用工具重做[t3,t6]之间所有的单机事务和在集合:{gtid在t6时刻活跃事务列表中不存在}∩{小于t6时刻的next_gtid}中的所有分布式事务。In step 411, the tool is used to redo all the single-machine transactions between [t3, t6] and all distributed transactions in the set: {gtid does not exist in the active transaction list at time t6} ∩ {less than the next_gtid at time t6}.
通过本可选实施例的上述步骤可以导出被误删除的数据表文件。即可以恢复到数据库误删除之前的时刻。当运维人员误删除某些用户信息的场景中,可利用本可选实施例中的恢复删除信息之前时刻数据库快照。该时刻的数据库快照中被删除的数据表还存在,可以利用数据库工具导出该数据表,重新导入到当前时刻的数据库中。The data table file that was accidentally deleted can be derived by the above steps of the alternative embodiment. That is, you can restore to the time before the database was accidentally deleted. In the scenario where the operation and maintenance personnel mistakenly delete certain user information, the snapshot of the time before the deletion of the information in the alternative embodiment may be utilized. The deleted data table in the database snapshot at this moment still exists, and the data table can be exported by using the database tool and re-imported into the current time database.
可选实施例四Alternative embodiment four
基于Oracle分布式集群数据库的在线购物系统Online shopping system based on Oracle distributed cluster database
在本可选实施例中使用物理热备份工具备份单节点数据,ClusterManager定期向GTM获取活跃事务列表数据快照,并且日常归档redo日志。恢复时,获取单节点备份数据、redo日志和活跃事务列表快照,进行恢复、回滚和重做的操作,从而得到数据突变前时刻全局事务一致性的数据库快照。利用该快照,可以在改善数据分布后再次测试数据库和机房分别是否合理。该过程的步骤包括: In this alternative embodiment, the physical hot backup tool is used to back up the single node data, and the ClusterManager periodically obtains a snapshot of the active transaction list data from the GTM, and archives the redo log daily. During recovery, the single-node backup data, the redo log, and the active transaction list snapshot are obtained, and recovery, rollback, and redo operations are performed to obtain a database snapshot of the global transaction consistency before the data mutation. With this snapshot, it is possible to test the database and the room separately after improving the data distribution. The steps of the process include:
步骤501,开启分布式数据库和管理程序(ClusterManager,GTM),该时间点为t0,从t0时刻开始,ClusterManager定期向GTM获取活跃事务列表快照,写入文件,并持久化。In step 501, the distributed database and the hypervisor (ClusterManager, GTM) are started. The time point is t0. From time t0, the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
步骤502,在t1时刻,Cluster Manager根据备份策略和上次备份的结果文件,分别向数据库节点发起备份请求,节点1的备份结束时刻为t3,节点2的备份结束时刻为t4,节点3的备份结束时刻为t5。备份结束后各个节点以备份开始时间命名备份数据并返回备份结果,Cluster Manager记入结果文件并持久化。Step 502: At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup. The backup end time of node 1 is t3, the backup end time of node 2 is t4, and the backup of node 3 is performed. The end time is t5. After the backup is completed, each node names the backup data with the backup start time and returns the backup result. Cluster Manager records the result file and persists it.
步骤503,数据节点日常归档事务日志文件,Cluster Manager归档活跃事务列表快照文件。归档周期为10分钟。In step 503, the data node daily archives the transaction log file, and the Cluster Manager archives the active transaction list snapshot file. The archiving cycle is 10 minutes.
对于本可选实施例中涉及到的要求在其他生产环境或者中间机器恢复该集群数据库t7时刻快照的步骤包括:The steps involved in the present embodiment for restoring the snapshot of the cluster database t7 in other production environments or intermediate machines include:
步骤504,获取备份结果文件,并分析结果文件,之后获取t7时刻之前的最近一次备份数据即t1时刻备份的数据文件。Step 504: Obtain a backup result file, and analyze the result file, and then obtain the latest backup data before time t7, that is, the data file backed up at time t1.
步骤505,若需要恢复到最近十分钟之内的数据,则还需要手动将还未来得及归档的事务日志拷贝到目标机器。In step 505, if it is necessary to restore the data within the last ten minutes, it is also necessary to manually copy the transaction log that is still archived in the future to the target machine.
步骤506,用物理热备份工具分别恢复各个节点备份数据。新节点1恢复到时刻t3。In step 506, the physical backup data is used to restore the backup data of each node. The new node 1 is restored to time t3.
步骤507,根据活跃事务列表快照文件中的记录匹配出指定时刻t7之前最近一次获取活跃事务列表快照的时刻t6。(恢复快照的粒度为获取活跃事务列表快照的周期)In step 507, the time t6 of the latest acquisition of the active transaction list snapshot before the specified time t7 is matched according to the record in the active transaction list snapshot file. (The granularity of restoring snapshots is the period of taking snapshots of active transaction lists)
步骤508,分析t6时刻的活跃事务列表,得到该活跃事务列表中最先开始的事务的开始时间t2。Step 508, analyzing the active transaction list at time t6, and obtaining the start time t2 of the first transaction in the active transaction list.
步骤509,获取该节点时间为[tmin,tmax]的事务日志;Step 509: Obtain a transaction log of the node time [tmin, tmax];
其中,tmin=min{t2,t3},tmax=t7Where tmin=min{t2,t3},tmax=t7
步骤510,当tmin小于t3时,使用工具生成[tmin,t3]之间的在t6时刻仍活跃的分布式事务的回滚语句;当tmin不小于t3时,忽略该步骤。Step 510, when tmin is less than t3, use the tool to generate a rollback statement of the distributed transaction that is still active at time t6 between [tmin, t3]; when tmin is not less than t3, the step is ignored.
步骤512,使用工具重做[t3,t6]之间所有的单机事务和在集合:{gtid在 t6时刻活跃事务列表中不存在}∩{小于t6时刻的next_gtid}中的所有分布式事务。Step 512, using the tool to redo all the single-machine transactions between [t3, t6] and in the collection: {gtid in There is no distributed transaction in the active transaction list at t6} ∩{less than next_gtid} at time t6.
可选实施例五Alternative embodiment five
基于MySQL分布式集群数据库的交易系统Trading system based on MySQL distributed cluster database
在本可选实施例中在升级之前使用物理热备份工具备份单节点数据,ClusterManager定期向GTM获取活跃事务列表数据快照,并且日常归档binlog日志。恢复时,获取单节点备份数据、binlog日志和活跃事务列表快照,进行恢复、回滚操作,从而得到升级前时刻全局事务一致性的数据库快照。升级失败的时刻,可以回退到该时刻。该过程的步骤包括:In this alternative embodiment, the physical hot backup tool is used to back up single-node data before the upgrade. The ClusterManager periodically obtains a snapshot of the active transaction list data from the GTM, and archives the binlog log daily. During recovery, the single-node backup data, the binlog log, and the active transaction list snapshot are obtained, and the recovery and rollback operations are performed to obtain a database snapshot of the global transaction consistency before the upgrade. When the upgrade fails, you can roll back to that moment. The steps of the process include:
步骤601,开启分布式数据库和管理程序(ClusterManager,GTM),该时间点为t0,从t0时刻开始,ClusterManager定期向GTM获取活跃事务列表快照,写入文件,并持久化。In step 601, the distributed database and the hypervisor (ClusterManager, GTM) are started. The time point is t0. From time t0, the ClusterManager periodically obtains a snapshot of the active transaction list from the GTM, writes the file, and persists.
步骤602,在t1时刻,Cluster Manager根据备份策略和上次备份的结果文件,分别向数据库节点发起备份请求,节点1的备份结束时刻为t3,节点2的备份结束时刻为t4,节点3的备份结束时刻为t5。备份结束后各个节点以备份开始时间命名备份数据并返回备份结果,Cluster Manager记入结果文件并持久化。Step 602: At time t1, the Cluster Manager initiates a backup request to the database node according to the backup policy and the result file of the last backup. The backup end time of node 1 is t3, the backup end time of node 2 is t4, and the backup of node 3 is performed. The end time is t5. After the backup is completed, each node names the backup data with the backup start time and returns the backup result. Cluster Manager records the result file and persists it.
步骤603,数据节点日常归档事务日志文件,Cluster Manager归档活跃事务列表快照文件。归档周期为10分钟。In step 603, the data node daily archives the transaction log file, and the Cluster Manager archives the active transaction list snapshot file. The archiving cycle is 10 minutes.
对于本实施例中涉及到的要求在其他生产环境或者中间机器恢复该集群数据库t7时刻快照的步骤包括:For the requirements involved in this embodiment, the steps of restoring the snapshot of the cluster database t7 in other production environments or intermediate machines include:
步骤604,获取备份结果文件,并分析结果文件,之后获取t7时刻之前的最近一次备份数据即t1时刻备份的数据文件。In step 604, the backup result file is obtained, and the result file is analyzed, and then the latest backup data before time t7, that is, the data file backed up at time t1 is obtained.
步骤605,若需要恢复到最近十分钟之内的数据,则还需要手动将还未来得及归档的事务日志拷贝到目标机器。In step 605, if it is necessary to restore the data within the last ten minutes, it is also necessary to manually copy the transaction log that is still archived in the future to the target machine.
步骤606,用物理热备份工具分别恢复各个节点备份数据。新节点1恢复到时刻t3。In step 606, the physical backup data is used to restore the backup data of each node. The new node 1 is restored to time t3.
步骤607,根据活跃事务列表快照文件中的记录匹配出指定时刻t7之前 最近一次获取活跃事务列表快照的时刻t6。(恢复快照的粒度为获取活跃事务列表快照的周期)Step 607: Matching the record in the active transaction list snapshot file before the specified time t7 The time t6 at which the snapshot of the active transaction list was last taken. (The granularity of restoring snapshots is the period of taking snapshots of active transaction lists)
步骤608,分析t6时刻的活跃事务列表,得到该活跃事务列表中最先开始的事务的开始时间t2。In step 608, the active transaction list at time t6 is analyzed, and the start time t2 of the first transaction in the active transaction list is obtained.
步骤609,获取该节点时间为[tmin,tmax]的事务日志;Step 609: Obtain a transaction log of the node time [tmin, tmax];
其中,tmin=min{t2,t3},tmax=t7Where tmin=min{t2,t3},tmax=t7
步骤610,当tmin小于t3时,使用工具生成[tmin,t3]之间的在t6时刻仍活跃的分布式事务的回滚语句;当tmin不小于t3时,忽略该步骤。In step 610, when tmin is less than t3, the tool is used to generate a rollback statement of the distributed transaction that is still active at time t6 between [tmin, t3]; when tmin is not less than t3, the step is ignored.
步骤611,使用工具重做[t3,t6]之间所有的单机事务和在集合:{gtid在t6时刻活跃事务列表中不存在}∩{小于t6时刻的next_gtid}中的所有分布式事务。In step 611, the tool is used to redo all the single-machine transactions between [t3, t6] and all distributed transactions in the set: {gtid does not exist in the active transaction list at time t6} ∩ {less than the next_gtid at time t6}.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:Embodiments of the present invention also provide a storage medium. Optionally, in the embodiment, the foregoing storage medium may be configured to store program code for performing the following steps:
S1,分布式数据库中的集群管理器将与集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据;S1. The cluster manager in the distributed database restores data of each node connected to the cluster manager to data at the end of the last physical backup before the specified time;
S2,集群管理器基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做事务日志中的事务所指示的操作得到在指定时刻各个节点的数据快照,其中,事务日志为物理备份结束时刻至指定时刻之间归档的对数据进行的操作。S2, the cluster manager re-does the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log according to the data of the last physical backup end time, and obtains a data snapshot of each node at the specified time, wherein the transaction log The operation of the data archived between the end of the physical backup and the specified time.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
以上所述,仅为本发明的较佳实例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
工业实用性Industrial applicability
本发明实施例提出的数据快照的恢复方法及装置,其中,该方法包括:分布式数据库中的集群管理器将与集群管理器连接的各个节点的数据恢复到指定 时刻之前最近一次物理备份结束时刻的数据;集群管理器基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做事务日志中的事务所指示的操作得到在指定时刻各个节点的数据快照,其中,事务日志为物理备份结束时刻至指定时刻之间归档的对数据进行的操作。通过本发明,解决了相关技术中分布式数据库恢复历史时刻的数据库快照不能恢复出任意指定时刻且满足全局事务一致性的数据库快照的问题。 The method and device for restoring a data snapshot proposed by the embodiment of the present invention, wherein the method includes: the cluster manager in the distributed database restores data of each node connected to the cluster manager to a specified The data of the last physical backup end time before the moment; the cluster manager redoes the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time, and obtains the operation at the specified time at each specified time. A snapshot of the data of the node, where the transaction log is an operation performed on the data archived between the end of the physical backup and the specified time. The invention solves the problem that the database snapshot of the distributed database recovery historical moment in the related art cannot recover the database snapshot that meets the specified transaction time and meets the global transaction consistency.

Claims (11)

  1. 一种数据快照的恢复方法,包括:A method for restoring a data snapshot, comprising:
    分布式数据库中的集群管理器将与集群管理器自身连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据;The cluster manager in the distributed database restores the data of each node connected to the cluster manager itself to the data of the last physical backup end time before the specified time;
    集群管理器基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做事务日志中的事务所指示的操作得到在所述指定时刻各个节点的数据快照;其中,事务日志为物理备份结束时刻至指定时刻之间归档的对数据进行的操作。The cluster manager obtains a data snapshot of each node at the specified time according to the operation indicated by the transaction in the transaction log in the order of the execution time of the transaction in the transaction log based on the data of the last physical backup end time; wherein, the transaction log The operation of the data archived between the end of the physical backup and the specified time.
  2. 根据权利要求1所述的恢复方法,其中,所述分布式数据库中的集群管理器将与所述集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据包括:The recovery method according to claim 1, wherein the data of the cluster manager in the distributed database recovering the data of each node connected to the cluster manager to the end time of the latest physical backup before the specified time includes:
    所述集群管理器获取在所述指定时刻之前最近一次获取的所述各个节点的活跃事务列表快照,其中,所述活跃事务列表快照中记录有在所述指定时刻与所述集群管理器连接的一个或多个节点上正在活跃的用于操作数据的事务;Obtaining, by the cluster manager, an active transaction list snapshot of the respective nodes acquired before the specified time, wherein the active transaction list snapshot records a connection with the cluster manager at the specified time A transaction that is active on one or more nodes for manipulating data;
    所述集群管理器查找所述活跃事务列表中最先开始的活跃事务的开始时刻;The cluster manager searches for a start time of the first active transaction in the active transaction list;
    在所述开始时刻小于所述物理备份结束时刻时,所述集群管理器对所述活跃事务列表快照中在所述物理备份结束时刻之前仍活跃的事务进行回滚得到所述最近一次物理备份结束时刻的数据;When the start time is less than the physical backup end time, the cluster manager rolls back a transaction that is still active before the physical backup end time in the active transaction list snapshot to obtain the end of the latest physical backup. Time data
    在所述最先开始的活跃事务的开始时刻大于所述物理备份结束时刻时,所述集群管理器获取所述各个节点在指定时刻之前最近一次物理备份结束时刻的数据。When the start time of the first active transaction is greater than the physical backup end time, the cluster manager acquires data of the last physical backup end time of each node before the specified time.
  3. 根据权利要求2所述的恢复方法,其中,所述集群管理器基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做所述事务日志中的事务所指示的操作得到所述指定时刻所述各个节点的数据快照包括:The recovery method according to claim 2, wherein said cluster manager redoes an operation indicated by a transaction in said transaction log in an order of execution time of a transaction in a transaction log based on data of a last physical backup end time Obtaining a data snapshot of each node in the specified moment includes:
    所述集群管理器基于所述最近一次物理备份结束时刻的数据按照所述事 务日志中的事务的执行时间的顺序重做所述事务日志中事务所指示的所述各个节点的单机事务操作,以及按照在所述物理备份结束时刻到所述指定时刻之间所述事务日志中的事务的执行时间的顺序重做所述事务日志中事务所指示的分布式事务操作得到所述指定时刻所述各个节点的数据快照。The cluster manager according to the data of the last physical backup end time according to the matter Repetitively repeating the execution time of the transaction in the transaction log for the stand-alone transaction operation of the respective nodes indicated by the transaction in the transaction log, and according to the transaction log between the physical backup end time and the specified time The sequence of execution times of the transactions in the transaction redo the distributed transaction operations indicated by the transaction in the transaction log to obtain a snapshot of the data of the respective nodes at the specified time.
  4. 根据权利要求1所述的恢复方法,在分布式数据库中的集群管理器将与所述集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据之前,所述方法还包括:The recovery method according to claim 1, wherein the cluster manager in the distributed database restores data of each node connected to the cluster manager to data of a last physical backup end time before a specified time, the method Also includes:
    所述集群管理器周期性向与所述集群管理器连接的各个节点发送物理备份指令,其中,所述物理备份指令包括:全量备份指令和/或增量备份指令。The cluster manager periodically sends a physical backup instruction to each node connected to the cluster manager, wherein the physical backup instruction includes: a full backup instruction and/or an incremental backup instruction.
  5. 根据权利要求2所述的恢复方法,在分布式数据库中的集群管理器将与所述集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据之前,所述方法还包括:The recovery method according to claim 2, wherein the cluster manager in the distributed database restores data of each node connected to the cluster manager to data of a last physical backup end time before a specified time, the method Also includes:
    所述集群管理器周期性对所述各个节点执行快照操作得到所述活跃事务列表快照。The cluster manager periodically performs a snapshot operation on the respective nodes to obtain the active transaction list snapshot.
  6. 一种数据快照的恢复装置,应用于分布式数据库中的集群管理器侧,包括:A data snapshot recovery device is applied to a cluster manager side in a distributed database, including:
    恢复模块,设置为将与自身所在集群管理器连接的各个节点的数据恢复到指定时刻之前最近一次物理备份结束时刻的数据;The recovery module is configured to restore data of each node connected to the cluster manager itself to data of the last physical backup end time before the specified time;
    重做模块,设置为基于最近一次物理备份结束时刻的数据按照事务日志中的事务的执行时间的顺序重做所述事务日志中的事务所指示的操作得到在所述指定时刻所述各个节点的数据快照;其中,所述事务日志为所述物理备份结束时刻至所述指定时刻之间归档的对数据进行的操作。a redo module, configured to redo the operation indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time to obtain the respective nodes at the specified time a data snapshot; wherein the transaction log is an operation performed on data archived between the physical backup end time and the specified time.
  7. 根据权利要求6所述的恢复装置,其中,所述恢复模块包括:The recovery device of claim 6, wherein the recovery module comprises:
    第一获取单元,设置为获取在所述指定时刻之前最近一次获取的所述各个节点的活跃事务列表快照,其中,所述活跃事务列表快照中记录有在所述指定时刻与所述集群管理器连接的一个或多个节点上正在活跃的用于操作数据的事务;a first obtaining unit, configured to acquire an active transaction list snapshot of the respective nodes acquired last time before the specified time, wherein the active transaction list snapshot records the cluster manager at the specified time A transaction that is active on one or more nodes connected to manipulate data;
    查找单元,设置为查找所述活跃事务列表中最先开始的活跃事务的开始 时刻;a lookup unit, set to find the beginning of the first active transaction in the list of active transactions time;
    回滚单元,设置为在所述最先开始的活跃事务的开始时刻小于所述物理备份结束时刻时,对所述活跃事务列表快照中在所述物理备份结束时刻之前仍活跃的事务进行回滚得到所述最近一次物理备份结束时刻的数据;a rollback unit, configured to roll back a transaction that is still active before the physical backup end time in the active transaction list snapshot when the start time of the first active transaction is less than the physical backup end time Obtaining data of the last physical backup end time;
    第二获取单元,设置为在所述最先开始的活跃事务的开始时刻大于所述物理备份结束时刻时,获取所述各个节点在指定时刻之前最近一次物理备份结束时刻的数据。The second obtaining unit is configured to acquire data of the last physical backup end time of each node before the specified time when the start time of the first active transaction is greater than the physical backup end time.
  8. 根据权利要求7所述的恢复装置,其中,The recovery device according to claim 7, wherein
    所述重做模块,还设置为基于所述最近一次物理备份结束时刻的数据按照所述事务日志中的事务的执行时间的顺序重做所述事务日志中事务所指示的所述各个节点的单机事务操作,以及按照在所述物理备份结束时刻到所述指定时刻之间所述事务日志中的事务的执行时间的顺序重做所述事务日志中事务所指示的分布式事务操作得到所述指定时刻所述各个节点的数据快照。The redo module is further configured to redo the single machine of the each node indicated by the transaction in the transaction log according to the execution time of the transaction in the transaction log based on the data of the last physical backup end time Transaction operation, and redoing the distributed transaction operation indicated by the transaction in the transaction log in an order of execution time of the transaction in the transaction log between the physical backup end time and the specified time to obtain the designation A snapshot of the data of each node as described at the moment.
  9. 根据权利要求6所述的恢复装置,所述装置还包括:The recovery device of claim 6 further comprising:
    发送模块,设置为周期性向与所述集群管理器连接的各个节点发送物理备份指令,其中,所述物理备份指令包括:全量备份指令和/或增量备份指令。And a sending module, configured to periodically send a physical backup instruction to each node connected to the cluster manager, where the physical backup instruction comprises: a full backup instruction and/or an incremental backup instruction.
  10. 根据权利要求7所述的恢复装置,所述装置还包括:The recovery device of claim 7, further comprising:
    执行模块,设置为周期性对所述各个节点执行快照操作得到所述活跃事务列表快照。The execution module is configured to perform a snapshot operation on the respective nodes periodically to obtain the snapshot of the active transaction list.
  11. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行权1~权5任一项的数据快照的恢复方法。 A computer readable storage medium storing computer executable instructions for performing a method of restoring a data snapshot of any one of rights 1 to 5.
PCT/CN2016/079475 2015-10-23 2016-04-15 Data snapshot recovery method and apparatus WO2016180160A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510698124.6 2015-10-23
CN201510698124.6A CN106610876B (en) 2015-10-23 2015-10-23 Data snapshot recovery method and device

Publications (1)

Publication Number Publication Date
WO2016180160A1 true WO2016180160A1 (en) 2016-11-17

Family

ID=57247762

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/079475 WO2016180160A1 (en) 2015-10-23 2016-04-15 Data snapshot recovery method and apparatus

Country Status (2)

Country Link
CN (1) CN106610876B (en)
WO (1) WO2016180160A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304527A (en) * 2018-01-25 2018-07-20 杭州哲信信息技术有限公司 A kind of data extraction method
CN109408289A (en) * 2018-10-16 2019-03-01 国网山东省电力公司信息通信公司 A kind of cloud disaster tolerance data processing method
CN110286732A (en) * 2019-06-27 2019-09-27 无锡华云数据技术服务有限公司 High-availability cluster power down automatic recovery method, device, equipment and storage medium
CN111651303A (en) * 2020-07-07 2020-09-11 南京云信达科技有限公司 Database online backup and recovery method of distributed architecture and technical field
CN112463447A (en) * 2020-11-25 2021-03-09 浪潮云信息技术股份公司 Optimization method for realizing physical backup based on distributed database
CN116541206A (en) * 2023-04-10 2023-08-04 泽拓科技(深圳)有限责任公司 Data recovery method and device of distributed data cluster and electronic equipment

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6924898B2 (en) * 2017-06-05 2021-08-25 華為技術有限公司Huawei Technologies Co.,Ltd. Transaction processing methods, devices and devices
CN107451013B (en) * 2017-06-30 2020-12-25 北京奇虎科技有限公司 Data recovery method, device and system based on distributed system
CN110121712B (en) * 2017-12-05 2022-04-05 华为技术有限公司 Log management method, server and database system
CN110019469B (en) * 2017-12-07 2022-06-21 金篆信科有限责任公司 Distributed database data processing method and device, storage medium and electronic device
WO2019178839A1 (en) * 2018-03-23 2019-09-26 华为技术有限公司 Method and device for creating consistency snapshot for distributed application and distributed system
CN110309227B (en) * 2018-05-28 2022-12-13 腾讯科技(深圳)有限公司 Distributed data rollback method, device and computer readable storage medium
CN108959547B (en) * 2018-07-02 2022-02-18 上海浪潮云计算服务有限公司 PV snapshot distributed database cluster recovery method
CN109144785B (en) * 2018-08-27 2020-07-28 北京百度网讯科技有限公司 Method and apparatus for backing up data
CN109144790A (en) * 2018-09-30 2019-01-04 广州鼎甲计算机科技有限公司 The synthesized backup method and device of MySQL database
CN109271398B (en) * 2018-10-29 2020-06-23 东软集团股份有限公司 Database transaction processing method, device, equipment and computer readable storage medium
CN111177141A (en) * 2018-11-09 2020-05-19 上海擎感智能科技有限公司 Method, equipment and system for recovering data by utilizing MySQL (MySQL structured query language) parallel copying
CN109885427A (en) * 2019-01-31 2019-06-14 郑州云海信息技术有限公司 A kind of database short-term data guard method, device, memory and equipment
US11080257B2 (en) * 2019-05-13 2021-08-03 Snowflake Inc. Journaled tables in database systems
CN110807064B (en) * 2019-10-28 2022-08-26 北京优炫软件股份有限公司 Data recovery device in RAC distributed database cluster system
CN111124751B (en) * 2019-11-12 2023-11-17 华为云计算技术有限公司 Data recovery method and system, data storage node and database management node
CN111338845B (en) * 2020-02-16 2021-05-07 西安奥卡云数据科技有限公司 Fine-grained local data protection method
CN111522631B (en) * 2020-03-23 2024-02-06 支付宝(杭州)信息技术有限公司 Distributed transaction processing method, device, server and medium
CN111611108A (en) * 2020-05-21 2020-09-01 云和恩墨(北京)信息技术有限公司 Method and device for restoring virtual database
CN113297230B (en) * 2020-07-27 2024-03-08 阿里巴巴集团控股有限公司 Data verification method and device
CN112000521B (en) * 2020-08-24 2021-08-27 中国银联股份有限公司 Full backup method and device for distributed database system and computer readable storage medium
CN112286870A (en) * 2020-11-02 2021-01-29 四川长虹电器股份有限公司 Method for obtaining database consistency snapshot
CN112579613B (en) * 2020-12-31 2023-02-17 华东计算技术研究所(中国电子科技集团公司第三十二研究所) Database cluster difference comparison and data synchronization method, system and medium
CN115658239B (en) * 2022-12-23 2023-04-28 安超云软件有限公司 Snapshot management method, system and computer readable medium
CN116107807B (en) * 2023-01-10 2023-10-13 北京万里开源软件有限公司 Method and device for acquiring global consistency point positions during data backup in database

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110184915A1 (en) * 2010-01-28 2011-07-28 Microsoft Corporation Cluster restore and rebuild
CN102419758A (en) * 2010-09-28 2012-04-18 金蝶软件(中国)有限公司 Data processing system and method
CN102662793A (en) * 2012-03-07 2012-09-12 江苏引跑网络科技有限公司 Hot backup and recovery method of distributed database with guarantee of data consistency
CN103699548A (en) * 2012-09-27 2014-04-02 阿里巴巴集团控股有限公司 Method and equipment for recovering database data by using logs
CN103885856A (en) * 2014-03-10 2014-06-25 北京大学 Diagram calculation fault-tolerant method and system based on information regeneration mechanism

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8818960B2 (en) * 2011-03-18 2014-08-26 Microsoft Corporation Tracking redo completion at a page level
US8949190B2 (en) * 2011-11-07 2015-02-03 Sap Se Point-in-time database recovery using log holes
CN103198159B (en) * 2013-04-27 2016-01-06 国家计算机网络与信息安全管理中心 A kind of many copy consistency maintaining methods of isomeric group reformed based on affairs
CN103412803B (en) * 2013-08-15 2016-08-10 华为技术有限公司 The method and device that data are recovered
US9317379B2 (en) * 2014-01-24 2016-04-19 International Business Machines Corporation Using transactional execution for reliability and recovery of transient failures

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110184915A1 (en) * 2010-01-28 2011-07-28 Microsoft Corporation Cluster restore and rebuild
CN102419758A (en) * 2010-09-28 2012-04-18 金蝶软件(中国)有限公司 Data processing system and method
CN102662793A (en) * 2012-03-07 2012-09-12 江苏引跑网络科技有限公司 Hot backup and recovery method of distributed database with guarantee of data consistency
CN103699548A (en) * 2012-09-27 2014-04-02 阿里巴巴集团控股有限公司 Method and equipment for recovering database data by using logs
CN103885856A (en) * 2014-03-10 2014-06-25 北京大学 Diagram calculation fault-tolerant method and system based on information regeneration mechanism

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304527A (en) * 2018-01-25 2018-07-20 杭州哲信信息技术有限公司 A kind of data extraction method
CN109408289A (en) * 2018-10-16 2019-03-01 国网山东省电力公司信息通信公司 A kind of cloud disaster tolerance data processing method
CN110286732A (en) * 2019-06-27 2019-09-27 无锡华云数据技术服务有限公司 High-availability cluster power down automatic recovery method, device, equipment and storage medium
CN110286732B (en) * 2019-06-27 2021-01-12 华云数据控股集团有限公司 Method, device and equipment for automatically recovering power failure of high-availability cluster and storage medium
CN111651303A (en) * 2020-07-07 2020-09-11 南京云信达科技有限公司 Database online backup and recovery method of distributed architecture and technical field
CN112463447A (en) * 2020-11-25 2021-03-09 浪潮云信息技术股份公司 Optimization method for realizing physical backup based on distributed database
CN116541206A (en) * 2023-04-10 2023-08-04 泽拓科技(深圳)有限责任公司 Data recovery method and device of distributed data cluster and electronic equipment
CN116541206B (en) * 2023-04-10 2024-05-07 泽拓科技(深圳)有限责任公司 Data recovery method and device of distributed data cluster and electronic equipment

Also Published As

Publication number Publication date
CN106610876A (en) 2017-05-03
CN106610876B (en) 2020-11-03

Similar Documents

Publication Publication Date Title
WO2016180160A1 (en) Data snapshot recovery method and apparatus
EP3508978B1 (en) Distributed catalog, data store, and indexing
US10169385B2 (en) Managing replicated data
CN106407356B (en) Data backup method and device
CN101334797B (en) Distributed file systems and its data block consistency managing method
US7610314B2 (en) Online tablespace recovery for export
EP2795476B1 (en) Application consistent snapshots of a shared volume
US9251008B2 (en) Client object replication between a first backup server and a second backup server
US8108575B2 (en) Methods of multi-server application synchronization without stopping I/O
WO2020207010A1 (en) Data backup method and device, and computer-readable storage medium
CN111078667B (en) Data migration method and related device
EP3822793A1 (en) Data recovery method and device, server and computer readable storage medium
EP3039568B1 (en) Distributed disaster recovery file sync server system
US11341100B2 (en) System and method for eliminating full rescan synchronizations on service restarts
US11042454B1 (en) Restoration of a data source
US10936430B2 (en) Method and system for automation of differential backups
CN112346907B (en) Data backup recovery method and system based on heterogeneous object storage
US10289495B1 (en) Method and system for performing an item level restore from a backup
CN114661690A (en) Multi-version concurrency control and log clearing method, node, equipment and medium
US11074141B2 (en) Database recovery using shared memory
US11334455B2 (en) Systems and methods for repairing a data store of a mirror node
US10901641B2 (en) Method and system for inline deduplication

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16792010

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16792010

Country of ref document: EP

Kind code of ref document: A1