CN115048453A - Data synchronization method, device, equipment and storage medium - Google Patents
Data synchronization method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115048453A CN115048453A CN202210540734.3A CN202210540734A CN115048453A CN 115048453 A CN115048453 A CN 115048453A CN 202210540734 A CN202210540734 A CN 202210540734A CN 115048453 A CN115048453 A CN 115048453A
- Authority
- CN
- China
- Prior art keywords
- group
- synchronization
- transaction
- synchronized
- library
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 230000001360 synchronised effect Effects 0.000 claims abstract description 168
- 238000012790 confirmation Methods 0.000 claims abstract description 55
- 230000000903 blocking effect Effects 0.000 claims description 34
- 238000004590 computer program Methods 0.000 claims description 22
- 238000012545 processing Methods 0.000 abstract description 22
- 238000011084 recovery Methods 0.000 abstract description 15
- 230000006870 function Effects 0.000 description 6
- 230000010076 replication Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/275—Synchronous replication
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Hardware Redundancy (AREA)
Abstract
本申请提供了一种数据同步的方法、装置、设备及存储介质。该方法包括:确定主库内已注册的各从库所属分组中的活跃组;判断是否接收到每一所述活跃组内至少一个从库对待同步事务的同步确认消息,若是则提交所述待同步事务。本申请利用每一活跃组内的至少一个从库实现待同步事务的数据同步,无需在每一从库内完成待同步事务的数据同步,保证数据同步的事务处理性能。而且,每一活跃组内均有至少一个从库完成待同步事务的数据同步,使得在主库所在的整个活跃组故障时,仍能够利用其他活跃组内完成数据同步的从库实现主从库切换,从而提高数据同步的容灾范围。
The present application provides a method, apparatus, device and storage medium for data synchronization. The method includes: determining an active group in a group to which each slave library registered in the master library belongs; judging whether a synchronization confirmation message for a transaction to be synchronized by at least one slave library in each active group is received, and if so, submitting the pending transaction Synchronous transactions. The present application utilizes at least one slave library in each active group to realize the data synchronization of the transaction to be synchronized, and does not need to complete the data synchronization of the transaction to be synchronized in each slave library, thereby ensuring the transaction processing performance of the data synchronization. Moreover, there is at least one slave library in each active group to complete the data synchronization of the transaction to be synchronized, so that when the entire active group where the master library is located fails, the master-slave library can still be realized by using the slave libraries that complete data synchronization in other active groups switch, thereby improving the disaster recovery range of data synchronization.
Description
技术领域technical field
本申请实施例涉及数据处理技术领域,具体涉及一种数据同步的方法、装置、设备及存储介质。The embodiments of the present application relate to the technical field of data processing, and in particular, to a method, apparatus, device, and storage medium for data synchronization.
背景技术Background technique
为了确保业务数据的安全性,在数据存储时通常会采用主从架构来构建相应的数据库集群,以此实现各类业务数据的主从同步处理,从而提升数据库存储的高可用性和可扩展性。目前,通常采用异步复制或全同步复制进行数据同步处理。In order to ensure the security of business data, a master-slave architecture is usually used to build a corresponding database cluster during data storage, so as to realize the master-slave synchronization processing of various business data, thereby improving the high availability and scalability of database storage. At present, asynchronous replication or full synchronous replication is usually used for data synchronization.
但是,异步复制中主库并不关注从库对当前事务的数据同步情况而直接向客户端返回事务处理结果,存在主库出现故障时从库可能还未完成数据同步,而导致从库切换为主库后数据不完整的情况,极大降低数据同步的容灾效果。全同步复制中,主库会等所有从库均完成当前事务的数据同步后才向客户端返回事务处理结果,极大影响了事务处理性能。因此,为了解决上述问题,急需设计一种更为高效容灾的数据同步方案。However, in asynchronous replication, the master library does not pay attention to the data synchronization of the current transaction from the slave library, and directly returns the transaction processing results to the client. When the master library fails, the slave library may not have completed data synchronization, which causes the slave library to switch to Incomplete data after the main database greatly reduces the disaster recovery effect of data synchronization. In full synchronous replication, the master database will wait for all slave databases to complete the data synchronization of the current transaction before returning the transaction processing result to the client, which greatly affects the transaction processing performance. Therefore, in order to solve the above problems, it is urgent to design a more efficient disaster recovery data synchronization scheme.
发明内容SUMMARY OF THE INVENTION
本申请提供一种数据同步的方法、装置、设备及存储介质,利用分组同步的方式,在保证事务处理性能的基础上,提高数据同步的容灾范围。The present application provides a method, device, device and storage medium for data synchronization. The method of group synchronization is used to improve the disaster tolerance range of data synchronization on the basis of ensuring transaction processing performance.
第一方面,本申请实施例提供了一种数据同步的方法,该方法包括:In a first aspect, an embodiment of the present application provides a method for data synchronization, the method comprising:
确定主库内已注册的各从库所属分组中的活跃组;Determine the active group in the group to which each slave library registered in the master library belongs;
判断是否接收到每一所述活跃组内至少一个从库对待同步事务的同步确认消息,若是则提交所述待同步事务。It is judged whether a synchronization confirmation message for a transaction to be synchronized from at least one slave library in each of the active groups is received, and if so, the transaction to be synchronized is submitted.
第二方面,本申请实施例提供了一种数据同步的装置,该装置包括:In a second aspect, an embodiment of the present application provides an apparatus for data synchronization, the apparatus comprising:
分组确定模块,用于确定主库内已注册的各从库所属分组中的活跃组;The grouping determination module is used to determine the active group in the group to which each slave library registered in the master library belongs;
数据同步模块,用于判断是否接收到每一所述活跃组内至少一个从库对待同步事务的同步确认消息,若是则提交所述待同步事务。The data synchronization module is used for judging whether a synchronization confirmation message of at least one slave database in each active group is received for the transaction to be synchronized, and if so, the transaction to be synchronized is submitted.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括:In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
处理器和存储器,所述存储器用于存储计算机程序,所述处理器用于调用并运行所述存储器中存储的计算机程序,以执行本申请第一方面中提供的数据同步的方法。A processor and a memory, where the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method for data synchronization provided in the first aspect of the present application.
第四方面,本申请实施例提供了一种计算机可读存储介质,用于存储计算机程序,所述计算机程序使得计算机执行如本申请第一方面中提供的数据同步的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, the computer program causing a computer to execute the data synchronization method provided in the first aspect of the present application.
第五方面,本申请实施例提供了一种计算机程序产品,包括计算机程序/指令,其特征在于,该计算机程序/指令被处理器执行时实现如本申请第一方面中提供的数据同步的方法。In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program/instruction, characterized in that, when the computer program/instruction is executed by a processor, the method for data synchronization as provided in the first aspect of the present application is implemented .
本申请实施例提供的一种数据同步的方法、装置、设备及存储介质,为主库内已注册的各个从库设置分组,并从各个分组中确定出活跃组,然后在主库接收到每一活跃组内至少一个从库对待同步事务的同步确认消息时,来执行待同步事务的提交操作,从而利用每一活跃组内的至少一个从库实现待同步事务的数据同步,无需在每一从库内完成待同步事务的数据同步,保证数据同步的事务处理性能。而且,每一活跃组内均有至少一个从库完成待同步事务的数据同步,使得在主库所在的整个活跃组故障时,仍能够利用其他活跃组内完成数据同步的从库实现主从库切换,从而提高数据同步的容灾范围。In a data synchronization method, device, device and storage medium provided by the embodiments of the present application, a group is set for each slave library registered in the master library, an active group is determined from each group, and then each slave library is received in the master library. When at least one slave library in an active group has a synchronization confirmation message of the transaction to be synchronized, the commit operation of the transaction to be synchronized is performed, so that at least one slave library in each active group is used to realize the data synchronization of the transaction to be synchronized, and there is no need to perform the data synchronization of the transaction to be synchronized in each active group. Complete the data synchronization of the transaction to be synchronized from the library to ensure the transaction processing performance of the data synchronization. Moreover, there is at least one slave library in each active group to complete the data synchronization of the transaction to be synchronized, so that when the entire active group where the master library is located fails, the master-slave library can still be realized by using the slave libraries in other active groups that complete data synchronization switch, thereby improving the disaster recovery range of data synchronization.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.
图1为本申请实施例示出的一种数据同步的方法的流程图;1 is a flowchart of a method for data synchronization shown in an embodiment of the application;
图2为本申请实施例示出的另一种数据同步的方法的流程图;2 is a flowchart of another data synchronization method shown in an embodiment of the application;
图3为本申请实施例示出的一种数据同步的装置的原理框图;3 is a schematic block diagram of an apparatus for data synchronization shown in an embodiment of the application;
图4是本申请实施例提供的电子设备的示意性框图。FIG. 4 is a schematic block diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present invention.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或服务器不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second" and the like in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used may be interchanged under appropriate circumstances such that the embodiments of the invention described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or server comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
考虑到数据同步时的异步复制和全同步复制,对于数据同步的容灾效果和事务处理性能无法兼容的情况,本申请设计了一种新的数据同步方案。通过为主库的各个从库进行分组,然后在确定各分组中的每一活跃组内至少一个从库已完成对待同步事务的同步确认后,来提交待同步事务。此时,利用每一活跃组内的至少一个从库实现待同步事务的数据同步,无需在每一从库内完成待同步事务的数据同步,保证数据同步的事务处理性能。而且,每一活跃组内均有至少一个从库完成待同步事务的数据同步,使得在主库所在的整个活跃组故障时,仍能够利用其他活跃组内完成数据同步的从库实现主从库切换,从而提高数据同步的容灾范围。Considering the asynchronous replication and full synchronous replication during data synchronization, the disaster tolerance effect of data synchronization and the transaction processing performance are not compatible, the present application designs a new data synchronization scheme. The transaction to be synchronized is submitted by grouping each slave library of the master library, and after it is determined that at least one slave library in each active group in each group has completed the synchronization confirmation of the transaction to be synchronized. At this time, at least one slave library in each active group is used to realize the data synchronization of the transaction to be synchronized, and there is no need to complete the data synchronization of the transaction to be synchronized in each slave library, thereby ensuring the transaction processing performance of the data synchronization. Moreover, there is at least one slave library in each active group to complete the data synchronization of the transaction to be synchronized, so that when the entire active group where the master library is located fails, the master-slave library can still be realized by using the slave libraries in other active groups that complete data synchronization switch, thereby improving the disaster recovery range of data synchronization.
图1为本申请实施例示出的一种数据同步的方法的流程图。参照图1,该方法具体可以包括如下步骤:FIG. 1 is a flowchart of a data synchronization method according to an embodiment of the present application. 1, the method may specifically include the following steps:
S110,确定主库内已注册的各从库所属分组中的活跃组。S110: Determine the active group in the group to which each slave library registered in the master library belongs.
其中,本申请中的待同步事务为主库针对用户向主库发起的事务请求所执行的该事务请求指向的各种数据库事务。此时,为了确保主从库间的数据同步,对于主库所处理的任一事务,要求从库也能完成一次相同处理,以保证主从库间存在相同的事务数据。The transaction to be synchronized in the present application refers to various database transactions pointed to by the transaction request executed by the main database for the transaction request initiated by the user to the main database. At this time, in order to ensure data synchronization between the master and slave libraries, for any transaction processed by the master library, the slave library is required to complete the same processing once to ensure that the same transaction data exists between the master and slave libraries.
作为本申请中的一种可选实现方案,主从库间执行数据同步时,在主库完成对某一事务的处理后,会将该事务作为本申请中的待同步事务。而且,主库会生成该待同步事务的二进制日志(binlog)。进而,后续各个从库可以向主库请求待同步事务的二进制日志,来执行待同步事务在主从库上的数据同步操作。As an optional implementation solution in this application, when data synchronization is performed between the master and slave databases, after the master database completes the processing of a transaction, the transaction will be regarded as the transaction to be synchronized in this application. Moreover, the main library will generate a binary log (binlog) of the transaction to be synchronized. Furthermore, each subsequent slave library may request the master library for the binary log of the transaction to be synchronized, so as to perform the data synchronization operation of the transaction to be synchronized on the master and slave libraries.
在本申请中,为了在数据同步时,能够达到兼容事务处理性能和数据同步容灾性能的效果,也就是尽可能在提升主库对于事务处理高效性的基础上,还能够确保事务在各个从库上的数据同步具备一个较大的容灾范围,以提升数据同步的容灾性。In this application, in order to achieve the effect of compatible transaction processing performance and data synchronization disaster tolerance performance during data synchronization, that is, on the basis of improving the efficiency of the main database for transaction processing as much as possible, it can also ensure that transactions are performed in each slave database. Data synchronization on the database has a large disaster recovery range to improve the disaster recovery of data synchronization.
此时,为了确保数据同步在从库上具备较大的容灾范围,本申请会为主库内注册的各个从库设定一个分组的信息。在将各个从库注册到主库时,预先将各个从库划分到不同的分组内,以便主库针对不同分组内的从库设定相应的数据同步逻辑,使得数据同步能够具备分组级别下的容灾性能。At this time, in order to ensure that the data synchronization has a large disaster tolerance range on the slave database, this application will set a group of information for each slave database registered in the master database. When registering each slave library to the master library, each slave library is divided into different groups in advance, so that the master library can set the corresponding data synchronization logic for the slave libraries in different groups, so that data synchronization can have the functions under the group level. Disaster recovery performance.
需要说明的是,由于主库内注册的各个从库可能部署在多个机房内,而若某一机房出现故障或者阻塞,那么该机房内所有从库对于事务的数据同步操作可能会失败,进而使得在主库故障时,如果由该机房内某一从库切换为主库,那么会出现切换后的主库数据不完整的情况,极大降低数据同步的容灾效果。因此,本申请中可以按照各个从库所在的机房,将同一机房内的各个从库划分至同一分组内,然后判断不同分组内是否存在至少一个从库成功完成对事务的数据同步操作,从而在分组级别上判断事务的数据同步成功性,以提高数据同步时的容灾范围。It should be noted that since each slave library registered in the master library may be deployed in multiple computer rooms, if a computer room fails or is blocked, the data synchronization operation of all slave libraries in the computer room for transactions may fail, and then When the master database fails, if a slave database in the computer room is switched to the master database, the data of the master database after the switch will be incomplete, which greatly reduces the disaster recovery effect of data synchronization. Therefore, in the present application, each slave library in the same computer room can be divided into the same group according to the computer room where each slave library is located, and then it is judged whether there is at least one slave library in different groups that successfully completes the data synchronization operation for the transaction, so that in the The data synchronization success of the transaction is judged at the group level to improve the disaster tolerance range during data synchronization.
应当理解的是,通过在各个从库上配置主库的网际互连协议(InternetProtocol,简称为IP)地址、用户名和密码等信息,可以使各个从库与主库连接,并将各个从库注册至主库中。而且,每一从库在向主库注册时,会设置一个数据包,该数据包内包含从库的服务标识、IP地址、端口和所属分组等信息。进而,主库在收到各个从库的注册信息后,即可确定每一从库所属的分组。It should be understood that, by configuring information such as the Internet Protocol (Internet Protocol, IP) address, user name and password of the master library on each slave library, each slave library can be connected to the master library, and each slave library can be registered. to the main library. Moreover, when each slave library registers with the master library, a data packet will be set, and the data packet contains information such as the service identifier, IP address, port, and group of the slave library. Furthermore, after receiving the registration information of each slave library, the master library can determine the group to which each slave library belongs.
作为本申请中的一种的可选实现方案,考虑到对于任一事务的数据同步,同一分组内的所有从库可能由于分组故障或阻塞而影响到该分组内任一从库的数据同步成功性。然而,其他分组内的从库能够正常执行事务的数据同步操作,仍然可以保证主库故障时的数据同步容灾性能。因此,本申请可以将各个分组区分为能够正常执行数据同步的活跃组和由于分组故障或阻塞而无法正常执行数据同步的阻塞组。As an optional implementation solution in this application, considering the data synchronization of any transaction, all the slave libraries in the same group may affect the successful data synchronization of any slave library in the group due to group failure or blocking sex. However, the slave databases in other groups can normally perform the data synchronization operation of the transaction, and the disaster recovery performance of data synchronization when the master database fails can still be guaranteed. Therefore, the present application can distinguish each group into an active group that can normally perform data synchronization and a blocked group that cannot perform data synchronization normally due to group failure or blocking.
在本申请中,为了避免某一分组故障或阻塞而影响到事务处理性能,本申请可以从主库内注册的各个从库所属的全部分组中,查找出各个活跃组。进而,后续通过判断每一活跃组内从库对于事务的数据同步情况即可。In the present application, in order to prevent the failure or blocking of a certain group from affecting the transaction processing performance, the present application can find out each active group from all the groups to which each slave library registered in the master library belongs. Further, it is sufficient to determine the data synchronization status of the transaction with respect to the transaction from the slave library in each active group.
S120,判断是否接收到每一活跃组内至少一个从库对待同步事务的同步确认消息,若是则提交待同步事务。S120: Determine whether a synchronization confirmation message for a transaction to be synchronized from at least one slave library in each active group is received, and if so, submit the transaction to be synchronized.
在确定出从库所属分组中的各个活跃组后,对于主库执行完成的任一待同步事务,各个活跃组内的从库会按照自身对于事务数据同步的进度情况,不断向主库请求每个待同步事务在主库处理完成后生成的二进制日志,以便由各个从库通过执行该二进制日志来对待同步事务进行数据同步。在某一从库完成对待同步事务的数据同步操作后,该从库会向主库回复一条对该待同步事务的同步确认消息,使得主库获知该从库已经完成对于待同步事务的数据同步,也就是该从库当前与主库内的数据一致。After determining each active group in the group to which the slave library belongs, for any transaction to be synchronized executed by the master library, the slave library in each active group will continuously request the master library for each transaction according to the progress of its own synchronization of transaction data. A binary log generated after a transaction to be synchronized is processed by the master library, so that each slave library executes the binary log to synchronize the data of the transaction to be synchronized. After a slave library completes the data synchronization operation of the transaction to be synchronized, the slave library will reply a synchronization confirmation message for the transaction to be synchronized to the master library, so that the master library knows that the slave library has completed the data synchronization of the transaction to be synchronized. , that is, the slave library is currently consistent with the data in the master library.
作为本申请中的一种可选实现方案,为了在保证事务处理高效性的前提下,尽可能实现数据同步在分组级别下的容灾,本申请会判断每一活跃组内是否存在至少一个从库已经完成对待同步事务的数据同步。具体的,由于从库在完成对待同步事务的数据同步操作后,会向主库回复一条对该待同步事务的同步确认消息。因此,通过判断主库是否接收到每一活跃组内至少一个从库对待同步事务的同步确认消息,来判断每一活跃组内是否存在至少一个从库完成对待同步事务的数据同步。As an optional implementation solution in the present application, in order to realize the disaster recovery of data synchronization at the group level as much as possible under the premise of ensuring the efficiency of transaction processing, the present application will determine whether there is at least one slave in each active group. The library has completed data synchronization for the transaction to be synchronized. Specifically, after the slave library completes the data synchronization operation of the transaction to be synchronized, it will reply to the master library a synchronization confirmation message for the transaction to be synchronized. Therefore, it is determined whether there is at least one slave library in each active group to complete the data synchronization of the to-be-synchronized transaction by judging whether the master library has received the synchronization confirmation message of at least one slave library in each active group.
此时,如果主库接收到每一活跃组内至少一个从库对待同步事务的同步确认消息,说明每一活跃组内存在至少一个从库已完成对待同步事务的数据同步,也就是每一活跃组内都会存在至少一个与主库数据实时一致的从库。因此,主库在接收到每一活跃组内至少一个从库对待同步事务的同步确认消息时,可以直接提交该待同步事务,从而尽可能的提高事务处理的高效性。而且,即使在主库故障时,每一活跃组内都会存在至少一个与主库数据实时一致的从库,那么可以直接将任一活跃组内与主库数据实时一致的从库切换为主库,保证主从库切换时的数据完整性,从而实现分组级别(机房级别)下的数据同步容灾。At this time, if the master library receives the synchronization confirmation message of at least one slave library in each active group for the transaction to be synchronized, it means that there is at least one slave library in each active group that has completed the data synchronization of the transaction to be synchronized, that is, each active group has completed the data synchronization of the transaction to be synchronized. There will be at least one slave database in the group that is consistent with the master database data in real time. Therefore, when the master library receives the synchronization confirmation message of the transaction to be synchronized from at least one slave library in each active group, it can directly submit the to-be-synchronized transaction, thereby improving the efficiency of transaction processing as much as possible. Moreover, even when the master database fails, there will be at least one slave database in each active group that is consistent with the data of the master database in real time, so the slave database in any active group that is consistent with the data of the master database in real time can be directly switched to the master database. , to ensure the data integrity when the master-slave database is switched, so as to realize the data synchronization disaster recovery at the group level (computer room level).
示例性的,本申请中在主库内设置一个确认接收(ack_receiver)线程,通过该ack_receiver线程来接收任一分组内各个从库在完成任一待同步事务的数据同步后,所回复的对于该待同步事务的同步确认消息,并执行主库是否接收到每一活跃组内至少一个从库对待同步事务的同步确认消息的判断逻辑。Exemplarily, in this application, an acknowledgement receiving (ack_receiver) thread is set in the main library, and the ack_receiver thread is used to receive, after each slave library in any group completes the data synchronization of any transaction to be synchronized, the reply for the The synchronization confirmation message of the transaction to be synchronized is executed, and the judgment logic of whether the master library has received the synchronization confirmation message of the transaction to be synchronized by at least one slave library in each active group is executed.
此外,考虑到在刚开始执行主从库间的数据同步时,并不确定各个分组对于事务的数据同步性能,因此会将每一分组均作为活跃组。然后,在后续的实际数据同步过程中,通过实时分析每一分组对于事务的数据同步性能,来将处于故障或阻塞状态的分组,从活跃组转换到阻塞组。In addition, considering that at the beginning of data synchronization between the master and slave databases, the data synchronization performance of each group for transactions is uncertain, so each group is used as an active group. Then, in the subsequent actual data synchronization process, by analyzing the data synchronization performance of each group for the transaction in real time, the group in the faulty or blocked state is converted from the active group to the blocked group.
因此,在实际的数据同步过程中,本申请还会实时判断每一活跃组对于事务的数据同步性能。也就是针对任一活跃组,如果在超出预设同步时长后主库仍未接收到该活跃组内任一从库对待同步事务的同步确认消息,则将该活跃组转换为阻塞组。主库在向任一活跃组内的各个从库发送待同步事务的二进制日志后,会判断该活跃组内各个从库对于待同步事务的数据同步时长。如果在该活跃组内每一从库对待同步事务的数据同步时长均超出预设同步时长后,主库仍未接收到该活跃组内任一从库对待同步事务的同步确认消息,说明该活跃组对于待同步事务的数据同步存在故障或阻塞,因此直接将该活跃组转换为阻塞组。示例性的,本申请可以直接将阻塞组解散,释放该阻塞组内的各个从库,以使该从库采用异步复制的方式对待同步事务进行数据同步,以便尽可能使该阻塞组内的各个从库恢复正常的数据同步性能。Therefore, in the actual data synchronization process, the present application also determines the data synchronization performance of each active group for transactions in real time. That is, for any active group, if the master library does not receive a synchronization confirmation message for a transaction to be synchronized from any slave library in the active group after the preset synchronization duration exceeds, the active group will be converted into a blocking group. After the master library sends the binary log of the transaction to be synchronized to each slave library in any active group, it will determine the data synchronization duration of each slave library in the active group for the transaction to be synchronized. If the data synchronization duration of each slave database in the active group exceeds the preset synchronization duration, the master database has not received the synchronization confirmation message for the transaction pending synchronization from any slave database in the active group, indicating that the active database is active. The group is faulty or blocked for the data synchronization of the transaction to be synchronized, so the active group is directly converted into a blocking group. Exemplarily, the present application can directly dissolve the blocking group and release each slave library in the blocking group, so that the slave library uses asynchronous Restore normal data synchronization performance from the repository.
进一步的,如果要将阻塞组重新恢复为活跃组,那么需要判断该阻塞组内各从库对于待同步事务的数据同步进度是否能够与各个活跃组内各从库对待同步事务的数据同步进度保持一致。因此,如果接收到任一从库的同步确认消息,且该从库所属分组为阻塞组,则按照该从库的同步确认消息,确定所述阻塞组的组同步点;在阻塞组的组同步点大于等于主库内各活跃组中的最小组同步点时,将阻塞组转换回活跃组。Further, if the blocking group is to be restored to the active group, it is necessary to determine whether the data synchronization progress of each slave library in the blocking group for the transaction to be synchronized can be maintained with the data synchronization progress of each slave library in each active group. Consistent. Therefore, if a synchronization confirmation message of any slave library is received, and the group to which the slave library belongs is a blocking group, the group synchronization point of the blocking group is determined according to the synchronization confirmation message of the slave library; the group synchronization point of the blocking group is determined. When the point is greater than or equal to the minimum group synchronization point in each active group in the main library, the blocking group is converted back to the active group.
此时,通过分析每一从库对于待同步事务的数据同步进度,可以为每一从库设定一个同步点,该同步点用于表示每一从库内当前需要执行数据同步的待同步事务在日志文件中的日志偏移位置,例如每一从库内的同步点可以为file_name+file_pos。而且,本申请中各个待同步事务的二进制日志会在日志文件中按照事务同步顺序而依次排列。At this time, by analyzing the data synchronization progress of each slave library for the transaction to be synchronized, a synchronization point can be set for each slave library, and the synchronization point is used to indicate the to-be-synchronized transaction that currently needs to perform data synchronization in each slave library The log offset position in the log file, for example, the synchronization point in each slave library can be file_name+file_pos. Moreover, the binary logs of each transaction to be synchronized in the present application will be sequentially arranged in the log file according to the transaction synchronization sequence.
因此,主库在接收到任一从库对于待同步事务的同步确认消息,首先判断该从库属于活跃组还是阻塞组。如果该从库所属分组为活跃组,那么直接判断主库是否接收到每一活跃组内至少一个从库对待同步事务的同步确认消息即可。然而,如果该从库所属分组为阻塞组,那么需要分析该阻塞组内各个从库已向主库回复的最近一条同步确认消息。然后,按照该阻塞组内各个从库已向主库回复的最近一条同步确认消息,确定该阻塞组内各个从库的同步点,也就是该从库对待同步事务当前的数据同步进度。进而,从该阻塞组内各个从库的同步点中,可以筛选出最大的同步点,也就是数据同步进度最快的从库同步点,作为该阻塞组的组同步点。Therefore, when the master library receives a synchronization confirmation message for a transaction to be synchronized from any slave library, it first determines whether the slave library belongs to the active group or the blocking group. If the group to which the slave library belongs is an active group, it is sufficient to directly determine whether the master library has received a synchronization confirmation message for a transaction to be synchronized by at least one slave library in each active group. However, if the group to which the slave library belongs is a blocking group, it is necessary to analyze the latest synchronization confirmation message that each slave library in the blocking group has replied to the master library. Then, according to the latest synchronization confirmation message that each slave library in the blocking group has replied to the master library, the synchronization point of each slave library in the blocking group is determined, that is, the current data synchronization progress of the transaction to be synchronized by the slave library. Further, from the synchronization points of each slave library in the blocking group, the largest synchronization point, that is, the slave library synchronization point with the fastest data synchronization progress, can be selected as the group synchronization point of the blocking group.
同时,按照上述组同步点的相同确定方式,可以通过分析每一活跃组内各个从库的同步点,确定出每一活跃组的组同步点。然后,考虑到主库内各个活跃组的组同步点能够表示各个活跃组对于待同步事务的数据同步进度,因此,通过对阻塞组的组同步点和主库内各活跃组中的最小组同步点进行比对,即可判断该阻塞组对于待同步事务的数据同步进度是否与各个活跃组内对待同步事务的数据同步进度保持一致。如果该阻塞组的组同步点大于等于主库内各活跃组中的最小组同步点,说明该阻塞组的数据同步进度已经能够与各个活跃组的数据同步进度保持一致,因此将该阻塞组转换回活跃组。此时,如果该阻塞组已经解散,那么重新创建该分组,并将其配置为活跃组。然而,如果该阻塞组的组同步点小于主库内各活跃组中的最小组同步点,说明该阻塞组的数据同步进度还未追赶上各个活跃组的数据同步进度,因此继续保持该阻塞组的状态。Meanwhile, according to the same way of determining the group synchronization point, the group synchronization point of each active group can be determined by analyzing the synchronization points of each slave library in each active group. Then, considering that the group synchronization point of each active group in the main library can represent the data synchronization progress of each active group for the transaction to be synchronized, therefore, by synchronizing the group synchronization point of the blocking group with the smallest group in each active group in the main library By comparing the points, it can be determined whether the data synchronization progress of the blocking group for the transaction to be synchronized is consistent with the data synchronization progress of the transaction to be synchronized in each active group. If the group synchronization point of the blocking group is greater than or equal to the minimum group synchronization point in each active group in the main database, it means that the data synchronization progress of the blocking group has been consistent with the data synchronization progress of each active group, so the blocking group is converted back to the active group. At this point, if the blocking group has been disbanded, the group is recreated and configured as an active group. However, if the group synchronization point of the blocking group is smaller than the minimum group synchronization point among the active groups in the main database, it means that the data synchronization progress of the blocking group has not caught up with the data synchronization progress of each active group, so continue to maintain the blocking group status.
本申请实施例提供的技术方案,为主库内已注册的各个从库设置分组,并从各个分组中确定出活跃组,然后在主库接收到每一活跃组内至少一个从库对待同步事务的同步确认消息时,来执行待同步事务的提交操作,从而利用每一活跃组内的至少一个从库实现待同步事务的数据同步,无需在每一从库内完成待同步事务的数据同步,保证数据同步的事务处理性能。而且,每一活跃组内均有至少一个从库完成待同步事务的数据同步,使得在主库所在的整个活跃组故障时,仍能够利用其他活跃组内完成数据同步的从库实现主从库切换,从而提高数据同步的容灾范围。The technical solution provided by the embodiment of the present application is to set up groups for each registered slave library in the master library, and determine an active group from each group, and then receive at least one slave library in each active group in the master library to be synchronized transactions. When the synchronization confirmation message is sent, the commit operation of the transaction to be synchronized is performed, so that at least one slave library in each active group is used to realize the data synchronization of the transaction to be synchronized, and there is no need to complete the data synchronization of the transaction to be synchronized in each slave library. Guaranteed transaction processing performance for data synchronization. Moreover, there is at least one slave library in each active group to complete the data synchronization of the transaction to be synchronized, so that when the entire active group where the master library is located fails, the master-slave library can still be realized by using the slave libraries in other active groups that complete data synchronization switch, thereby improving the disaster recovery range of data synchronization.
作为本申请中的一种可选实现方案,为了在保证事务处理性能的前提下,提高数据同步时的容灾范围,本申请对于判断主库是否接收到每一活跃组内至少一个从库对待同步事务的同步确认消息的具体过程进行详细的解释说明。As an optional implementation solution in this application, in order to improve the disaster tolerance range during data synchronization on the premise of ensuring transaction processing performance, this application determines whether the master database has received at least one slave database in each active group. The specific process of the synchronization confirmation message of the synchronization transaction is explained in detail.
图2为本申请实施例示出的另一种数据同步的方法的流程图。参照图2,该方法具体可以包括如下步骤:FIG. 2 is a flowchart of another data synchronization method according to an embodiment of the present application. 2, the method may specifically include the following steps:
S210,确定主库内已注册的各从库所属分组中的活跃组。S210: Determine the active group in the group to which each slave library registered in the master library belongs.
S220,在接收到任一从库对待同步事务的同步请求时,向该从库发送待同步事务的同步日志。S220, when receiving a synchronization request for a transaction to be synchronized from any slave library, send a synchronization log of the transaction to be synchronized to the slave library.
在主库执行完任一待同步事务后,会在日志文件内按需生成该待同步事务的二进制日志。此时,在主从库间的数据同步过程中,考虑到各个从库对于待同步事务的数据同步性能不同,如果由主库主动向各个从库发送各个待同步事务的二进制日志,那么可能会存在从库由于同步性能较慢而积压大量待同步事务的二进制日志的问题,进而可能导致从库对于待同步事务的数据同步出现失误而失败。因此,为了保证各个从库对于待同步事务的数据同步的有序性和准确性,本申请会由各个从库按照自身对于待同步事务的数据同步进度,来不断向主库发送对于每一待同步事务的同步请求。After the main library executes any transaction to be synchronized, a binary log of the transaction to be synchronized will be generated in the log file as needed. At this time, in the process of data synchronization between the master and slave libraries, considering that the data synchronization performance of each slave library for the transaction to be synchronized is different, if the master library actively sends the binary log of each transaction to be synchronized to each slave library, it may There is a problem that the slave library accumulates a large number of binary logs of transactions to be synchronized due to the slow synchronization performance, which may cause errors in the data synchronization of the transactions to be synchronized by the slave library and fail. Therefore, in order to ensure the orderliness and accuracy of the data synchronization of each slave library for the transaction to be synchronized, in this application, each slave library will continuously send the data synchronization progress of the transaction to be synchronized to the master library. A sync request for a sync transaction.
进而,在主库每次接收到任一从库对待同步事务的同步请求时,可以通过解析该同步请求内携带的事务标识。然后,获取该事务标识指定的待同步事务在主库内生成的二进制日志,作为本申请中该待同步事务的同步日志。进而,将该待同步事务的同步日志发送给该从库,以便该从库将该同步日志写入到从库内的中继日志(Relay Log)中,从而完成对该待同步事务的数据同步操作。Furthermore, each time the master library receives a synchronization request for a transaction to be synchronized from any slave library, the transaction identifier carried in the synchronization request can be parsed. Then, the binary log generated in the main database of the transaction to be synchronized specified by the transaction identifier is obtained as the synchronization log of the transaction to be synchronized in the present application. Further, the synchronization log of the transaction to be synchronized is sent to the slave library, so that the slave library writes the synchronization log into the relay log (Relay Log) in the slave library, thereby completing the data synchronization of the transaction to be synchronized operate.
此时,为了确保主库向各个从库发送同步日志的准确性,本申请会在主库内分别为每一从库配置一个转存(dump)线程。在主库接收到任一从库对待同步事务的同步请求时,会采用该从库对应的dump线程向该从库发送待同步事务的同步日志。At this time, in order to ensure the accuracy of the synchronization log sent by the master library to each slave library, the present application will configure a dump thread for each slave library in the master library. When the master library receives a synchronization request for a transaction to be synchronized from any slave library, it will use the dump thread corresponding to the slave library to send the synchronization log of the transaction to be synchronized to the slave library.
应当理解的是,为了使主库获知每一活跃组内各个从库对于待同步事务的数据同步进度,本申请中的从库在每次完成对某一待同步事务的数据同步操作后,会向主库回复一条对于该待同步事务的同步确认消息。进而,主库通过接收每一活跃组内各个从库对待同步事务的同步确认消息,来判断每一活跃组内各从库对于待同步事务的整体同步进度。It should be understood that, in order for the master library to know the data synchronization progress of each slave library in each active group for the transaction to be synchronized, the slave library in this application will perform the data synchronization operation for a transaction to be synchronized each time. Reply to the main library with a synchronization confirmation message for the transaction to be synchronized. Furthermore, the master library judges the overall synchronization progress of each slave library in each active group with respect to the transaction to be synchronized by receiving the synchronization confirmation message of each slave library in each active group.
作为本申请中的一种可选实现方案,由于本申请主要通过判断每一活跃组内是否存在至少一个从库完成对待同步事务的数据同步,来执行待同步事务的提交操作。也就是本申请主要关注每一活跃组内首个向主库回复待同步事务的同步确认消息的从库即可,而无需关注其他从库是否向主库回复待同步事务的同步确认消息。因此,本申请在向任一从库发送待同步事务的同步日志时,首先会判断该从库所属分组的组同步点,以确定该从库所属分组的最快同步进度。而且,分析该从库本次需要同步的待同步事务所处的同步位置标识,以确定该从库本次的数据同步进度。As an optional implementation solution in the present application, the present application mainly performs the commit operation of the to-be-synchronized transaction by judging whether there is at least one slave database in each active group to complete the data synchronization of the to-be-synchronized transaction. That is, the application mainly focuses on the first slave database in each active group that replies the synchronization confirmation message of the transaction to be synchronized to the master database, and does not need to pay attention to whether other slave databases reply the synchronization confirmation message of the transaction to be synchronized to the master database. Therefore, when sending the synchronization log of the transaction to be synchronized to any slave library, the present application will first determine the group synchronization point of the group to which the slave library belongs, so as to determine the fastest synchronization progress of the group to which the slave library belongs. Moreover, the synchronization position identifier of the transaction to be synchronized that needs to be synchronized this time by the slave library is analyzed to determine the current data synchronization progress of the slave library.
然后,通过比对该从库所属分组的组同步点和该从库本次同步的待同步事务的同步位置标识,来判断该从库所属分组对待同步事务的最快同步进度和该从库对待同步事务的本次数据同步进度之间的差异。Then, by comparing the group synchronization point of the group to which the slave library belongs and the synchronization position identifier of the transaction to be synchronized this time in the slave library to determine the fastest synchronization progress of the transaction to be synchronized by the group to which the slave library belongs and the transaction to be synchronized by the slave library. The difference between the current data synchronization progress of the synchronization transaction.
此时,该从库所属分组的组同步点和该从库本次同步的待同步事务的同步位置标识的比对结果存在如下三种情况:At this time, the comparison results of the group synchronization point of the group to which the slave library belongs and the synchronization position identifier of the transaction to be synchronized this time by the slave library exist in the following three situations:
情况一:如果该从库所属分组的组同步点为空,说明该从库所属分组内的各个从库都还未向主库回复过任一待同步事务的同步确认消息,使得主库需要关注该分组内每一从库的数据同步情况,以便后续准确确定该分组的组同步点。因此,主库在向该从库发送待同步事务的同步日志时,不会对该同步日志作任何额外配置,使得该从库在完成对该待同步事务的数据同步操作后,正常向主库回复一条对应的同步确认消息,以便主库根据该同步确认消息判断该从库所属分组的组同步点。Situation 1: If the group synchronization point of the group to which the slave library belongs is empty, it means that each slave library in the group to which the slave library belongs has not replied to the master library any synchronization confirmation messages for transactions to be synchronized, so that the master library needs to pay attention to The data synchronization status of each slave library in the group is used to accurately determine the group synchronization point of the group subsequently. Therefore, when the master library sends the synchronization log of the transaction to be synchronized to the slave library, it will not make any additional configuration on the synchronization log, so that the slave library will normally send the synchronization log to the master library after completing the data synchronization operation of the transaction to be synchronized. Reply with a corresponding synchronization confirmation message, so that the master library can determine the group synchronization point of the group to which the slave library belongs according to the synchronization confirmation message.
情况二:如果待同步事务的同步位置标识大于该从库所属分组的组同步点,说明该从库在完成对待同步事务的数据同步操作后的数据同步进度会大于该从库所属分组当前的最快同步进度。也就是,在该从库在完成对待同步事务的数据同步操作后,该从库所属分组的最快同步进度也需要对应更新。因此,主库在向该从库发送待同步事务的同步日志时,也不会对该同步日志作任何额外配置,使得该从库在完成对该待同步事务的数据同步操作后,能够正常向主库回复一条对应的同步确认消息。然后,主库根据该从库回复的这条同步确认消息,对应更新该从库所属分组的组同步点,从而确保该从库所属分组的最快同步进度的实时更新。Case 2: If the synchronization location identifier of the transaction to be synchronized is greater than the group synchronization point of the group to which the slave library belongs, it means that the data synchronization progress of the slave library after completing the data synchronization operation of the transaction to be synchronized will be greater than the current maximum value of the group to which the slave library belongs. Fast synchronization progress. That is, after the slave library completes the data synchronization operation of the transaction to be synchronized, the fastest synchronization progress of the group to which the slave library belongs also needs to be updated accordingly. Therefore, when the master library sends the synchronization log of the transaction to be synchronized to the slave library, it will not perform any additional configuration on the synchronization log, so that the slave library can normally send the synchronization log to the slave library after completing the data synchronization operation for the transaction to be synchronized. The main library replies with a corresponding synchronization confirmation message. Then, the master library updates the group synchronization point of the group to which the slave library belongs according to the synchronization confirmation message replied by the slave library, thereby ensuring real-time update of the fastest synchronization progress of the group to which the slave library belongs.
情况三:如果待同步事务的同步位置标识小于等于该从库所属分组的组同步点,说明该从库在完成对待同步事务的数据同步操作后的数据同步进度会仍然无法影响到该从库所属分组当前的最快同步进度。因此,本申请会在待同步事务的同步日志内额外配置对应的同步确认取消信息,该同步确认取消信息指示该从库在完成对待同步事务的数据同步操作后,无需向主库回复本次数据同步的同步确认消息。然后,将该待同步事务额外配置好的同步日志发送给该从库。Scenario 3: If the synchronization location identifier of the transaction to be synchronized is less than or equal to the group synchronization point of the group to which the slave library belongs, it means that the data synchronization progress of the slave library after completing the data synchronization operation of the transaction to be synchronized will still not affect the slave library to which it belongs. The current fastest synchronization progress of the group. Therefore, this application will additionally configure the corresponding synchronization confirmation cancellation information in the synchronization log of the transaction to be synchronized, and the synchronization confirmation cancellation information indicates that the slave database does not need to reply the data to the master database after completing the data synchronization operation of the transaction to be synchronized. Synchronization confirmation message for synchronization. Then, the additionally configured synchronization log of the transaction to be synchronized is sent to the slave library.
S230,根据每一活跃组内各从库回复的同步确认消息,确定每一活跃组的组同步点。S230: Determine the group synchronization point of each active group according to the synchronization confirmation message replied by each slave library in each active group.
主库在基于任一从库对待同步事务的同步请求,向各个从库发送待同步事务的同步日志后,会不断接收到各个从库完成对待同步事务的数据同步操作后所回复的同步确认消息。此时,针对每一活跃组,本申请会获取到该活跃组内当前已接收到的各个从库所回复的同步确认消息。然后,通过判断该活跃组内各个从库最近一次回复的同步确认消息所表示的待同步事务的同步位置标识,来确定该活跃组内每一从库的同步点。最后,从该活跃组内每一从库的同步点中,可以筛选出表示同步进度最快的同步点,作为该活跃组的组同步点。After the master library sends the synchronization log of the transaction to be synchronized to each slave library based on the synchronization request of any slave library to be synchronized, it will continue to receive synchronization confirmation messages replied by each slave library after completing the data synchronization operation of the transaction to be synchronized. . At this time, for each active group, the application will obtain the synchronization confirmation messages that have been currently received by each slave library in the active group. Then, the synchronization point of each slave library in the active group is determined by judging the synchronization position identifier of the transaction to be synchronized indicated by the synchronization confirmation message recently replied by each slave library in the active group. Finally, from the synchronization points of each slave library in the active group, the synchronization point indicating the fastest synchronization progress can be selected as the group synchronization point of the active group.
作为本申请中的一种示例性方案,为了准确记录各个活跃组对于待同步事务的同步情况,本申请会在主库中引入活跃组(activegroup)类,并在该activegroup类中构造一个GroupNode链表(数组)结构。进而,在主库中可以通过该GroupNode链表来记录每个活跃组的各类信息。例如每一活跃组的GroupNode链表中可以包含分组名、组同步点、分组中包含的各个从库等。其中,本申请中每个分组内最多可以包括但不限定256个从库。As an exemplary solution in this application, in order to accurately record the synchronization of each active group for transactions to be synchronized, this application will introduce an active group (activegroup) class into the main library, and construct a GroupNode linked list in the activegroup class (array) structure. Furthermore, in the main library, various types of information of each active group can be recorded through the GroupNode linked list. For example, the GroupNode linked list of each active group may include the group name, the group synchronization point, each slave library included in the group, and the like. Wherein, each group in this application may include, but is not limited to, 256 slave libraries at most.
S240,基于每一活跃组的组同步点,从各活跃组中选出同步最慢组。S240, based on the group synchronization point of each active group, select the slowest synchronization group from each active group.
考虑到主库会在每一活跃组内存在至少一个从库已经完成对待同步事务的数据同步,也就是每一活跃组内都会存在至少一个与主库数据实时一致的从库时,才会提交该待同步事务。因此,本申请通过分析每一活跃组的组同步点,来判断该活跃组对于待同步事务的最快同步进度。然后,根据每一活跃组对于待同步事务的最快同步进度,可以从各个活跃组中选出同步进度最慢的活跃组,作为本申请中的同步最慢组,以便后续按照同步最慢组的组同步点更新情况,分析各个活跃组对于待同步事务的整体同步进度。Considering that the master library will have at least one slave library in each active group that has completed the data synchronization of the transaction to be synchronized, that is, there will be at least one slave library in each active group that is consistent with the master library data in real time. The transaction to be synchronized. Therefore, the present application determines the fastest synchronization progress of the active group for the transaction to be synchronized by analyzing the group synchronization point of each active group. Then, according to the fastest synchronization progress of each active group for the transaction to be synchronized, the active group with the slowest synchronization progress can be selected from each active group as the slowest synchronization group in this application, so that the slowest synchronization group can be used in the subsequent synchronization according to the slowest synchronization group. The update status of the group synchronization point is analyzed, and the overall synchronization progress of each active group for the transaction to be synchronized is analyzed.
作为本申请中的一种示例性方案,在主库中通过GroupNode链表来记录每个活跃组的各类信息时,本申请还可以针对GroupNode链表专门构造一个特定指针(*slowest_group),该指针指向GroupNode链表中的同步最慢组。As an exemplary solution in the present application, when various types of information of each active group are recorded in the main library through the GroupNode linked list, the present application can also construct a specific pointer (*slowest_group) for the GroupNode linked list, which points to The slowest synchronized group in the GroupNode linked list.
S250,在检测到同步最慢组的组同步点完成一次更新时,确定同步最慢组更新前的组同步点对应的待同步事务,并提交待同步事务。S250, when it is detected that the group synchronization point of the slowest group has completed an update, determine the transaction to be synchronized corresponding to the group synchronization point before the synchronization of the slowest group is updated, and submit the transaction to be synchronized.
由于同步最慢组属于各个活跃组内对于待同步事务的数据同步进度最慢的活跃组,说明其他活跃组内至少一个从库已经完成对处于同步最慢组的组同步点之前的各个待同步事务的数据同步。所以可以认为同步最慢组的组同步点表示各个活跃组对于待同步事务的整体同步进度,同步最慢组的组同步点之前的各个待同步事务已经完成提交。Since the slowest synchronization group belongs to the active group with the slowest data synchronization progress for the transactions to be synchronized in each active group, it means that at least one slave library in other active groups has completed the synchronization of each to-be-synchronized group before the synchronization point of the group in the slowest synchronization group. Transactional data synchronization. Therefore, it can be considered that the group synchronization point of the slowest synchronization group represents the overall synchronization progress of each active group for the transactions to be synchronized, and each transaction to be synchronized before the group synchronization point of the slowest synchronization group has been submitted.
因此,通过判断同步最慢组的组同步点是否更新,即可确定每一活跃组是否都存在至少一个从库完成对待同步事务的数据同步。此时,主库在检测到同步最慢组的组同步点完成一次更新时,说明同步最慢组内也存在一个从库已经完成对于更新前的组同步点所表示的待同步事务的数据同步操作,使得每一活跃组都会存在至少一个从库完成对同步最慢组更新前的组同步点所表示的待同步事务的数据同步。进而,主库可以直接提交该同步最慢组更新前的组同步点对应的待同步事务。Therefore, by judging whether the group synchronization point of the slowest synchronization group is updated, it can be determined whether there is at least one slave database in each active group to complete the data synchronization of the transaction to be synchronized. At this time, when the master library detects that the group synchronization point of the slowest synchronization group has completed an update, it means that there is also a slave library in the slowest synchronization group that has completed the data synchronization of the transaction to be synchronized indicated by the group synchronization point before the update. operation, so that there is at least one slave library in each active group to complete the data synchronization of the transaction to be synchronized represented by the group synchronization point before the synchronization of the slowest group update. Furthermore, the main database can directly submit the to-be-synchronized transaction corresponding to the group synchronization point before the slowest synchronization group is updated.
需要说明的是,为了确包数据同步过程中同步最慢组的准确性,本申请在每检测到同步最慢组的组同步点完成一次更新时,还会再次分析每一活跃组更新后的组同步点,然后重新选出当前的同步最慢组。It should be noted that, in order to ensure the accuracy of the slowest group synchronization in the process of packet data synchronization, the present application will re-analyze the updated data of each active group when the group synchronization point of the slowest group is detected to complete an update. group synchronization point, and then re-elect the current slowest synchronization group.
示例性的,如果*slowest_group指针指向的分组的组同步点没有更新,那么本申请中的同步最慢组无变更。然而,如果*slowest_group指针指向的分组的组同步点有更新,那么需要遍历GroupNode链表。然后,根据该GroupNode链表内当前记录的每一活跃组的组同步点,重新选举一个同步最慢组,从而保证*slowest_group指针能够一直指向GroupNode链表内的同步最慢组。Exemplarily, if the group synchronization point of the group pointed to by the *slowest_group pointer is not updated, the slowest synchronization group in this application is not changed. However, if the group synchronization point of the group pointed to by the *slowest_group pointer is updated, it is necessary to traverse the GroupNode linked list. Then, according to the group synchronization point of each active group currently recorded in the GroupNode linked list, a group with the slowest synchronization is re-elected, so as to ensure that the *slowest_group pointer can always point to the slowest synchronization group in the GroupNode linked list.
本申请实施例提供的技术方案,为主库内已注册的各个从库设置分组,并从各个分组中确定出活跃组,然后在主库接收到每一活跃组内至少一个从库对待同步事务的同步确认消息时,来执行待同步事务的提交操作,从而利用每一活跃组内的至少一个从库实现待同步事务的数据同步,无需在每一从库内完成待同步事务的数据同步,保证数据同步的事务处理性能。而且,每一活跃组内均有至少一个从库完成待同步事务的数据同步,使得在主库所在的整个活跃组故障时,仍能够利用其他活跃组内完成数据同步的从库实现主从库切换,从而提高数据同步的容灾范围。The technical solution provided by the embodiment of the present application is to set up groups for each registered slave library in the master library, and determine an active group from each group, and then receive at least one slave library in each active group in the master library to be synchronized transactions. When the synchronization confirmation message is sent, the commit operation of the transaction to be synchronized is performed, so that at least one slave library in each active group is used to realize the data synchronization of the transaction to be synchronized, and there is no need to complete the data synchronization of the transaction to be synchronized in each slave library. Guaranteed transaction processing performance for data synchronization. Moreover, there is at least one slave library in each active group to complete the data synchronization of the transaction to be synchronized, so that when the entire active group where the master library is located fails, the master-slave library can still be realized by using the slave libraries in other active groups that complete data synchronization switch, thereby improving the disaster recovery range of data synchronization.
图3为本申请实施例示出的一种数据同步的装置的原理框图。如图3所示,该装置300可以包括:FIG. 3 is a schematic block diagram of a data synchronization apparatus according to an embodiment of the present application. As shown in FIG. 3, the
分组确定模块310,用于确定主库内已注册的各从库所属分组中的活跃组;a
数据同步模块320,用于判断是否接收到每一所述活跃组内至少一个从库对待同步事务的同步确认消息,若是则提交所述待同步事务。The
进一步的,所述数据同步模块320,可以具体用于:Further, the
根据每一活跃组内各从库回复的同步确认消息,确定每一活跃组的组同步点;Determine the group synchronization point of each active group according to the synchronization confirmation message replied by each slave library in each active group;
基于每一活跃组的组同步点,从各所述活跃组中选出同步最慢组;Based on the group synchronization point of each active group, the slowest synchronization group is selected from each of the active groups;
在检测到所述同步最慢组的组同步点完成一次更新时,确定所述同步最慢组更新前的组同步点对应的待同步事务,并提交所述待同步事务。When it is detected that the group synchronization point of the slowest synchronization group has completed an update, the transaction to be synchronized corresponding to the group synchronization point before the update of the slowest synchronization group is determined, and the transaction to be synchronized is submitted.
进一步的,所述数据同步的装置300,还可以包括:Further, the
最慢组更新模块,用于基于每一活跃组更新后的组同步点,重新选出所述同步最慢组。The slowest group update module is configured to reselect the slowest synchronization group based on the updated group synchronization point of each active group.
进一步的,所述数据同步的装置300,还可以包括:Further, the
同步日志发送模块,用于在接收到任一从库对所述待同步事务的同步请求时,向该从库发送所述待同步事务的同步日志。The synchronization log sending module is configured to send the synchronization log of the transaction to be synchronized to the slave library when receiving a synchronization request for the transaction to be synchronized from any slave library.
进一步的,所述同步日志发送模块,可以具体用于:Further, the synchronization log sending module can be specifically used for:
如果该从库所属分组的组同步点为空,或者所述待同步事务的同步位置标识大于该从库所属分组的组同步点,则向该从库发送所述待同步事务的同步日志;If the group synchronization point of the group to which the slave library belongs is empty, or the synchronization position identifier of the transaction to be synchronized is greater than the group synchronization point of the group to which the slave library belongs, sending the synchronization log of the transaction to be synchronized to the slave library;
如果所述待同步事务的同步位置标识小于等于该从库所属分组的组同步点,则在所述待同步事务的同步日志内配置对应的同步确认取消信息,并向该从库发送所述待同步事务的同步日志。If the synchronization location identifier of the transaction to be synchronized is less than or equal to the group synchronization point of the group to which the slave library belongs, configure the corresponding synchronization confirmation cancellation information in the synchronization log of the transaction to be synchronized, and send the to-be-synchronized transaction to the slave library. Synchronization log for synchronization transactions.
进一步的,所述数据同步的装置300,还可以包括:Further, the
第一组转换模块,用于针对任一活跃组,如果在超出预设同步时长后所述主库仍未接收到该活跃组内任一从库对所述待同步事务的同步确认消息,则将该活跃组转换为阻塞组。The first group of conversion modules is used for any active group, if the master library has not received the synchronization confirmation message for the transaction to be synchronized from any slave library in the active group after exceeding the preset synchronization duration, then Convert the active group to a blocking group.
进一步的,所述数据同步的装置300,还可以包括:Further, the
组同步点确定模块,用于如果接收到任一从库的同步确认消息,且该从库所属分组为阻塞组,则按照该从库的同步确认消息,确定所述阻塞组的组同步点;A group synchronization point determination module is used to determine the group synchronization point of the blocked group according to the synchronization confirmation message of the slave library if the synchronization confirmation message of any slave library is received, and the slave library belongs to a blocking group;
第二组转换模块,用于在所述阻塞组的组同步点大于等于所述主库内各活跃组中的最小组同步点时,将所述阻塞组转换回活跃组。The second group conversion module is configured to convert the blocked group back to an active group when the group synchronization point of the blocked group is greater than or equal to the smallest group synchronization point in each active group in the main library.
本申请实施例中,为主库内已注册的各个从库设置分组,并从各个分组中确定出活跃组,然后在主库接收到每一活跃组内至少一个从库对待同步事务的同步确认消息时,来执行待同步事务的提交操作,从而利用每一活跃组内的至少一个从库实现待同步事务的数据同步,无需在每一从库内完成待同步事务的数据同步,保证数据同步的事务处理性能。而且,每一活跃组内均有至少一个从库完成待同步事务的数据同步,使得在主库所在的整个活跃组故障时,仍能够利用其他活跃组内完成数据同步的从库实现主从库切换,从而提高数据同步的容灾范围。In the embodiment of the present application, a group is set for each slave library registered in the master library, and an active group is determined from each group, and then the master library receives a synchronization confirmation of the transaction to be synchronized from at least one slave library in each active group message, to perform the commit operation of the transaction to be synchronized, so as to use at least one slave database in each active group to realize the data synchronization of the transaction to be synchronized, without the need to complete the data synchronization of the transaction to be synchronized in each slave database, to ensure data synchronization transaction processing performance. Moreover, there is at least one slave library in each active group to complete the data synchronization of the transaction to be synchronized, so that when the entire active group where the master library is located fails, the master-slave library can still be realized by using the slave libraries in other active groups that complete data synchronization switch, thereby improving the disaster recovery range of data synchronization.
应理解的是,装置实施例与方法实施例可以相互对应,类似的描述可以参照方法实施例。为避免重复,此处不再赘述。具体地,图3所示的装置300可以执行本申请提供的方法实施例,并且装置300中的各个模块的前述和其它操作和/或功能分别为了实现本申请实施例的各个方法中的相应流程,为了简洁,在此不再赘述。It should be understood that the apparatus embodiments and the method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, details are not repeated here. Specifically, the
上文中结合附图从功能模块的角度描述了本申请实施例的装置300。应理解,该功能模块可以通过硬件形式实现,也可以通过软件形式的指令实现,还可以通过硬件和软件模块组合实现。具体地,本申请实施例中的方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路和/或软件形式的指令完成,结合本申请实施例公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。可选地,软件模块可以位于随机存储器,闪存、只读存储器、可编程只读存储器、电可擦写可编程存储器、寄存器等本领域的成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法实施例中的步骤。The
图4是本申请实施例提供的电子设备400的示意性框图。FIG. 4 is a schematic block diagram of an
如图4所示,该电子设备400可包括:As shown in FIG. 4, the
存储器410和处理器420,该存储器410用于存储计算机程序,并将该程序代码传输给该处理器420。换言之,该处理器420可以从存储器410中调用并运行计算机程序,以实现本申请实施例中的方法。A
例如,该处理器420可用于根据该计算机程序中的指令执行上述方法实施例。For example, the
在本申请的一些实施例中,该处理器420可以包括但不限于:In some embodiments of the present application, the
通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(FieldProgrammable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等等。General-purpose processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or Transistor logic devices, discrete hardware components, and more.
在本申请的一些实施例中,该存储器410包括但不限于:In some embodiments of the present application, the
易失性存储器和/或非易失性存储器。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double DataRate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。Volatile memory and/or non-volatile memory. Wherein, the non-volatile memory may be Read-Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (Erasable PROM, EPROM), Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double DataRate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) ) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
在本申请的一些实施例中,该计算机程序可以被分割成一个或多个模块,该一个或者多个模块被存储在该存储器410中,并由该处理器420执行,以完成本申请提供的方法。该一个或多个模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述该计算机程序在该电子设备中的执行过程。In some embodiments of the present application, the computer program may be divided into one or more modules, and the one or more modules are stored in the
如图4所示,该电子设备还可包括:As shown in Figure 4, the electronic device may further include:
收发器430,该收发器430可连接至该处理器420或存储器410。A
其中,处理器420可以控制该收发器430与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。收发器430可以包括发射机和接收机。收发器430还可以进一步包括天线,天线的数量可以为一个或多个。The
应当理解,该电子设备中的各个组件通过总线系统相连,其中,总线系统除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。It should be understood that various components in the electronic device are connected through a bus system, wherein the bus system includes a power bus, a control bus and a status signal bus in addition to a data bus.
本申请实施例还提供了一种计算机存储介质,其上存储有计算机程序,该计算机程序被计算机执行时使得该计算机能够执行上述方法实施例的方法。或者说,本申请实施例还提供一种包含指令的计算机程序产品,该指令被计算机执行时使得计算机执行上述方法实施例的方法。The embodiments of the present application further provide a computer storage medium, on which a computer program is stored, and when the computer program is executed by a computer, the computer can execute the method of the above method embodiments. In other words, the embodiments of the present application further provide a computer program product including instructions, when the instructions are executed by a computer, the instructions cause the computer to execute the methods of the above method embodiments.
当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions may be stored on or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer, server or data center (eg coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) means to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media. The available media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital video disc (DVD)), or semiconductor media (eg, solid state disk (SSD)), and the like.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的模块及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or modules, and may be in electrical, mechanical or other forms.
作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。例如,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。Modules described as separate components may or may not be physically separated, and components shown as modules may or may not be physical modules, that is, may be located in one place, or may be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. For example, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module.
以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, and should cover within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210540734.3A CN115048453B (en) | 2022-05-17 | 2022-05-17 | A method, device, equipment and storage medium for data synchronization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210540734.3A CN115048453B (en) | 2022-05-17 | 2022-05-17 | A method, device, equipment and storage medium for data synchronization |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115048453A true CN115048453A (en) | 2022-09-13 |
CN115048453B CN115048453B (en) | 2025-05-02 |
Family
ID=83159529
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210540734.3A Active CN115048453B (en) | 2022-05-17 | 2022-05-17 | A method, device, equipment and storage medium for data synchronization |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115048453B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001147849A (en) * | 1999-11-19 | 2001-05-29 | Toshiba Corp | Communication method and electronic device for data synchronization processing |
US20130159249A1 (en) * | 2011-12-15 | 2013-06-20 | Sybase, Inc. | Hybrid data replication |
CN107295080A (en) * | 2017-06-19 | 2017-10-24 | 北京百度网讯科技有限公司 | Date storage method and server applied to distributed server cluster |
CN107404540A (en) * | 2017-09-01 | 2017-11-28 | 北京奇虎科技有限公司 | The synchronous method and device of data |
US20190155705A1 (en) * | 2017-11-20 | 2019-05-23 | Sap Se | Coordinated Replication of Heterogeneous Database Stores |
US20200065297A1 (en) * | 2018-08-24 | 2020-02-27 | Oracle International Corporation | Providing consistent database recovery after database failure for distributed databases with non-durable storage leveraging background synchronization point |
CN110955382A (en) * | 2018-09-26 | 2020-04-03 | 华为技术有限公司 | Method and device for writing data in distributed system |
CN111273859A (en) * | 2020-01-14 | 2020-06-12 | 北京百度网讯科技有限公司 | Method, device, equipment and medium for changing replication group members in distribution mode |
-
2022
- 2022-05-17 CN CN202210540734.3A patent/CN115048453B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001147849A (en) * | 1999-11-19 | 2001-05-29 | Toshiba Corp | Communication method and electronic device for data synchronization processing |
US20130159249A1 (en) * | 2011-12-15 | 2013-06-20 | Sybase, Inc. | Hybrid data replication |
CN107295080A (en) * | 2017-06-19 | 2017-10-24 | 北京百度网讯科技有限公司 | Date storage method and server applied to distributed server cluster |
CN107404540A (en) * | 2017-09-01 | 2017-11-28 | 北京奇虎科技有限公司 | The synchronous method and device of data |
US20190155705A1 (en) * | 2017-11-20 | 2019-05-23 | Sap Se | Coordinated Replication of Heterogeneous Database Stores |
US20200065297A1 (en) * | 2018-08-24 | 2020-02-27 | Oracle International Corporation | Providing consistent database recovery after database failure for distributed databases with non-durable storage leveraging background synchronization point |
CN110955382A (en) * | 2018-09-26 | 2020-04-03 | 华为技术有限公司 | Method and device for writing data in distributed system |
CN111273859A (en) * | 2020-01-14 | 2020-06-12 | 北京百度网讯科技有限公司 | Method, device, equipment and medium for changing replication group members in distribution mode |
Non-Patent Citations (3)
Title |
---|
刘强: "基于云计算的BIM数据集成与管理技术研究", 中国博士学位论文全文数据库 (工程科技Ⅱ辑), no. 2, 15 February 2019 (2019-02-15) * |
李冰, 周映江: "基于全自动运行的行车综合自动化系统数据同步方案优化", 基于全自动运行的行车综合自动化系统数据同步方案优化, 31 December 2019 (2019-12-31) * |
林臻: "具有负载均衡特性的容错复制技术实现", 具有负载均衡特性的容错复制技术实现, 1 December 2011 (2011-12-01) * |
Also Published As
Publication number | Publication date |
---|---|
CN115048453B (en) | 2025-05-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3839749B1 (en) | Data storage method, device and server | |
CN115486052B (en) | Data storage method, system and storage medium | |
US9934242B2 (en) | Replication of data between mirrored data sites | |
CN109308227B (en) | Fault detection control method and related equipment | |
CN109976941B (en) | A data recovery method and device | |
CN112866408B (en) | Service switching method, device, equipment and storage medium in cluster | |
CN104980519A (en) | Multi-computer room storage system | |
CN111049928B (en) | Data synchronization method, system, electronic device and computer readable storage medium | |
US10789138B2 (en) | SMB service fault processing method and storage device | |
CN111259072A (en) | Data synchronization method and device, electronic equipment and computer readable storage medium | |
CN103514173A (en) | Data processing method and node equipment | |
CN103942252A (en) | Method and system for recovering data | |
US11231983B2 (en) | Fault tolerance processing method, apparatus, and server | |
CN104967536A (en) | Method and device for realizing data consistency in multiple computer rooms | |
US20240244414A1 (en) | Session binding relationship processing method and apparatus, electronic device, and readable medium | |
CN112069169A (en) | Block data storage method and device, electronic equipment and readable storage medium | |
CN105069152A (en) | Data processing method and apparatus | |
CN113064950A (en) | Data synchronization method, device, equipment and storage medium | |
CN113064764A (en) | Method and apparatus for performing blocks in a blockchain system | |
WO2017071384A1 (en) | Message processing method and apparatus | |
CN110162511B (en) | Log transmission method and related equipment | |
CN108200157A (en) | The daily record synchronous method and device that host node triggering retracts | |
CN115048453A (en) | Data synchronization method, device, equipment and storage medium | |
CN113032477A (en) | Long-distance data synchronization method and device based on GTID and computing equipment | |
CN105740096A (en) | Method and apparatus for data remote disaster tolerance backup of cluster file system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |