WO2021012932A1 - 事务回滚方法及装置、数据库、系统、计算机存储介质 - Google Patents

事务回滚方法及装置、数据库、系统、计算机存储介质 Download PDF

Info

Publication number
WO2021012932A1
WO2021012932A1 PCT/CN2020/100246 CN2020100246W WO2021012932A1 WO 2021012932 A1 WO2021012932 A1 WO 2021012932A1 CN 2020100246 W CN2020100246 W CN 2020100246W WO 2021012932 A1 WO2021012932 A1 WO 2021012932A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
rollback
log
native
transaction rollback
Prior art date
Application number
PCT/CN2020/100246
Other languages
English (en)
French (fr)
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 WO2021012932A1 publication Critical patent/WO2021012932A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the technical field of transaction rollback, and more specifically, to a transaction rollback method, a transaction rollback device, a database, a system, and a computer storage medium.
  • Typical scenarios are distributed transaction consistency recovery and misoperation recovery.
  • the distributed transaction consistency recovery scenario requires Each data node rolls back to a consistent state, involving multiple data nodes performing transaction rollbacks at the same time, which has high performance requirements. Misoperation recovery is often faced by database operation and maintenance personnel, and it is also a function that mature database products should have.
  • this disclosure proposes a fast database rollback method based on transaction logs to improve the rollback performance and further expand the application scenarios of transaction logs.
  • the transaction rollback method, transaction rollback device, database, system, and computer storage medium provided by the embodiments of the present invention mainly solve the technical problem that the transaction rollback method in the prior art can no longer meet the requirements for high performance of multiple transactions. Rolling performance is low.
  • an embodiment of the present invention provides a transaction rollback method, and the transaction rollback method includes:
  • the native transaction log file within the preset time range is parsed; the transaction to be rolled back is determined, and the transaction rollback log is generated according to the native transaction log corresponding to the transaction to be rolled back;
  • the transaction rollback log assembly generates a transaction rollback log file, and the transaction rollback log file is executed.
  • the embodiment of the present invention also provides a transaction rollback device.
  • the transaction rollback device includes a native transaction rollback control module and a transaction rollback log execution module; the native transaction rollback control module is used for receiving a transaction
  • the native transaction rollback control module is used for receiving a transaction
  • the native transaction log file within the preset time range is parsed; the transaction to be rolled back is determined, and the transaction rollback log is generated according to the native transaction log corresponding to the transaction to be rolled back; the transaction is returned in reverse order
  • the roll log assembly generates a transaction rollback log file; the transaction rollback log execution module is used to execute the transaction rollback log file.
  • the embodiment of the present invention also provides a database, and the database includes the aforementioned transaction rollback device.
  • the embodiment of the present invention also provides a system, the system includes the above-mentioned database, and the system includes a transaction rollback system based on a MySQL database, or a data recovery system based on a MariaDB distributed cluster.
  • the embodiment of the present invention also provides a computer storage medium, the computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the transaction response as described above. Steps of rolling method.
  • the beneficial effects of the present invention are: the transaction rollback method, transaction rollback device, database, system, and computer storage medium provided by the embodiments of the present invention, when a transaction rollback request is received, the original transaction within the preset time range
  • the log file is analyzed to determine the transaction to be rolled back, and the transaction rollback log is generated according to the native transaction log corresponding to the transaction to be rolled back. Further, the transaction rollback log is assembled in reverse order to generate the transaction rollback log file, and the transaction rollback is performed Log file; solves the problem that the transaction rollback method in the prior art can no longer meet the high-performance requirements for multiple transactions and the low rollback performance. That is, the transaction rollback method, transaction rollback device, database, and system provided by the embodiments of the present invention effectively improve the performance of transaction rollback, especially for batch transaction rollback.
  • FIG. 1 is a schematic diagram of the basic flow of a transaction rollback method provided by Embodiment 1 of the present invention
  • FIG. 2 is a schematic diagram of a basic process for generating a native transaction log file according to Embodiment 1 of the present invention
  • Embodiment 3 is a schematic structural diagram of a feasible transaction rollback device provided by Embodiment 3 of the present invention.
  • Embodiment 4 is a schematic structural diagram of another feasible transaction rollback device provided by Embodiment 3 of the present invention.
  • FIG. 5 is a schematic diagram of a transaction rollback system based on MySQL database provided by the fourth embodiment of the present invention.
  • Fig. 6 is a schematic diagram of a data recovery system based on MariaDB distributed cluster provided by the fourth embodiment of the present invention.
  • S201 Record the data changes of each transaction and the correlation between each transaction.
  • S202 Allocate a global transaction identifier for each transaction, and the global transaction identifier includes a database instance identifier and a global sequence identifier.
  • the database instance ID refers to which database instance the current transaction is executed on
  • the global sequence ID refers to the ID of the current transaction in a certain database.
  • the global sequence ID starts from 1 and increases in sequence.
  • S203 Assign the same batch number to each transaction that does not have relevance.
  • the same batch number can be assigned to each transaction that is not related, so that the subsequently generated transaction rollback log retains the batch number of each transaction in the native transaction log. That is, the concurrency relationship of each transaction execution in the native transaction log is retained.
  • the generated native transaction log includes not only the data changes before and after the data operation, but also the global transaction identifier and batch number.
  • the native transaction log corresponds to a single transaction, so the native transaction log can be assembled in reverse order to generate a transaction rollback log file for storage.
  • the native transaction log file includes a binary log binlog file.
  • S102 Determine the transaction to be rolled back, and generate a transaction rollback log according to the native transaction log corresponding to the transaction to be rolled back.
  • the log directory is filtered according to the preset time range to obtain the native transaction log files to be parsed, and then these native transaction log files are parsed in parallel, and based on the global transaction Identify, locate the transaction to be rolled back, and determine the transaction to be rolled back.
  • determining the transaction to be rolled back, and then generating the transaction rollback log according to the native transaction log corresponding to the transaction to be rolled back includes: performing reverse operations on the native transaction log corresponding to the transaction to be rolled back, and performing reverse operations.
  • the protocol format of the transaction rollback log generated after the operation remains the same as the protocol format of the native transaction log.
  • the native transaction log records the table data before and after the execution of each statement operation. Inserting and deleting records requires modifying the operation type, while updating records requires exchanging the table data before and after changes. Therefore, the generated transaction rollback log is consistent with the protocol format of the native transaction log.
  • the reverse operation includes at least one of a reverse order operation statement and a reverse order execution statement.
  • the protocol format of the transaction rollback log generated after the reverse operation remains the same as the protocol format of the native transaction log, it further includes: assigning the transaction rollback log the same transaction corresponding to the native transaction log The global transaction ID.
  • the global transaction identifier of the transaction to be rolled back is set to identify that the current transaction is a transaction to be rolled back, and the global transaction identifier of the transaction to be rolled back should correspond to the global transaction identifier of the original transaction, or both exist one by one The mapping relationship.
  • S103 Reversely assemble the transaction rollback log to generate a transaction rollback log file, and execute the transaction rollback log file.
  • the transaction rollback log corresponds to a single transaction to be rolled back, so the generated transaction rollback log can be assembled in reverse order according to the global sequence identifier to complete the reverse order of the transactions, and generate a transaction rollback log file.
  • executing the transaction rollback log file includes: parsing the batch number corresponding to each transaction in the transaction rollback log file, executing transactions with the same batch number in parallel, and performing transactions with different batch numbers. Transactions are executed serially. In this way, the parallel playback of the transaction to be rolled back is realized, and the performance of the transaction rollback is improved to a certain extent.
  • the transaction rollback method provided by the embodiment of the present invention analyzes the native transaction log file within a preset time range when a transaction rollback request is received to determine the transaction to be rolled back, and then according to the transaction corresponding to the transaction to be rolled back
  • the native transaction log generates the transaction rollback log.
  • the transaction rollback log is assembled in reverse order to generate the transaction rollback log file, and the transaction rollback log file is executed; it solves the problem that the transaction rollback method in the prior art cannot meet the high demand for multiple transactions. Performance requirements, low rollback performance issues.
  • the transaction rollback method provided by the embodiment of the present invention not only reduces the re-analysis of standard sentence files by the database, but also makes full use of the transaction concurrency information of the rollback log, which effectively improves the performance of transaction rollback, especially for batch transactions.
  • the rollback effect is better.
  • the embodiments of the present disclosure take the MySQL database as an example, and the process of specifying a transaction set to implement fast rollback is as follows.
  • Step 1 After receiving the transaction rollback request, retrieve the binlog log according to the specified transaction set to obtain the binlog file to be processed.
  • Step 2 Sort the binlog files in reverse order according to the serial numbers of the binlog files from large to small to form a binlog file reverse queue, and process binlog files with large serial numbers first.
  • Step 3 Create a binlog file parsing thread group, binlog transaction rollback processing thread pool, and binlog rollback log file output thread group.
  • Step 4 Each file output thread sets up a labeled task list. Rollback transactions generated in different binlog files are modulo the binlog file serial number and then delivered to the output thread task list corresponding to different labels.
  • Step 5 The parsing threads are selected from the binlog file queue in turn, and the binlog files are sequentially parsed from the beginning. If the parsed transaction exists in the specified transaction set to be rolled back, the transaction log is packaged and placed in the rollback task list.
  • Step 6 After the binlog file is parsed, flip the task list to achieve the purpose of reverse transaction processing, and then trigger the task list to perform transaction log rollback processing on the binlog file that has been parsed.
  • Step 7 The binlog transaction rollback processing thread pool obtains the task node to be rolled back from the task list, and performs rollback processing on the binlog transaction log.
  • the rollback transaction retains the global sequence identifier of the native transaction.
  • Step 8 Binlog rollback log file output.
  • the thread group receives task nodes from the thread task list in real time, and then writes the transaction rollback log into the corresponding transaction rollback log file according to the binlog protocol.
  • Step 9 According to the binlog file reverse queue, retrieve whether the first binlog file has completed the rollback processing and output, then push the transaction rollback log execution module to execute the transaction rollback log file.
  • Step 10 After the transaction rollback log execution module receives the transaction rollback log file, it parses the transactions sequentially, and executes the transaction rollback log file playback according to the strategy of paralleling the same batch of transactions and serializing different batches of transactions.
  • Step 11 After all the transaction rollback log files are played back, the task of the specified transaction set rollback ends.
  • databases that use the binlog logging protocol such as MariaDB can refer to this process to complete the transaction fast rollback, which will not be repeated here.
  • the transaction rollback log is consistent with the native transaction log protocol, and transactions can be executed in parallel to operate reverse transactions and forward transactions.
  • the transaction rollback device includes a native transaction rollback control module 302 and a transaction rollback log execution module 303;
  • the native transaction rollback control module 302 is configured to parse the native transaction log file within a preset time range when receiving a transaction rollback request; determine the transaction to be rolled back, and according to the transaction corresponding to the transaction to be rolled back The native transaction log generates a transaction rollback log; the transaction rollback log is assembled in reverse order to generate a transaction rollback log file;
  • the transaction rollback log execution module 303 is used to execute the transaction rollback log file.
  • the transaction rollback device also includes a native transaction log collection module 301, where the native transaction log collection module 301 is used to record changes in transaction data and transactions between transactions.
  • the database instance identity identifier in this embodiment refers to which database instance the current transaction is executed on
  • the global sequence identifier refers to the identifier of the current transaction in a certain database. For example, the global sequence identifier starts from 1, and then from increase.
  • the same batch number can be assigned to each transaction that does not have correlation, so that the subsequently generated transaction rollback log retains the original transaction log.
  • Batch number that is, keep the concurrency relationship of each transaction execution in the native transaction log.
  • the native transaction log generated in this embodiment includes not only the data changes before and after the data operation, but also the global transaction identifier and batch number.
  • the native transaction log in this embodiment corresponds to a single transaction, so the native transaction log can be assembled in reverse order to generate a transaction rollback log file for easy storage.
  • the native transaction log file includes a binary log binlog file.
  • the native transaction rollback control module 302 performs filtering in the log directory according to the preset time range, obtains the native transaction log files to be parsed, and then parses these native transactions in parallel Log file, and locate the transaction to be rolled back according to the global transaction identifier, and determine the transaction to be rolled back.
  • the native transaction rollback control module 302 performs reverse operations on the native transaction log corresponding to the transaction to be rolled back, and the protocol format of the transaction rollback log generated after the reverse operation remains the same as the protocol format of the native transaction log. the same.
  • the native transaction log in this embodiment records table data before and after the execution of each statement operation, inserting and deleting records requires modifying the operation type, and updating records requires exchanging table data before and after changes. Therefore, the generated rollback log is consistent with the protocol format of the native transaction log.
  • the reverse operation includes at least one of a reverse order operation statement and a reverse order execution statement.
  • the protocol format of the transaction rollback log generated by the native transaction rollback control module 302 after performing the reverse operation remains the same as the protocol format of the native transaction log, and the transaction rollback log is allocated with the native transaction The log corresponds to the same global transaction ID.
  • the native transaction rollback control module 302 sets the global transaction identifier of the transaction to be rolled back to identify that the current transaction is a transaction to be rolled back, and the global transaction identifier of the transaction to be rolled back should correspond to the global transaction identifier of the native transaction , Or there is a one-to-one mapping relationship between the two.
  • the transaction rollback log in this embodiment corresponds to a single transaction to be rolled back, so the generated transaction rollback log can be assembled in reverse order according to the global sequence identifier to complete the reverse order of the transactions, and generate a transaction rollback log file .
  • the transaction rollback log execution module 303 parses the batch number corresponding to each transaction in the transaction rollback log file, executes transactions with the same batch number in parallel, and performs transaction strings with different batch numbers. Line execution. In this way, the parallel playback of the transaction to be rolled back is realized, and the performance of the transaction rollback is improved to a certain extent.
  • the transaction rollback device includes a native transaction rollback control module and a transaction log rollback.
  • the native transaction rollback control module receives a transaction rollback request, it responds to native transaction log files within a preset time range. Perform analysis to determine the transaction to be rolled back, and then generate a transaction rollback log based on the native transaction log corresponding to the transaction to be rolled back. Further, the transaction rollback log is assembled in reverse order to generate a transaction rollback log file, which is executed by the transaction rollback log.
  • the module executes the transaction rollback log file; it solves the problem that the transaction rollback method in the prior art cannot meet the high-performance requirements for multiple transactions and the rollback performance is low.
  • the transaction rollback device not only reduces the re-analysis of standard sentence files by the database, but also makes full use of the transaction concurrency information of the rollback log, which effectively improves the performance of transaction rollback, especially for batch transactions.
  • the rollback effect is better.
  • an embodiment of the present invention provides a system, which includes the above-mentioned third embodiment.
  • Transaction rollback device In order to solve the problem that the transaction rollback method in the prior art cannot meet the high-performance requirements for multiple transactions and the low rollback performance, an embodiment of the present invention provides a system, which includes the above-mentioned third embodiment. Transaction rollback device.
  • this embodiment uses two more specific systems as examples for illustration.
  • the MySQL database is widely used, and the applications based on the MySQL database are even more diverse. No matter its form is a single database node or a database cluster, in the process of providing data services, it must have the ability to quickly roll back data transactions, that is, quick undo The ability to batch transactions.
  • the MySQL database itself uses the binlog protocol to record transaction logs, in which the transaction data table records changes and transaction execution information is relatively complete.
  • a transaction rollback device is deployed in the system, where the rollback transaction device does not require a native transaction log collection module, and only needs to adapt the native transaction rollback control module 302 based on the binlog file And the transaction rollback log execution module 303.
  • the native transaction rollback control module 302 when the native transaction rollback control module 302 receives the transaction rollback request, it analyzes the binlog file, locates the transaction to be rolled back, converts it to generate a transaction rollback log, and then assembles it in reverse order to generate a transaction rollback log file.
  • the transaction rollback log execution module 303 executes the transaction rollback log file, connects to the MySQL instance, and applies the rollback log Undo binlog file to achieve rapid transaction rollback.
  • the distributed system uses MariaDB as the basic data node to establish a data cluster.
  • An unavoidable problem in the distributed system is the consistent recovery of cluster data.
  • the data shards in each cluster are inconsistent, the data needs to be restored to the cluster consistent Location, that is, to restore each MariaDB data node to the specified transaction set state, and redundant transactions need to be rolled back quickly.
  • MariaDB database is a branch of MySQL, and its transaction log protocol is consistent with MySQL, and it is also a binlog protocol.
  • a transaction rollback device needs to be deployed on each data node, which is responsible for the transaction rollback of the corresponding node.
  • the deployed transaction rollback There is no need for a native transaction log collection module in the rollover device. It only needs to adapt the native transaction rollback control module 302 and transaction rollback log execution module 303 based on the binlog file; at the same time, global data recovery management needs to be deployed in the system
  • the module sends data recovery tasks to the native transaction rollback control module 302, and counts the recovery results of each data node.
  • the native transaction rollback control module 302 when the native transaction rollback control module 302 receives the transaction rollback request, it analyzes the binlog file, locates the transaction to be rolled back, converts it to generate a transaction rollback log, and then assembles it in reverse order to generate a transaction rollback log file.
  • the transaction rollback log execution module 303 executes the transaction rollback log file, connects to the MySQL instance, and applies the rollback log to achieve rapid transaction rollback.
  • the transaction rollback log is consistent with the native transaction log protocol, and transactions can be executed in parallel to operate reverse transactions and forward transactions.
  • an embodiment of the present invention also provides a computer storage medium.
  • the computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement transactions as described in the first and second embodiments above. The steps of the rollback method.
  • the computer storage medium includes volatile or non-volatile, removable or non-removable implemented in any method or technology for storing information (such as computer readable instructions, data structures, computer program modules, or other data) In addition to the medium.
  • Computer storage media include but are not limited to RAM (Random Access Memory), ROM (Read-Only Memory, read-only memory), EEPROM (Electrically Erasable Programmable read only memory), Flash memory or other storage technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device, or Any other medium used to store desired information and that can be accessed by a computer.
  • the functional modules/units in the system, and the device can be implemented as software (which can be implemented by program code executable by a computing device) , Firmware, hardware and their appropriate combination.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may consist of several physical components. The components are executed cooperatively.
  • Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit .
  • the computer-readable medium may include computer storage Medium (or non-transitory medium) and communication medium (or temporary medium).
  • computer storage medium includes volatile and non-volatile memory implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data).
  • flexible, removable and non-removable media are examples of flexible, removable and non-removable media.
  • communication media usually contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery media . Therefore, the present disclosure is not limited to any specific hardware and software combination.
  • the transaction rollback device, database, system, and computer storage medium provided by the foregoing embodiments, by analyzing the native transaction log file within the preset time range when a transaction rollback request is received, it is determined The transaction to be rolled back is generated, and then the transaction rollback log is generated according to the native transaction log corresponding to the transaction to be rolled back. Further, the transaction rollback log is assembled in reverse order to generate the transaction rollback log file, and the transaction rollback log file is executed; the problem is solved.
  • Some technical transaction rollback methods can no longer meet the high-performance requirements for multi-transactions and the problems of low rollback performance. That is, the transaction rollback method, transaction rollback device, database, and system provided by the embodiments of the present disclosure effectively improve the performance of transaction rollback, especially for batch transaction rollback.

