# US 11,442,961 B2 · Active transaction list synchronization method and apparatus

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,442,961 B2
- Document ID: US11442961B2
- Status: Granted
- Kind: B2
- Application number: 16/552,833
- Filed: 2019-08-27
- Published: 2019-12-19
- Granted: 2022-09-13
- Earliest claimed: 2017-02-28
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Jijun Wen; Bo Shang; Wei Wang
- Web page: https://patentgrep.com/patent/US11442961B2

## CPC

- G06F 11/14: Error detection or correction of the data by redundancy in operations (error detection or correction of the data by redundancy in hardware G06F11/16)
- G06F 16/273: {Asynchronous replication or reconciliation}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An active transaction list synchronization method and apparatus comprising a first node that records, in a transaction list incremental log buffer, a transaction list incremental log that is obtained after last active transaction list synchronization, where the transaction list incremental log indicates a change of a transaction recorded in an active transaction list of the first node and includes an added-transaction log and a committed-transaction log, wherein the added-transaction log indicates a transaction is added to the active transaction list, wherein the committed-transaction log indicates a transaction is deleted from the active transaction list. When performing group commit on transactions recorded in the committed-transaction log, the first node sends the transaction list incremental log to at least one second node.

## Claims

### Claim 1

An active transaction list synchronization method implemented by a first node, comprising:
obtaining a transaction list incremental log after a last active transaction list synchronization;
recording, in a transaction list incremental log buffer, the transaction list incremental log responsive to obtaining the transaction list incremental log, wherein the transaction list incremental log comprises a log that indicates a change of a transaction recorded in an active transaction list of the first node, and wherein the transaction list incremental log comprises:
an added-transaction log that indicates the transaction is added to the active transaction list; and
a committed-transaction log that indicates the transaction is deleted from the active transaction list, wherein the active transaction list of the first node records a not-yet-committed transaction; and
sending the transaction list incremental log to a second node when performing group commit on at least one transaction recorded in the committed-transaction log.

### Claim 2 (depends on 1)

The active transaction list synchronization method of claim 1, further comprising protecting the transaction list incremental log buffer using a redo log lock, and wherein recording the transaction list incremental log further comprises:
obtaining the redo log lock;
locking the transaction list incremental log buffer after obtaining the redo log lock;
recording the added-transaction log in the transaction list incremental log buffer; and
recording the committed-transaction log in the transaction list incremental log buffer.

### Claim 3 (depends on 2)

The active transaction list synchronization method of claim 2, wherein sending the transaction list incremental log to the second node comprises:
obtaining the redo log lock;
locking the transaction list incremental log buffer after obtaining the redo log lock;
copying the transaction list incremental log in the transaction list incremental log buffer into a buffer that is not lock protected; and
sending, to the second node, the transaction list incremental log in the buffer that is not lock protected.

### Claim 4 (depends on 3)

The active transaction list synchronization method of claim 3, wherein copying the transaction list incremental log further comprises resetting the transaction list incremental log buffer.

### Claim 5 (depends on 1)

The active transaction list synchronization method of claim 1, wherein before sending the transaction list incremental log to the second node, the method further comprises:
deleting, from the transaction list incremental log, the added-transaction log; and
deleting, from the transaction list incremental log, the committed-transaction log that is recorded for a same transaction.

### Claim 6 (depends on 1)

The active transaction list synchronization method of claim 1, wherein before sending the transaction list incremental log to the second node, the method further comprises:
deleting, from the transaction list incremental log, the added-transaction log that is recorded for a same transaction; and
deleting, from the transaction list incremental log, the committed-transaction log that is recorded for a same transaction, wherein the total size of the transaction list incremental log is greater than the preset threshold.

### Claim 7 (depends on 1)

The active transaction list synchronization method of claim 1, wherein before sending the transaction list incremental log to the second node, the method further comprises sending the active transaction list of the first node to the second node, and wherein the second node is added to a database cluster to which the first node belongs.

### Claim 8

An active transaction list synchronization apparatus, comprising:
a processor; and
a memory coupled to the processor and storing one or more programs that, when executed by the processor, cause the active transaction list synchronization apparatus to be configured to:
obtain a transaction list incremental log after a last active transaction list synchronization;
record, in a transaction list incremental log buffer, the transaction list incremental log, wherein the transaction list incremental log comprises a log indicating a change of a transaction recorded in an active transaction list of the apparatus, and wherein the transaction list incremental log comprises:
an added-transaction log that indicates the transaction is added to the active transaction list; and
a committed-transaction log that indicates the transaction is deleted from the active transaction list, wherein the active transaction list of the first node records a not-yet-committed transaction; and
send the log to a second node when group commit is performed on transactions recorded in the committed-transaction log.

