Database replication method and apparatus for distributed system

US11093522B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-11093522-B2
Application numberUS-201816165596-A
CountryUS
Kind codeB2
Filing dateOct 19, 2018
Priority dateApr 22, 2016
Publication dateAug 17, 2021
Grant dateAug 17, 2021

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A database replication method and apparatus for a distributed system are provided and relate to the database field. The method includes: receiving by a coordination server, a timestamp of a multi-partition transaction newly added to a first partition of a secondary cluster; determining, by the coordination server, a target timestamp for the first partition based on the received timestamp of the newly added multi-partition transaction and a stored multi-partition transaction timestamp of each partition of the secondary cluster; and sending, by the coordination server, the target timestamp to the first partition, so that the first partition executes a replication log in the first partition based on the target timestamp. In this way, the corresponding partition can execute, without waiting, a multi-partition transaction that is present in all the partitions but has not been executed, thereby avoiding data inconsistency and increasing replication efficiency.

First claim

Opening claim text (preview).

What is claimed is: 1. A database replication method for a distributed system, the method comprising: receiving, by a coordination server, a timestamp of a multi-partition transaction newly added to a first partition of a secondary cluster, wherein the newly added multi-partition transaction is a multi-partition transaction among transactions recorded in a replication log that is sent by a corresponding partition of a primary cluster and received by the first partition since the first partition last sends a multi-partition transaction timestamp; determining, by the coordination server, a target timestamp for the first partition based on the received timestamp of the newly added multi-partition transaction and a stored multi-partition transaction timestamp of each partition of the secondary cluster, wherein the target timestamp indicates information about a multi-partition transaction executable by the first partition; and sending, by the coordination server, the target timestamp to the first partition. 2. The method according to claim 1 , wherein determining, by a coordination server, a target timestamp for the first partition based on the received timestamp of the newly added multi-partition transaction and a stored multi-partition transaction timestamp of each partition of the secondary cluster comprises: determining the multi-partition transaction timestamps of the partitions of the secondary cluster do not all coincide by the coordination server; determining an intersection of the multi-partition transaction timestamps of the partitions of the secondary cluster by the coordination server; and obtaining, by the coordination server, from a multi-partition transaction timestamp, that is outside the intersection, of the partitions of the secondary cluster, a timestamp with a smallest value as the target timestamp for the first partition, the timestamp with the smallest value for instructing the first partition to execute a log record, in the replication log in the first partition, that is preceding a multi-partition transaction corresponding to the target timestamp. 3. The method according to claim 1 , wherein determining, by a coordination server, a target timestamp for the first partition based on the received timestamp of the newly added multi-partition transaction and a stored multi-partition transaction timestamp of each partition of the secondary cluster, by a coordination server, comprises: determining the multi-partition transaction timestamps of the partitions all coincide by the coordination server; and using a first designated timestamp as the target timestamp for the first partition by the coordination server, the first designated timestamp for instructing the first partition to execute log records in the replication log in the partition until a log record of a next newly added multi-partition transaction is encountered. 4. The method according to claim 1 , wherein determining, by a coordination server, a target timestamp for the first partition based on the received timestamp of the newly added multi-partition transaction and a stored multi-partition transaction timestamp of each partition of the secondary cluster comprises: determining an intersection of the multi-partition transaction timestamps of the partitions of the secondary cluster by the coordination server; determining the intersection is not an empty set by the coordination server; and obtaining a timestamp with a largest value from the intersection as the target timestamp for the first partition by the coordination server, the timestamp with the largest value for instructing the first partition to execute a log record, in the first partition, that is preceding a multi-partition transaction corresponding to a 1 st multi-partition transaction timestamp following the target timestamp. 5. The method according to claim 1 , wherein determining, by the coordination server, a target timestamp for the first partition based on the received timestamp of the newly added multi-partition transaction and a stored multi-partition transaction timestamp of each partition of the secondary cluster, by the coordination server, comprises: determining an intersection of the multi-partition transaction timestamps of the partitions of the secondary cluster by the coordination server; determining the intersection is an empty set by the coordination server; and using a second designated timestamp as the target timestamp for the first partition by the coordination server, the second designated timestamp for instructing the first partition to sequentially execute log records in the replication log in the partition until a multi-partition transaction log record is encountered. 6. A database replication method for a distributed system, the method comprising: sending, by a first partition, to a coordination server, a timestamp of a multi-partition transaction newly added to the first partition; receiving, by a first partition, a target timestamp from the coordination server, wherein the target timestamp is used to indicate information about a multi-partition transaction executable by the first partition, and wherein the target timestamp is based on a received timestamp of the newly added multi-partition transaction and a stored multi-partition transaction timestamp of each partition of a secondary cluster; and executing, by the first partition, a replication log in the first partition based on the target timestamp for the first partition. 7. The method according to claim 6 , wherein executing, by the first partition, a replication log in the first partition based on the target timestamp for the first partition comprises: determining, by the first partition, the target timestamp for the first partition is a timestamp with a smallest value among a multi-partition transaction timestamp that is outside an intersection of the multi-partition transaction timestamps of the partitions of the secondary cluster; and executing a log record, by a first partition, in the replication log in the first partition, that is preceding a multi-partition transaction corresponding to the target timestamp. 8. The method according to claim 6 , wherein executing, by the first partition, a replication log in the first partition based on the target timestamp for the first partition comprises: determining, by the first partition, the target timestamp is a first designated timestamp; and executing, by the first partition, log records in the replication log in the first partition until a log record of a next newly added multi-partition transaction is encountered, wherein the first designated timestamp indicates that the multi-partition transaction timestamps of the partitions of the secondary cluster all coincide. 9. The method according to claim 6 , wherein executing, by the first partition, a replication log in the first partition based on the target timestamp for the first partition comprises: determining, by the first partition, the target timestamp for the first partition is a timestamp with a largest value in an intersection of the multi-partition transaction timestamps of the partitions of the secondary cluster; and executing, by the first partition, a log record, in the first partition, that is preceding a multi-partition transaction corresponding to a 1 st multi-partition transaction timestamp following the target timestamp. 10. The method according to claim 6 , wherein executing, by the first partition, a replication log in the first partition based on the target timestamp for the first partition comprises: determining, by the first partition, the target timestamp for the first partition is a second designated timestamp; and sequentially executing, by the first partiti

Assignees

Inventors

Classifications

  • G06F16/27Primary

    Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor · CPC title

  • Information retrieval; Database structures therefor; File system structures therefor · CPC title

  • Data partitioning, e.g. horizontal or vertical partitioning · CPC title

  • Versioning file systems, temporal file systems, e.g. file system supporting different historic versions of files · CPC title

  • Updates performed during online database operations; commit processing · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US11093522B2 cover?
A database replication method and apparatus for a distributed system are provided and relate to the database field. The method includes: receiving by a coordination server, a timestamp of a multi-partition transaction newly added to a first partition of a secondary cluster; determining, by the coordination server, a target timestamp for the first partition based on the received timestamp of the…
Who is the assignee on this patent?
Huawei Tech Co Ltd
What technology area does this patent fall under?
Primary CPC classification G06F16/27. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Aug 17 2021 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 5 related publications on this page (citations in our corpus or others sharing the same primary CPC).