Abstract

一种事务回滚方法、事务回滚装置、数据库及系统。所述方法包括通过在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析(S101),确定出待回滚事务,进而根据待回滚事务对应的原生事务日志生成事务回滚日志(S102),进一步的,倒序将事务回滚日志组装生成事务回滚日志文件,执行事务回滚日志文件(S103);解决了现有技术中事务回滚方法已无法满足对多事务高性能的要求、回滚性能低的问题,有效地提升了事务回滚的性能,尤其对批量事务回滚效果更好。

Description

事务回滚方法及装置、数据库、系统、计算机存储介质 技术领域
本公开涉及事务回滚技术领域,更具体地说,涉及一种事务回滚方法、事务回滚装置、数据库、系统及计算机存储介质。
背景技术
数据库系统在运行过程中,经常需要进行事务回滚和事务修复,较为典型的场景就是分布式事务一致性恢复和误操作恢复,其中,分布式事务一致性恢复场景,要求在最短时间内,将各数据节点回退到一致状态,涉及多个数据节点同时进行事务回滚,对性能有较高要求。而误操作恢复是数据库运维人员经常要面对的,也是成熟数据库产品应具备的功能。
目前实现数据库事务回滚的方法主要有两种:一种是使用事务日志生成反向标准语句文件,一种是在事务执行的同时生成事务回滚日志。
诸如以上场景,最常见解决方法的就是通过分析事务日志,得出反向操作,然后加以执行,如果仅是小规模事务恢复,不会有明显的性能负担,但在业务高并发场景下,将一段时间内执行过的事务全部回退,则必须要对事务回滚性能提出更高的要求。
经典传统的数据库事务回滚方法已无法满足对多事务高性能的要求,且有着较大局限性:
1.根据事务日志生成反向标准语句文件,虽可将其应用于不同类型的数据库,但执行性能较低,且生成过程中,除了依赖事务日志本身,还需要事务相关表的信息;
2.事务执行过程中实时生成事务回滚日志,这是一种悲观的策略,对事务的执行性能有较大影响,且很难同时对批量事务进行回退,有一定的 局限性。
本公开正是针对目前两种方法的局限性和缺陷,提出一种基于事务日志的数据库快速回滚方法,以提升回滚性能,并进一步拓展事务日志的应用场景。
发明内容
本发明实施例提供的事务回滚方法、事务回滚装置、数据库、系统及计算机存储介质,主要解决的技术问题是现有技术中事务回滚方法已无法满足对多事务高性能的要求、回滚性能低。
为解决上述技术问题,本发明实施例提供了一种事务回滚方法,所述事务回滚方法包括:
在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析;确定待回滚事务,并根据所述待回滚事务对应的原生事务日志生成事务回滚日志;倒序将所述事务回滚日志组装生成事务回滚日志文件,执行所述事务回滚日志文件。
本发明实施例还提供了一种事务回滚装置,所述事务回滚装置包括原生事务回滚控制模块及事务回滚日志执行模块;所述原生事务回滚控制模块,用于在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析;确定待回滚事务,并根据所述待回滚事务对应的原生事务日志生成事务回滚日志;倒序将所述事务回滚日志组装生成事务回滚日志文件;所述事务回滚日志执行模块,用于执行所述事务回滚日志文件。
本发明实施例还提供了一种数据库,所述数据库包括上述的事务回滚装置。
本发明实施例还提供了一种系统,所述系统包括上所述的数据库,所述系统包括基于MySQL数据库的事务回滚系统,或,基于MariaDB分布式集群的数据恢复系统。
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如上述的事务回滚方法的步骤。
本发明的有益效果是:本发明实施例提供的事务回滚方法、事务回滚装置、数据库、系统及计算机存储介质,通过在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析,确定出待回滚事务,进而根据待回滚事务对应的原生事务日志生成事务回滚日志,进一步的,倒序将事务回滚日志组装生成事务回滚日志文件,执行事务回滚日志文件;解决了现有技术中事务回滚方法已无法满足对多事务高性能的要求、回滚性能低的问题。也即本发明实施例提供的事务回滚方法、事务回滚装置、数据库及系统,有效地提升了事务回滚的性能,尤其对批量事务回滚效果更好。
本公开其他特征和相应的有益效果在说明书的后面部分进行阐述说明,且应当理解,至少部分有益效果从本公开说明书中的记载变的显而易见。
附图说明
下面将结合附图及实施例对本公开作进一步说明,附图中:
图1为本发明实施例一提供的一种事务回滚方法的基本流程示意图;
图2为本发明实施例一提供的一种生成原生事务日志文件的基本流程示意图;
图3为本发明实施例三提供的一种可行的事务回滚装置的结构示意图;
图4为本发明实施例三提供的另一种可行的事务回滚装置的结构示意图;
图5为本发明实施例四提供的一种基于MySQL数据库的事务回滚系统的示意图;
图6为本发明实施例四提供的一种基于MariaDB分布式集群的数据恢复系统的示意图。
具体实施方式
为了使本公开的目的、技术方案及优点更加清楚明白,下面通过具体实施方式结合附图对本公开作进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本公开,并不用于限定本公开。
实施例一:
为了解决现有技术中事务回滚方法已无法满足对多事务高性能的要求、回滚性能低的问题,在本发明实施例中,在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析,确定出待回滚事务,进而根据待回滚事务对应的原生事务日志生成事务回滚日志,进一步的,倒序将事务回滚日志组装生成事务回滚日志文件,执行事务回滚日志文件;请参见图1所示,如图1为本实施例提供的事务回滚方法的基本流程示意图。
S101:在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析。
在本实施例的一些示例中,在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析之前,包括至少以下步骤,请参见图2所示:
S201:记录各事务数据变化以及各事务之间的关联性。
S202:为各事务分配全局事务标识,全局事务标识包括数据库实例身份标识和全局序列标识。
应当理解的是,数据库实例身份标识指代当前事务在哪个数据库实例上执行,全局序列标识指代当前事务在某一个数据库中的标识,例如全局序列标识从1开始,依次自增。
S203:为不存在关联性的各事务分配相同的批次号。
应当理解的是,在生成原生事务日志的过程中为不存在关联性的各事务可分配相同的批次号,以使得后续生成的事务回滚日志保留原生事务日志中各事务的批次号,即保留原生事务日志中各事务执行时的并发关系。
S204:生成原生事务日志。
应当理解的是,生成的原生事务日志中既有数据操作前后的数据变化,也有全局事务标识和批次号。
S205:将原生事务日志组装生成原生事务日志文件。
应当理解的是,原生事务日志对应单一的事务,因此可将原生事务日志倒序组装生成事务回滚日志文件,以便于存储。
在本实施例的一些示例中,原生事务日志文件包括二进制日志binlog文件。
S102:确定待回滚事务,并根据待回滚事务对应的原生事务日志生成事务回滚日志。
应当理解的是,在接收到事务回滚请求后,根据预设时间范围在日志目录中进行过滤筛选,取得待解析的原生事务日志文件,然后,并行解析这些原生事务日志文件,并根据全局事务标识,定位到待回滚事务,至此确定出待回滚事务。
在本实施例的一些示例中,确定出待回滚事务,进而根据待回滚事务对应的原生事务日志生成事务回滚日志,包括:对待回滚事务对应的原生事务日志进行逆操作,进行逆操作后生成的事务回滚日志的协议格式保持与原生事务日志的协议格式相同。
应当理解的是,原生事务日志中记录了每条语句操作执行前后的表数据,插入和删除记录需要修改操作类型,而更新记录则需要交换前后变化的表数据。因此,生成的事务回滚日志与原生事务日志的协议格式保持一致。
在本实施例的一些示例中,逆操作包括逆序操作语句和逆序执行语句中的至少一种。
在本实施例的一些示例中,进行逆操作后生成的事务回滚日志的协议格式保持与原生事务日志的协议格式相同之后,还包括:为事务回滚日志分配与原生事务日志对应的事务相同的全局事务标识。
应当理解的是,设置待回滚事务的全局事务标识以标识当前事务是待回滚事务,且待回滚事务的全局事务标识应与原生事务的全局事务标识相对应,或者两者存在一一映射的关系。
S103:倒序将事务回滚日志组装生成事务回滚日志文件,执行事务回滚日志文件。
应当理解的是,事务回滚日志对应单一的待回滚事务,因此可将生成的事务回滚日志按照全局序列标识进行倒序组装,完成事务逆序排列,生成事务回滚日志文件。
在本实施例的一些示例中,执行事务回滚日志文件,包括:解析事务回滚日志文件中各事务对应的批次号,对批次号相同的事务并行执行,对批次号不相同的事务串行执行。这样,实现了对待回滚事务的并行回放,在一定程度上提升了事务回滚的性能。
本发明实施例提供的事务回滚方法,通过在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析,确定出待回滚事务,进而根据待回滚事务对应的原生事务日志生成事务回滚日志,进一步的,倒序将事务回滚日志组装生成事务回滚日志文件,执行事务回滚日志文件;解决了现有技术中事务回滚方法已无法满足对多事务高性能的要求、回滚性能低的问题。也即本发明实施例提供的事务回滚方法,既减少了数据库对于标准语句文件的再次解析,又充分利用回滚日志的事务并发信息,有效的提升了事务回滚的性能,尤其对批量事务回滚效果更好。
实施例二:
本公开实施例在第一实施例的基础上,以MySQL数据库为例,指定事务集合实现快速回滚过程如下。
步骤一:接收到事务回滚请求后,根据指定事务集合,检索binlog日志,获得要处理的binlog文件。
步骤二:根据binlog文件序号从大到小进行逆序排列,形成binlog文件逆序队列,优先处理序号大的binlog文件。
步骤三:创建binlog文件解析线程组、binlog事务回滚处理线程池和binlog回滚日志文件输出线程组。
步骤四:每个文件输出线程都设置一个带有标号的任务列表。不同的binlog文件中产生的回滚事务,对binlog文件序号取模后投递到不同标号所对应输出线程任务列表中。
步骤五:解析线程从binlog文件队列中依次选取,并从头开始顺序解析binlog文件。如果解析到的事务存在指定待回滚的事务集合中,则将该事务日志打包,放入回滚任务列表中。
步骤六:binlog文件解析完成后,翻转任务列表,达到事务逆序处理的目的,随后,触发任务列表,对已解析完成的binlog文件进行事务日志回滚处理。
步骤七:binlog事务回滚处理线程池从任务列表中获取待回滚任务节点,对binlog事务日志进行回滚处理。
首先对事务日志进行逆操作。若将插入操作记为I,删除操作记为D,更新操作记为U,则其逆向操作如下:
a)插入记录I[a]    ---逆向操作R--->删除记录D[a];
b)删除记录D[b]    ---逆向操作R--->插入记录I[b];
c)更新记录U[a->b] ---逆向操作R--->更新记录U[b->a];
然后设置该回滚事务的回滚标识,并在原生事务与回滚事务之间建立显式对应关系:
a)定义函数映射关系,将事务的身份标识映射为事务回滚的特有标识,即:
R(ID)=<ROLLBACK_ID>;
b)回滚事务保留原生事务的全局序列标识。
事务日志处理完成后,直接投入到待输出任务列表中。
步骤八:binlog回滚日志文件输出线程组实时从线程任务列表中接收任务节点,然后按照binlog协议将事务回滚日志写入对应的事务回滚日志文件中。
步骤九:按照binlog文件逆序队列,检索第一个binlog文件是否已经完成了回滚处理并输出,则将推送事务回滚日志执行模块,进行事务回滚日志文件的执行。
步骤十:事务回滚日志执行模块接收到事务回滚日志文件后,顺序解析事务,按照同一批次事务并行、不同批次事务串行的策略,执行事务回滚日志文件回放。
步骤十一:所有事务回滚日志文件回放完成后,指定事务集合回滚的任务结束。
此外,MariaDB等应用binlog日志协议的数据库,均可参考该过程完成事务快速回滚,这里不再赘述。
本发明实施例提供的事务回滚方法,具有至少以下有益效果:
1、适应性更加广泛。直接使用原生事务日志进行转换,独立于数据库实例,不依赖元数据信息,适应更多的场景,实用性更强。
2、利用事务日志协议进行并行回放,提高了事务的执行效率。事务回滚日志与原生事务日志协议一致,事务并行执行即可操作逆向事务,也可操作正向事务。
3、回滚事务标识与原事务标识之间存在一一映射关系,明确表示了哪些事务是回滚事务,哪些事务被回滚,便于事务回滚跟踪,尤其在批量 事务回滚任务中效果更加明显。
实施例三:
为了解决现有技术中事务回滚方法已无法满足对多事务高性能的要求、回滚性能低的问题,在本公开实施例中提供了一种事务回滚装置,请参见图3所示,该事务回滚装置包括原生事务回滚控制模块302及事务回滚日志执行模块303;
其中,原生事务回滚控制模块302,用于在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析;确定出待回滚事务,并根据待回滚事务对应的原生事务日志生成事务回滚日志;倒序将事务回滚日志组装生成事务回滚日志文件;
其中,事务回滚日志执行模块303,用于执行事务回滚日志文件。
在本实施例的一些示例中,请参见图4所示,事务回滚装置还包括原生事务日志采集模块301,其中,原生事务日志采集模块301,用于记录各事务数据变化以及各事务之间的关联性;为各事务分配全局事务标识,全局事务标识包括数据库实例身份标识和全局序列标识;为不存在关联性的各事务分配相同的批次号;生成原生事务日志;将原生事务日志组装生成原生事务日志文件。
应当理解的是,本实施例中的数据库实例身份标识指代当前事务在哪个数据库实例上执行,全局序列标识指代当前事务在某一个数据库中的标识,例如全局序列标识从1开始,依次自增。
应当理解的是,本实施例中在生成原生事务日志的过程中为不存在关联性的各事务可分配相同的批次号,以使得后续生成的事务回滚日志保留原生事务日志中各事务的批次号,即保留原生事务日志中各事务执行时的并发关系。
应当理解的是,本实施例中生成的原生事务日志中既有数据操作前后的数据变化,也有全局事务标识和批次号。
应当理解的是,本实施例中原生事务日志对应单一的事务,因此可将原生事务日志倒序组装生成事务回滚日志文件,以便于存储。
在本实施例的一些示例中,原生事务日志文件包括二进制日志binlog文件。
应当理解的是,原生事务回滚控制模块302在接收到事务回滚请求后,根据预设时间范围在日志目录中进行过滤筛选,取得待解析的原生事务日志文件,然后,并行解析这些原生事务日志文件,并根据全局事务标识,定位到待回滚事务,至此确定出待回滚事务。
在本实施例的一些示例中,原生事务回滚控制模块302对待回滚事务对应的原生事务日志进行逆操作,进行逆操作后生成的事务回滚日志的协议格式保持与原生事务日志的协议格式相同。
应当理解的是,本实施例中的原生事务日志中记录了每条语句操作执行前后的表数据,插入和删除记录需要修改操作类型,而更新记录则需要交换前后变化的表数据。因此,生成的回滚日志与原生事务日志的协议格式保持一致。
在本实施例的一些示例中,逆操作包括逆序操作语句和逆序执行语句中的至少一种。
在本实施例的一些示例中,原生事务回滚控制模块302进行逆操作后生成的事务回滚日志的协议格式保持与原生事务日志的协议格式相同之后,还为事务回滚日志分配与原生事务日志对应的事务相同的全局事务标识。
应当理解的是,原生事务回滚控制模块302设置待回滚事务的全局事务标识以标识当前事务是待回滚事务,且待回滚事务的全局事务标识应与原生事务的全局事务标识相对应,或者两者存在一一映射的关系。
应当理解的是,本实施例中的事务回滚日志对应单一的待回滚事务,因此可将生成的事务回滚日志按照全局序列标识进行倒序组装,完成事务逆序排列,生成事务回滚日志文件。
在本实施例的一些示例中,事务回滚日志执行模块303解析事务回滚日志文件中各事务对应的批次号,对批次号相同的事务并行执行,对批次号不相同的事务串行执行。这样,实现了对待回滚事务的并行回放,在一定程度上提升了事务回滚的性能。
本发明实施例提供的事务回滚装置,其包括原生事务回滚控制模块和事务日志回滚原生事务回滚控制模块在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析,确定出待回滚事务,进而根据待回滚事务对应的原生事务日志生成事务回滚日志,进一步的,倒序将事务回滚日志组装生成事务回滚日志文件,由事务回滚日志执行模块执行事务回滚日志文件;解决了现有技术中事务回滚方法已无法满足对多事务高性能的要求、回滚性能低的问题。也即本发明实施例提供的事务回滚装置,既减少了数据库对于标准语句文件的再次解析,又充分利用回滚日志的事务并发信息,有效的提升了事务回滚的性能,尤其对批量事务回滚效果更好。
实施例四:
为了解决现有技术中事务回滚方法已无法满足对多事务高性能的要求、回滚性能低的问题,在本发明实施例中提供了一种系统,该系统包括上述实施例三所述的事务回滚装置。
为了更好的理解,本实施例以两种较为具体的系统为例进行示例说明。
首先以基于MySQL数据库的事务回滚系统进行说明:
目前MySQL数据库应用较为广泛,基于MySQL数据库的应用更是多种多样,无论其形式是单数据库节点还是数据库集群,在提供数据服务过程中,必须要具备数据事务快速回滚的能力,即快速撤销批量事务的能力。
MySQL数据库本身使用binlog协议来记录事务日志,其中事务数据表记录变化和事务执行信息较为完备。可选地,请参见图5所示,在该系 统中部署事务回滚装置,其中该回滚事务装置无需原生事务日志采集模块,只需要基于binlog文件,适配上原生事务回滚控制模块302和事务回滚日志执行模块303即可。
其中,原生事务回滚控制模块302接收事务回滚请求时,分析binlog文件,定位待回滚事务,将其转换生成事务回滚日志,再倒序组装生成事务回滚日志文件。
其中,事务回滚日志执行模块303执行事务回滚日志文件,连接MySQL实例,应用回滚日志Undo binlog文件,实现事务快速回滚。
其次以基于MariaDB分布式集群的数据恢复系统进行说明:
该分布式系统以MariaDB为基础数据节点,建立数据集群,分布式系统中不可回避的一个问题就是集群数据的一致性恢复,当各集群内数据分片不一致时,需要将数据恢复到集群一致的位置,也就是将各个MariaDB数据节点恢复到指定事务集合状态,多余事务需要快速回滚掉。
MariaDB数据库是MySQL的一个分支,其事务日志协议与MySQL一致,也是binlog协议。可选地,请参见图6所示,在该数据恢复系统中,需要在每个数据节点上均部署事务回滚装置,其分别负责相应节点的事务回滚,同样的,部署的各事务回滚装置中无需原生事务日志采集模块,只需要基于binlog文件,适配上原生事务回滚控制模块302和事务回滚日志执行模块303即可;同时,在该系统中还需要部署全局数据恢复管理模块,向原生事务回滚控制模块302下发数据恢复任务,并统计各数据节点恢复结果。
其中,原生事务回滚控制模块302接收事务回滚请求时,分析binlog文件,定位待回滚事务,将其转换生成事务回滚日志,再倒序组装生成事务回滚日志文件。
其中,事务回滚日志执行模块303执行事务回滚日志文件,连接MySQL实例,应用回滚日志,实现事务快速回滚。
本发明实施例提供的系统,具有至少以下有益效果:
1、适应性更加广泛。直接使用原生事务日志进行转换,独立于数据库实例,不依赖元数据信息,适应更多的场景,实用性更强。
2、利用事务日志协议进行并行回放,提高了事务的执行效率。事务回滚日志与原生事务日志协议一致,事务并行执行即可操作逆向事务,也可操作正向事务。
3、回滚事务标识与原事务标识之间存在一一映射关系,明确表示了哪些事务是回滚事务,哪些事务被回滚,便于事务回滚跟踪,尤其在批量事务回滚任务中效果更加明显。
同时,本发明实施例还提供一种计算机存储介质,计算机存储介质存储有一个或者多个程序,一个或者多个程序可被一个或者多个处理器执行,以实现如上述实施例一、二事务回滚方法的步骤。
该计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、计算机程序模块或其他数据)的任何方法或技术中实施的易失性或非易失性、可移除或不可移除的介质。计算机存储介质包括但不限于RAM(Random Access Memory,随机存取存储器),ROM(Read-Only Memory,只读存储器),EEPROM(Electrically Erasable Programmable read only memory,带电可擦可编程只读存储器)、闪存或其他存储器技术、CD-ROM(Compact Disc Read-Only Memory,光盘只读存储器),数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。
显然,本领域的技术人员应该明白,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件(可以用计算装置可执行的程序代码来实现)、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理 组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。所以,本公开不限制于任何特定的硬件和软件结合。
以上内容是结合具体的实施方式对本公开所作的进一步详细说明,不能认定本公开的具体实施只局限于这些说明。对于本公开所属技术领域的普通技术人员来说,在不脱离本公开构思的前提下,还可以做出若干简单推演或替换,都应当视为属于本公开的保护范围。
工业实用性
基于上述实施例所提供的事务回滚方法、事务回滚装置、数据库、系统及计算机存储介质,通过在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析,确定出待回滚事务,进而根据待回滚事务对应的原生事务日志生成事务回滚日志,进一步的,倒序将事务回滚日志组装生成事务回滚日志文件,执行事务回滚日志文件;解决了现有技术中事务回滚方法已无法满足对多事务高性能的要求、回滚性能低的问题。也即本公开实施例提供的事务回滚方法、事务回滚装置、数据库及系统,有效地提升了事务回滚的性能,尤其对批量事务回滚效果更好。