### Claim 9 (depends on 8)

The active transaction list synchronization apparatus of claim 8, wherein the transaction list incremental log buffer is protected by using a redo log lock, and wherein the programs further cause the active transaction list synchronization apparatus to be configured to:
obtain the redo log lock;
lock the transaction list incremental log buffer after obtaining the redo log lock;
record the added-transaction log in the transaction list incremental log buffer; and
record the committed-transaction log in the transaction list incremental log buffer.

### Claim 10 (depends on 9)

The active transaction list synchronization apparatus of claim 9, wherein the programs further cause the active transaction list synchronization apparatus to be configured to:
obtain the redo log lock;
lock the transaction list incremental log buffer after obtaining the redo log lock;
copy the transaction list incremental log in the transaction list incremental log buffer into a buffer that is not lock protected; and
send, to the second node, the transaction list incremental log in the buffer that is not lock protected.

### Claim 11 (depends on 10)

The active transaction list synchronization apparatus of claim 10, wherein the programs further cause the active transaction list synchronization apparatus to be configured to reset the transaction list incremental log buffer after copying the transaction list incremental log.

### Claim 12 (depends on 8)

The active transaction list synchronization apparatus of claim 8, wherein the programs further cause the active transaction list synchronization apparatus to be configured to:
delete, from the transaction list incremental log, the added-transaction log; and
delete, from the transaction incremental log, the committed-transaction log that is recorded for the same transaction before sending the transaction list incremental log to the second node.

### Claim 13 (depends on 8)

The active transaction list synchronization apparatus of claim 8, wherein the programs further cause the active transaction list synchronization apparatus to be configured to:
delete, from the transaction list incremental log, the added-transaction log that is recorded for a same transaction; and
delete, from the transaction list incremental log, the committed-transaction log that is recorded for the same transaction, wherein the total size of the transaction list incremental log is greater than the preset threshold.

### Claim 14 (depends on 8)

The active transaction list synchronization apparatus of claim 8, wherein the programs further cause the active transaction list synchronization apparatus to be configured to send the active transaction list to the second node and wherein the second node is added to a database cluster to which the active transaction list synchronization apparatus belongs.

### Claim 15

An active transaction list synchronization apparatus, comprising:
a memory storing instructions;
a processor coupled to the memory and configured to execute the instructions, wherein the instructions cause the processor to:
receive a transaction list incremental log from a first node, wherein the transaction list incremental log is received after a last active transaction list synchronization, wherein the transaction list incremental log comprises a log indicating a change of the transaction recorded in the active transaction list of the first node, and wherein the transaction list incremental log comprises:
an added-transaction log that indicates the transaction is added to the active transaction list; and
a committed-transaction log that indicates the transaction is deleted from the active transaction list, wherein the active transaction list of the first node records a not-yet-committed transaction; and
update a local active transaction list according to the transaction list incremental log.

### Claim 16 (depends on 15)

The active transaction list synchronization apparatus of claim 15, wherein the instructions further cause the processor to add a first transaction to the active transaction list, and wherein the transaction list incremental log comprises a log that indicates the first transaction is added and does not indicate that the first transaction is committed.

### Claim 17 (depends on 15)

The active transaction list synchronization apparatus of claim 15, wherein the instructions further cause the processor to delete a second transaction from the active transaction list, wherein the active transaction list comprises the second transaction, and wherein the transaction list incremental log comprises a log that indicates the second transaction is committed.

### Claim 18 (depends on 15)

The active transaction list synchronization apparatus of claim 15, wherein the instructions further cause the processor to receive an active transaction list from the first node before receiving the transaction list incremental log from the first node.

### Claim 19 (depends on 15)

The active transaction list synchronization apparatus of claim 15, wherein the instructions further cause the processor to receive the transaction list incremental log in a transaction list incremental log buffer that is not lock protected.

### Claim 20 (depends on 15)

The active transaction list synchronization apparatus of claim 15, wherein the instructions further cause the processor to receive the transaction list incremental log from the first node after a second node is added to a database cluster comprising the first node.
