System and method of distributing replication commands
First Claim
Patent Images
1. A system for distributing replication commands from a distributor to a subscriber, the system comprising:
- a memory;
a distributor for execution on a first computer in a network including a plurality of computers, the distributor comprising;
a command queue that receives transactional replication commands from a publisher and stores the transactional replication commands in the memory, wherein each replication command corresponds to a change in data in a data row and is associated with a respective hash of a primary key of the data row to which the replication command is associated;
a plurality of command buckets, wherein each of the plurality of command buckets is associated with a respective connection to the command queue and only one data row, and wherein at least a portion of a communication and logging overhead associated with a two phase commit operation is avoided by including for each of the plurality of command buckets an executor that executes a coordinated commit operation upon the plurality of command buckets at substantially the same time;
a dispatcher, wherein the dispatcher;
sorts the transactional replication commands stored in the command queue as a function of each hash associated with a transactional replication command, and by applying a logical sequence number of commit record in order to identify which commands amongst the transactional replication commands of the command queue need to be re-applied as a result of an unsuccessful commit operation;
transmits each transactional replication command in the command queue to an associated command bucket as a function of the hash associated with the transactional replication command using the respective connection for the associated command bucket such that each command bucket stores a respective set of replication commands having a same hash value;
marks each of the command buckets as ready to be committed;
stops sending new transactional replication commands to the marked command buckets; and
waits to receive from each executor, an event that signals a successful completion of the coordinated commit operation, thereby detecting a mixture of successful and unsuccessful commit operations amongst the plurality of command buckets.
2 Assignments
0 Petitions
Accused Products
Abstract
A transactional replication system wherein each replicated command applies to a single row as identified by the primary key, replicated commands are dispatched among multiple connections by hashing of primary key from a single command queue to ensure that changes to the same data row are always dispatched to the same connection to maintain the order of commands as originally occurred on publisher. All connections commit their transactions at the same time in a coordinated fashion without a two phase commit. Retry logic based on a logical sequence number is used to reapply commands from any connection that fails to commit.
21 Citations
13 Claims
-
1. A system for distributing replication commands from a distributor to a subscriber, the system comprising:
-
a memory; a distributor for execution on a first computer in a network including a plurality of computers, the distributor comprising; a command queue that receives transactional replication commands from a publisher and stores the transactional replication commands in the memory, wherein each replication command corresponds to a change in data in a data row and is associated with a respective hash of a primary key of the data row to which the replication command is associated; a plurality of command buckets, wherein each of the plurality of command buckets is associated with a respective connection to the command queue and only one data row, and wherein at least a portion of a communication and logging overhead associated with a two phase commit operation is avoided by including for each of the plurality of command buckets an executor that executes a coordinated commit operation upon the plurality of command buckets at substantially the same time; a dispatcher, wherein the dispatcher; sorts the transactional replication commands stored in the command queue as a function of each hash associated with a transactional replication command, and by applying a logical sequence number of commit record in order to identify which commands amongst the transactional replication commands of the command queue need to be re-applied as a result of an unsuccessful commit operation; transmits each transactional replication command in the command queue to an associated command bucket as a function of the hash associated with the transactional replication command using the respective connection for the associated command bucket such that each command bucket stores a respective set of replication commands having a same hash value; marks each of the command buckets as ready to be committed; stops sending new transactional replication commands to the marked command buckets; and waits to receive from each executor, an event that signals a successful completion of the coordinated commit operation, thereby detecting a mixture of successful and unsuccessful commit operations amongst the plurality of command buckets. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A method for distributing transactional replication commands in a system having at least one of a distributor or a publisher on a first computer and a subscriber on a second computer, the method comprising:
-
receiving each transactional replication command and a respective associated indicia for each replication command from the publisher;
wherein each received replication command correspond to a change in a respective data row of a table, and wherein each indicia is a hash of a primary key of a respective row of the table on which the replication command operates;storing the replication commands and the indicia in a command queue; sorting the transactional replication commands stored in the command queue using a logical sequence number of commit record; transmitting each transactional replication command in the command queue to an associated command bucket as a function of the associated indicia via a respective dedicated connection to the associated command bucket such that each command bucket stores a respective set of replication commands having a same hash value, wherein each command bucket is associated with a respective connection to the command queue and only one data row; marking each of the command buckets as ready to be committed; stopping new transactional replication commands from being sent to the marked command buckets; avoiding incurring at least a portion of a communication and logging overhead associated with a two phase commit operation by executing a coordinated commit operation at substantially the same time; waiting to receive from an executor associated with a command bucket, an event that signals a successful completion of the coordinated commit operation, thereby detecting a mixture of successful and unsuccessful commit operations; and using the logical sequence number of commit record in order to identify which commands amongst the transactional replication commands of the command queue need to be re-applied as a result of an unsuccessful commit operation. - View Dependent Claims (7, 8, 9)
-
-
10. A computer-readable storage medium having computer-executable instructions for distributing transaction replication commands from a publisher to a subscriber, said instructions comprising:
-
receiving each transactional replication command and a respective associated indicia for each replication command from the publisher;
wherein each received replication command corresponds to a change in a respective data row of a table, and wherein each indicia is a hash of a primary key of a respective row of the table on which the replication command operates;storing the replication commands and the indicia in a command queue; sorting the transactional replication commands stored in the command queue using a logical sequence number of commit record; transmitting each transactional replication command in the command queue to an associated command bucket as a function of the associated indicia via a respective dedicated connection to the associated command bucket such that each command bucket stores a respective set of replication commands having a same hash value, wherein each command bucket is associated with a respective connection to the command queue and only one data row; marking each of the command buckets as ready to be committed; stopping new transactional replication commands from being sent to the marked command buckets; executing a coordinated commit operation at substantially the same time, thereby avoiding incurring at least a portion of a communication and logging overhead associated with a two phase commit operation; waiting to receive from an executor associated with a command bucket, an event that signals a successful completion of the coordinated commit operation, thereby detecting a mixture of successful and unsuccessful commit operations; and using the logical sequence number of commit record in order to identify which commands amongst the transactional replication commands of the command queue need to be re-applied as a result of an unsuccessful commit operation. - View Dependent Claims (11, 12, 13)
-
Specification