Claims (13)

  1. 一种事务回滚方法,所述事务回滚方法包括:
    在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析;
    确定待回滚事务,并根据所述待回滚事务对应的原生事务日志生成事务回滚日志;
    倒序将所述事务回滚日志组装生成事务回滚日志文件,执行所述事务回滚日志文件。
  2. 如权利要求1所述的事务回滚方法,其中,所述在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析之前,包括:
    记录各事务数据变化以及各事务之间的关联性;
    为所述各事务分配全局事务标识,所述全局事务标识包括数据库实例身份标识和全局序列标识;
    为不存在关联性的各事务分配相同的批次号;
    生成原生事务日志;
    将所述原生事务日志组装生成原生事务日志文件。
  3. 如权利要求2所述的事务回滚方法,其中,所述原生事务日志文件包括二进制日志binlog文件。
  4. 如权利要求2或3所述的事务回滚方法,其中,所述确定待回滚事务,并根据所述待回滚事务对应的原生事务日志生成事务回滚日志,包括:
    对所述待回滚事务对应的原生事务日志进行逆操作,进行逆操作后生成的事务回滚日志的协议格式保持与所述原生事务日志的协议格式相同。
  5. 如权利要求4所述的事务回滚方法,其中,所述逆操作包括:逆序操作语句和逆序执行语句中的至少一种。
  6. 如权利要求4所述的事务回滚方法,其中,所述进行逆操作后生成的事务回滚日志的协议格式保持与所述原生事务日志的协议格式相同之后,还包括:
    为事务回滚日志分配与所述原生事务日志对应的事务相同的全局事务标识。
  7. 如权利要求2或3所述的事务回滚方法,其中,所述执行所述事务回滚日志文件,包括:
    解析所述事务回滚日志文件中各事务对应的批次号,对批次号相同的事务并行执行,对批次号不相同的事务串行执行。
  8. 一种事务回滚装置,所述事务回滚装置包括原生事务回滚控制模块及事务回滚日志执行模块;
    所述原生事务回滚控制模块,用于在接收到事务回滚请求时,对预设时间范围内的原生事务日志文件进行解析;确定待回滚事务,并根据所述待回滚事务对应的原生事务日志生成事务回滚日志;倒序将所述事务回滚日志组装生成事务回滚日志文件;
    所述事务回滚日志执行模块,用于执行所述事务回滚日志文件。
  9. 如权利要求8所述的事务回滚装置,其中,所述事务回滚装置还包括原生事务日志采集模块;
    所述原生事务日志采集模块,用于记录各事务数据变化以及各事务之间的关联性;为所述各事务分配全局事务标识,所述全局事务标识包括数据库实例身份标识和全局序列标识;为不存在关联性的各事务分配相同的批次号;生成原生事务日志;将所述原生事务日志组装生成原生事务日志文件。
  10. 如权利要求8所述的事务回滚装置,其中,所述事务回滚日志执 行模块,用于解析所述事务回滚日志文件中各事务对应的批次号,对批次号相同的事务并行执行,对批次号不相同的事务串行执行。
  11. 一种数据库,所述数据库包括如权利要求8至10任一项所述的事务回滚装置。
  12. 一种系统,所述系统包括如权利要求11所述的数据库,所述系统包括基于MySQL数据库的事务回滚系统,或,基于MariaDB分布式集群的数据恢复系统。
  13. 一种计算机存储介质,所述计算机存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如权利要求1至7任一项所述的事务回滚方法的步骤。
