US2023325376A1PendingUtilityA1

Concurrent transactions consistency in database systems

Assignee: SNOWFLAKE INCPriority: Sep 22, 2020Filed: May 31, 2023Published: Oct 12, 2023
Est. expirySep 22, 2040(~14.2 yrs left)· nominal 20-yr term from priority
G06F 16/2329G06F 16/2282G06F 16/24568G06F 16/248G06F 16/2379
72
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

The subject technology performs a read operation from a first transaction on a table in a database. The subject technology determines a first commit version identifier corresponding to first data resulting from the read operation. The subject technology proceeds to perform a particular write operation from the first transaction. The subject technology determines that the first commit version identifier fails to match a second commit version identifier corresponding to a second transaction. The subject technology aborts the particular write operation from the first transaction. The subject technology performs a particular read operation from the first transaction. The subject technology determines a particular commit version identifier corresponding to particular data resulting from the particular read operation. The subject technology retries to perform the particular write operation. The subject technology performs the particular write operation in response to the particular commit version identifier matching the second commit version identifier.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
         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: 
 performing a read operation from a first transaction on a table in a database; 
 determining a first commit version identifier corresponding to first data resulting from the read operation; 
 proceeding to perform a particular write operation from the first transaction; 
 determining that the first commit version identifier fails to match a second commit version identifier corresponding to a second transaction; 
 aborting the particular write operation from the first transaction to protect an integrity and consistency of the first data; 
 performing a particular read operation from the first transaction on the table in the database; 
 determining a particular commit version identifier corresponding to particular data resulting from the particular read operation; 
 retrying to perform the particular write operation from the first transaction; and 
 performing the particular write operation in response to the particular commit version identifier matching the second commit version identifier. 
   
     
     
         2 . The system of  claim 1 , wherein the operations further comprise: 
 initiating a particular commit process for the first transaction.   
     
     
         3 . The system of  claim 1 , wherein the operations further comprise:
 prior to performing the read operation, receiving the first transaction, the first transaction to be executed on linearizable storage; and   assigning, prior to performing the read operation, a first read version to the first transaction, the first read version indicating a first version of the linearizable storage, the first read version corresponding to a particular timestamp of a current time.   
     
     
         4 . The system of  claim 1 , wherein the operations further comprise:
 inserting a first transaction identifier associated with the first transaction in a transaction status table, the first transaction being included in a set of aborted transactions, the first transaction identifier being associated with information indicating a transaction outcome as an aborted transaction.   
     
     
         5 . The system of  claim 1 , wherein the operations further comprise:
 in response to determining that a particular write operation is absent from the first transaction, proceeding to execute a different transaction and foregoing to perform a commit process in connection with the first transaction to protect an integrity and consistency of the first data.   
     
     
         6 . The system of  claim 3 , wherein the operations further comprise:
 receiving the second transaction, the second transaction to be executed on the linearizable storage; and   assigning the second transaction a second read version, the second read version indicating a second version of the linearizable storage.   
     
     
         7 . The system of  claim 6 , wherein the operations further comprise:
 performing a second read operation from the second transaction on the table in the database; and   performing a write operation from the second transaction on the table in the database.   
     
     
         8 . The system of  claim 7 , wherein performing the write operation from the second transaction comprises: 
 determining a particular commit version identifier corresponding to second data results from the second read operation; and   completing the write operation in response to the particular commit version identifier being equivalent to the first commit version identifier.   
     
     
         9 . The system of  claim 7 , wherein the operations further comprise:
 assigning a second commit version identifier to second data stored to the table from the write operation, the second commit version identifier corresponding to a second version of data in the table, the second commit version identifier different than the first commit version identifier; and   initiating a commit process for the second transaction.   
     
     
         10 . The system of  claim 9 , wherein assigning the second commit version identifier comprises incrementing a value associated with the first commit version identifier to determine the second commit version identifier. 
     
     
         11 . A machine-implemented method comprising:
 performing a read operation from a first transaction on a table in a database;   determining a first commit version identifier corresponding to first data resulting from the read operation;   proceeding to perform a particular write operation from the first transaction;   determining that the first commit version identifier fails to match a second commit version identifier corresponding to a second transaction;   aborting the particular write operation from the first transaction to protect an integrity and consistency of the first data;   performing a particular read operation from the first transaction on the table in the database;   determining a particular commit version identifier corresponding to particular data resulting from the particular read operation;   retrying to perform the particular write operation from the first transaction; and   performing the particular write operation in response to the particular commit version identifier matching the second commit version identifier.   
     
     
         12 . The machine-implemented method of  claim 11 , further comprising: 
 initiating a particular commit process for the first transaction.   
     
     
         13 . The machine-implemented method of  claim 11 , further comprising:
 prior to performing the read operation, receiving the first transaction, the first transaction to be executed on linearizable storage; and   assigning, prior to performing the read operation, a first read version to the first transaction, the first read version indicating a first version of the linearizable storage, the first read version corresponding to a particular timestamp of a current time.   
     
     
         14 . The machine-implemented method of  claim 11 , further comprising:
 inserting a first transaction identifier associated with the first transaction in a transaction status table, the first transaction being included in a set of aborted transactions, the first transaction identifier being associated with information indicating a transaction outcome as an aborted transaction.   
     
     
         15 . The machine-implemented method of  claim 11 , further comprising:
 in response to determining that a particular write operation is absent from the first transaction, proceeding to execute a different transaction and foregoing to perform a commit process in connection with the first transaction to protect an integrity and consistency of the first data.   
     
     
         16 . The machine-implemented method of  claim 13 , further comprising:
 receiving the second transaction, the second transaction to be executed on the linearizable storage; and   assigning the second transaction a second read version, the second read version indicating a second version of the linearizable storage.   
     
     
         17 . The machine-implemented method of  claim 16 , further comprising:
 performing a second read operation from the second transaction on the table in the database; and   performing a write operation from the second transaction on the table in the database.   
     
     
         18 . The machine-implemented method of  claim 17 , wherein performing the write operation from the second transaction comprises:
 determining a particular commit version identifier corresponding to second data results from the second read operation; and   completing the write operation in response to the particular commit version identifier being equivalent to the first commit version identifier.   
     
     
         19 . The machine-implemented method of  claim 17 , further comprising:
 assigning a second commit version identifier to second data stored to the table from the write operation, the second commit version identifier corresponding to a second version of data in the table, the second commit version identifier different than the first commit version identifier; and   initiating a commit process for the second transaction.   
     
     
         20 . The machine-implemented method of  claim 19 , wherein assigning the second commit version identifier comprises incrementing a value associated with the first commit version identifier to determine the second commit version identifier. 
     
     
         21 . 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:
 performing a read operation from a first transaction on a table in a database;   determining a first commit version identifier corresponding to first data resulting from the read operation;   proceeding to perform a particular write operation from the first transaction;   determining that the first commit version identifier fails to match a second commit version identifier corresponding to a second transaction;   aborting the particular write operation from the first transaction to protect an integrity and consistency of the first data;   performing a particular read operation from the first transaction on the table in the database;   determining a particular commit version identifier corresponding to particular data resulting from the particular read operation;   retrying to perform the particular write operation from the first transaction; and   performing the particular write operation in response to the particular commit version identifier matching the second commit version identifier.   
     
     
         22 . The non-transitory computer-storage medium of  claim 21 , wherein the operations further comprise:
 initiating a particular commit process for the first transaction.   
     
     
         23 . The non-transitory computer-storage medium of  claim 21 , wherein the operations further comprise:
 prior to performing the read operation, receiving the first transaction, the first transaction to be executed on linearizable storage; and   assigning, prior to performing the read operation, a first read version to the first transaction, the first read version indicating a first version of the linearizable storage, the first read version corresponding to a particular timestamp of a current time.   
     
     
         24 . The non-transitory computer-storage medium of  claim 21 , wherein the operations further comprise:
 inserting a first transaction identifier associated with the first transaction in a transaction status table, the first transaction being included in a set of aborted transactions, the first transaction identifier being associated with information indicating a transaction outcome as an aborted transaction.   
     
     
         25 . The non-transitory computer-storage medium of  claim 21 , wherein the operations further comprise:
 in response to determining that a particular write operation is absent from the first transaction, proceeding to execute a different transaction and foregoing to perform a commit process in connection with the first transaction to protect an integrity and consistency of the first data.   
     
     
         26 . The non-transitory computer-storage medium of  claim 23 , wherein the operations further comprise:
 receiving the second transaction, the second transaction to be executed on the linearizable storage; and   assigning the second transaction a second read version, the second read version indicating a second version of the linearizable storage.   
     
     
         27 . The non-transitory computer-storage medium of  claim 26 , wherein the operations further comprise:
 performing a second read operation from the second transaction on the table in the database; and   performing a write operation from the second transaction on the table in the database.   
     
     
         28 . The non-transitory computer-storage medium of  claim 27 , wherein performing the write operation from the second transaction comprises:
 determining a particular commit version identifier corresponding to second data results from the second read operation; and   completing the write operation in response to the particular commit version identifier being equivalent to the first commit version identifier.   
     
     
         29 . The non-transitory computer-storage medium of  claim 27 , wherein the operations further comprise:
 assigning a second commit version identifier to second data stored to the table from the write operation, the second commit version identifier corresponding to a second version of data in the table, the second commit version identifier different than the first commit version identifier; and   initiating a commit process for the second transaction.   
     
     
         30 . The non-transitory computer-storage medium of  claim 29 , wherein assigning the second commit version identifier comprises incrementing a value associated with the first commit version identifier to determine the second commit version identifier.

Join the waitlist — get patent alerts

Track US2023325376A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.