US 12,032,560 B2
Distributed transaction execution management in distributed databases
Graham Timothy Pople, Manchester (GB); Brett Phillip James Lawson, Surrey (CA); Matthew William Ingenthron, Huntington Beach, CA (US); David John Finlay, Mountain View, CA (US); Shivani Gupta, Irvine, CA (US); John Sae Liang, Palo Alto, CA (US); and Stephen Ching-Sing Yen, Atherton, CA (US)
Assigned to COUCHBASE, INC., Santa Clara, CA (US)
Filed by Couchbase, Inc., Santa Clara, CA (US)
Filed on May 21, 2021, as Appl. No. 17/327,455.
Claims priority of provisional application 63/029,325, filed on May 22, 2020.
Prior Publication US 2021/0365440 A1, Nov. 25, 2021
Int. Cl. G06F 16/23 (2019.01); G06F 16/215 (2019.01); G06F 16/27 (2019.01); G06F 9/54 (2006.01)
CPC G06F 16/2379 (2019.01) [G06F 9/547 (2013.01); G06F 16/215 (2019.01); G06F 16/27 (2019.01)] 18 Claims
OG exemplary drawing
 
1. A non-transitory computer-readable storage medium for storing instructions that when executed by a computer processor cause the computer processor to perform steps comprising:
receiving a request to execute a transaction at a database node of a plurality of database nodes of a distributed database system, the transaction describing a mutation of a record stored at the database node, wherein the record is associated with a check-and-set (CAS) value that is updated responsive to modifications to the record, and wherein the CAS value is stored with the record at the database node; and
responsive to the request to execute the transaction, performing an attempt to execute the transaction, comprising:
retrieving information corresponding to the record from the database node, the information comprising a first CAS value associated with the record;
sending a request for mutation of the record;
receiving a second CAS value associated with the record from the database node subsequent to sending the request for mutation;
detecting whether a mismatch between the second CAS value and the first CAS value is present, the mismatch indicating that an additional mutation corresponding to an additional transaction has been staged for the record at the database node, the additional mutation conflicting with the mutation;
responsive to detecting the mismatch between the second CAS value and the first CAS value, aborting the attempt to execute the transaction;
responsive to detecting no mismatch,
executing the transaction; and
causing the CAS value associated with the record to be updated to a third CAS value, wherein updating the CAS value of the record includes causing the third CAS value to be stored with the record at the database node.