PCT/CN2020/100246 2019-07-22 2020-07-03 事务回滚方法及装置、数据库、系统、计算机存储介质 WO2021012932A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910662619.1 2019-07-22
CN201910662619.1A CN112256656B (zh) 2019-07-22 2019-07-22 事务回滚方法及装置、数据库、系统、计算机存储介质

Publications (1)

Publication Number Publication Date
WO2021012932A1 true WO2021012932A1 (zh) 2021-01-28

Family

ID=74192444

Family Applications (2)

Application Number Title Priority Date Filing Date
PCT/CN2020/098046 WO2021012868A1 (zh) 2019-07-22 2020-06-24 事务回滚方法及装置、数据库、系统、计算机存储介质
PCT/CN2020/100246 WO2021012932A1 (zh) 2019-07-22 2020-07-03 事务回滚方法及装置、数据库、系统、计算机存储介质

Family Applications Before (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/098046 WO2021012868A1 (zh) 2019-07-22 2020-06-24 事务回滚方法及装置、数据库、系统、计算机存储介质

Country Status (2)

Country Link
CN (1) CN112256656B (zh)
WO (2) WO2021012868A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817798A (zh) * 2021-02-26 2021-05-18 北京车和家信息技术有限公司 一种数据恢复方法、装置、介质和电子设备

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988775B (zh) * 2021-04-15 2021-08-10 南京吉拉福网络科技有限公司 处理批量交易的方法、计算设备和存储介质
CN113254425B (zh) * 2021-06-24 2022-01-11 阿里云计算有限公司 数据库事务保持的方法、设备、系统、程序及存储介质
CN113468196B (zh) * 2021-07-19 2024-04-05 京东科技控股股份有限公司 用于处理数据的方法、装置、系统、服务器和介质
CN113485998A (zh) * 2021-07-27 2021-10-08 中国银行股份有限公司 Redis事务处理方法及装置、电子设备、存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170046364A1 (en) * 2015-08-10 2017-02-16 International Business Machines Corporation Optimizing online schema processing for busy database objects
CN106503264A (zh) * 2016-11-29 2017-03-15 中国银行股份有限公司 基于oracle数据库的联机交易日志记录方法及设备
CN106547801A (zh) * 2015-09-23 2017-03-29 北京奇虎科技有限公司 数据库数据闪回方法和装置
US20170123675A1 (en) * 2013-04-30 2017-05-04 Inuron Method for layered storage of enterprise data

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7289992B2 (en) * 2003-05-01 2007-10-30 International Business Machines Corporation Method, system, and program for lock and transaction management
US8145686B2 (en) * 2005-05-06 2012-03-27 Microsoft Corporation Maintenance of link level consistency between database and file system
US20070288526A1 (en) * 2006-06-08 2007-12-13 Emc Corporation Method and apparatus for processing a database replica
CN101360309B (zh) * 2007-08-03 2011-06-08 华为技术有限公司 一种服务开通指令的执行方法、装置及系统
CN101464890B (zh) * 2008-12-30 2012-05-23 中兴通讯股份有限公司 一种混合日志生成方法和解析方法
CN102760161A (zh) * 2012-06-12 2012-10-31 天津神舟通用数据技术有限公司 一种基于事务聚集的日志组织结构及实现其相应的恢复协议的方法
CN103312549B (zh) * 2013-06-26 2016-08-24 华为技术有限公司 一种事务管理方法及装置和系统
CN104750755B (zh) * 2013-12-31 2018-06-15 阿里巴巴集团控股有限公司 一种数据库主备切换后的数据回补方法及系统
CN104866403B (zh) * 2015-05-13 2016-09-21 上海钢富电子商务有限公司 分布式任务处理系统及方法
CN106557514A (zh) * 2015-09-29 2017-04-05 中兴通讯股份有限公司 一种分布式事务回滚方法及装置
SE2251212A1 (en) * 2015-11-25 2022-10-15 Teamifier Inc Apparatuses for graphically representing a reconfigured portion of a directed acyclic graph as a hierarchical tree structure
CN107220142B (zh) * 2016-03-22 2020-10-09 阿里巴巴集团控股有限公司 执行数据恢复操作的方法及装置
CN107241370A (zh) * 2016-03-29 2017-10-10 西门子公司 IaaS云环境下资源操作的回滚方法及系统
CN106682140A (zh) * 2016-12-20 2017-05-17 华北计算技术研究所(中国电子科技集团公司第十五研究所) 一种基于时间戳和映射策略的多系统用户增量同步方法
CN107329966B (zh) * 2017-05-11 2020-05-19 昆仑智汇数据科技(北京)有限公司 机器数据存储方法及系统
CN110019050A (zh) * 2017-10-19 2019-07-16 中兴通讯股份有限公司 一种数据回滚方法、系统、设备及计算机可读存储介质
CN109408294A (zh) * 2018-11-13 2019-03-01 郑州云海信息技术有限公司 一种快照回滚方法、装置、设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170123675A1 (en) * 2013-04-30 2017-05-04 Inuron Method for layered storage of enterprise data
US20170046364A1 (en) * 2015-08-10 2017-02-16 International Business Machines Corporation Optimizing online schema processing for busy database objects
CN106547801A (zh) * 2015-09-23 2017-03-29 北京奇虎科技有限公司 数据库数据闪回方法和装置
CN106503264A (zh) * 2016-11-29 2017-03-15 中国银行股份有限公司 基于oracle数据库的联机交易日志记录方法及设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112817798A (zh) * 2021-02-26 2021-05-18 北京车和家信息技术有限公司 一种数据恢复方法、装置、介质和电子设备

Also Published As

Publication number Publication date
CN112256656A (zh) 2021-01-22
CN112256656B (zh) 2023-04-18
WO2021012868A1 (zh) 2021-01-28

Similar Documents

Publication Publication Date Title
WO2021012932A1 (zh) 事务回滚方法及装置、数据库、系统、计算机存储介质
CN110442560B (zh) 一种日志重演方法、装置、服务器和存储介质
CN107391628B (zh) 数据同步方法及装置
CN108241555B (zh) 一种分布式数据库的备份、恢复方法、装置和服务器
US10891264B2 (en) Distributed, scalable key-value store
US9619430B2 (en) Active non-volatile memory post-processing
KR101476018B1 (ko) 플래시카피 캐스케이드내의 버퍼 디스크
US11010103B2 (en) Distributed batch processing of non-uniform data objects
CN107016016B (zh) 一种数据处理的方法及装置
US20190102259A1 (en) Logging process in a data storage system
CN105574141B (zh) 一种对数据库进行数据迁移的方法和装置
US10922307B2 (en) Automated transaction engine
CN105701190A (zh) 一种数据同步的方法和装置
US9128962B2 (en) View based table replacement for applications
US20190179565A1 (en) Global occupancy aggregator for global garbage collection scheduling
CN112416654B (zh) 一种数据库日志重演方法、装置、设备及存储介质
CN112464044B (zh) 一种文件数据块变化信息监控管理系统及其方法
CN112131214A (zh) 数据写入、数据查询的方法、系统、设备和存储介质
US20110106760A1 (en) Synchronizing database and non-database resources without a commit coordinator
WO2017067397A1 (zh) 一种数据恢复方法和装置
US20140149697A1 (en) Memory Pre-Allocation For Cleanup and Rollback Operations
CN111125047B (zh) 冷热数据目录识别方法及装置
CN112699129A (zh) 一种数据处理系统、方法及装置
CN107844491B (zh) 一种在分布式系统中实现强一致性读操作的方法与设备
CN111541747A (zh) 一种数据的检查点设置方法及装置

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: 20843601

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: 20843601

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20843601

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 210922)

122 Ep: pct application non-entry in european phase

Ref document number: 20843601

Country of ref document: EP

Kind code of ref document: A1