IP Library Granted Patent US 11,436,212
Granted Patent B2
US 11,436,212 · App. 17/454,368 · Granted Sep 6, 2022

Concurrent transaction processing in a database system

Inventors: Chen Luo (San Mateo, CA); Alexander Miller (San Mateo, CA); William Waddington (Truckee, CA); Zhaohui Zhang (Redwood City, CA)
Assignee: Snowflake Inc.
G06F16/2322G06F16/2365G06F16/2379
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,436,212
App. No.
17/454,368
Granted
Sep 6, 2022
Kind
B2
Abstract

The subject technology inserts, by a first transaction, a new version of an object, the inserting corresponding to a first statement from the first transaction, the first statement including information indicating a first key, a first transaction identifier, a first statement number, and a first restart count. The subject technology performs, by a second transaction, a range read, the range read including information indicating the first key. The subject technology receives, after performing the range read, a set of conflicting transactions. The subject technology determines that a conflict occurred between the first transaction and a third transaction from the set of conflicting transactions.

Claims (62)

1. A system comprising:

at least one hardware processor; and

a memory storing instructions that cause the at least one hardware processor to perform operations comprising:

receiving a first transaction, the first transaction including a first statement to perform an update operation to a row in a first table, the update operation corresponding to a new version of an object, the object corresponding to data in the row in the first table to be updated, the first statement including information comprising an object key associated with the object, the object key comprising additional information being appended as a suffix to the object key, the additional information comprising a first transaction identifier associated with the first transaction, a first statement number associated with the first statement, and a first restart count indicating a number of times that the first statement has been attempted;

inserting, by the first transaction, the new version of the object;

performing, by a second transaction, a range read, the range read including information indicating the object key;

receiving, after performing the range read, a set of conflicting transactions;

determining that a conflict occurred between the first transaction and a third transaction from the set of conflicting transactions; and

performing a restart of the first transaction in response to determining that the conflict occurred.

2. The system of claim 1 , wherein the operations further comprise:

determining that a fourth transaction from the set of conflicting transactions has committed before a read timestamp of the first transaction, and

determining that the first transaction and the fourth transaction do not have a write-write conflict.

3. The system of claim 1 , wherein determining that the conflict occurred between the first transaction and the third transaction comprises:

determining that the third transaction from the set of conflicting transactions has committed after a read timestamp of the first transaction.

4. The system of claim 1 , wherein determining that the conflict occurred between the first transaction and the third transaction comprises:

determining that the third transaction is still active.

5. The system of claim 1 , wherein performing the restart of the first transaction comprises:

re-executing a statement from the first transaction as a subsequent execution of the statement from a previous execution of the statement that did not result in a transaction commit.

6. The system of claim 5 , wherein the operations further comprise:

prior to re-executing the statement, waiting for a particular conflicting transaction, from the set of conflicting transactions, to complete a commit operation.

7. The system of claim 5 , wherein re-executing the statement from the first transaction occurs without waiting for a particular conflicting transaction, from the set of conflicting transactions, to complete a commit operation.

8. The system of claim 1 , wherein the set of conflicting transactions comprises a list of committed or active transactions that performed an update operation in a row of a source table prior to the first transaction.

9. A method comprising:

receiving a first transaction, the first transaction including a first statement to perform an update operation to a row in a first table, the update operation corresponding to a new version of an object, the object corresponding to data in the row in the first table to be updated, the first statement including information comprising an object key associated with the object, the object key comprising additional information being appended as a suffix to the object key, the additional information comprising a first transaction identifier associated with the first transaction, a first statement number associated with the first statement, and a first restart count indicating a number of times that the first statement has been attempted;

inserting, by the first transaction, the new version of the object;

performing, by a second transaction, a range read, the range read including information indicating the object key;

receiving, after performing the range read, a set of conflicting transactions;

determining that a conflict occurred between the first transaction and a third transaction from the set of conflicting transactions; and

performing a restart of the first transaction in response to determining that the conflict occurred.

10. The method of claim 9 , further comprising:

determining that a fourth transaction from the set of conflicting transactions has committed before a read timestamp of the first transaction, and

determining that the first transaction and the fourth transaction do not have a write-write conflict.

11. The method of claim 9 , wherein determining that the conflict occurred between the first transaction and the third transaction comprises:

determining that the third transaction from the set of conflicting transactions has committed after a read timestamp of the first transaction.

12. The method of claim 9 , wherein determining that the conflict occurred between the first transaction and the third transaction comprises:

determining that the third transaction is still active.

13. The method of claim 9 , wherein performing the restart of the first transaction comprises:

re-executing a statement from the first transaction as a subsequent execution of the statement from a previous execution of the statement that did not result in a transaction commit.

14. The method of claim 13 , further comprising:

prior to re-executing the statement, waiting for a particular conflicting transaction, from the set of conflicting transactions, to complete a commit operation.

15. The method of claim 13 , wherein re-executing the statement from the first transaction occurs without waiting for a particular conflicting transaction, from the set of conflicting transactions, to complete a commit operation.

16. The method of claim 9 , wherein the set of conflicting transactions comprises a list of committed or active transactions that performed an update operation in a row of a source table prior to the first transaction.

17. A non-transitory computer-storage medium comprising instructions that, when executed by one or more processors of a machine, configure the machine to perform operations comprising:

receiving a first transaction, the first transaction including a first statement to perform an update operation to a row in a first table, the update operation corresponding to a new version of an object, the object corresponding to data in the row in the first table to be updated, the first statement including information comprising an object key associated with the object, the object key comprising additional information being appended as a suffix to the object key, the additional information comprising a first transaction identifier associated with the first transaction, a first statement number associated with the first statement, and a first restart count indicating a number of times that the first statement has been attempted;

inserting, by the first transaction, the new version of the object;

performing, by a second transaction, a range read, the range read including information indicating the object key;

receiving, after performing the range read, a set of conflicting transactions;

determining that a conflict occurred between the first transaction and a third transaction from the set of conflicting transactions; and

performing a restart of the first transaction in response to determining that the conflict occurred.

18. The non-transitory computer-storage medium of claim 17 , wherein the operations further comprise:

determining that a fourth transaction from the set of conflicting transactions has committed before a read timestamp of the first transaction, and

determining that the first transaction and the fourth transaction do not have a write-write conflict.

19. The non-transitory computer-storage medium of claim 17 , wherein determining that the conflict occurred between the first transaction and the third transaction comprises:

determining that the third transaction from the set of conflicting transactions has committed after a read timestamp of the first transaction.

20. The non-transitory computer-storage medium of claim 17 , wherein determining that the conflict occurred between the first transaction and the third transaction comprises:

determining that the third transaction is still active.

21. The non-transitory computer-storage medium of claim 17 , wherein performing the restart of the first transaction comprises:

re-executing a statement from the first transaction as a subsequent execution of the statement from a previous execution of the statement that did not result in a transaction commit.

22. The non-transitory computer-storage medium of claim 21 , wherein the operations further comprise:

prior to re-executing the statement, waiting for a particular conflicting transaction, from the set of conflicting transactions, to complete a commit operation.

23. The non-transitory computer-storage medium of claim 21 , wherein re-executing the statement from the first transaction occurs without waiting for a particular conflicting transaction, from the set of conflicting transactions, to complete a commit operation.

24. The non-transitory computer-storage medium of claim 17 , wherein the set of conflicting transactions comprises a list of committed or active transactions that performed an update operation in a row of a source table prior to the first transaction.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 2, 2021
From: LUO, CHEN; MILLER, ALEXANDER; WADDINGTON, WILLIAM; ZHANG, ZHAOHUI
To: SNOWFLAKE INC.
Reel/Frame 058269/0640 →
Continuity (3)
Continuation In Part 17163034 · Jan 29, 2021
Provisional Application 63081611 · Sep 22, 2020
Related Publication 20220092050A1 · Mar 24, 2022
Cited By (1)
US 12,717,615