US 11,748,329 B2
Updating a multi-tenant database concurrent with tenant cloning
Stephane Geneix, an Francisco, CA (US); Simon Y. Wong, San Carlos, CA (US); and Randy Spalten, Manteca, CA (US)
Assigned to Salesforce, Inc., San Francisco, CA (US)
Filed by salesforce.com, inc., San Francisco, CA (US)
Filed on Jan. 31, 2020, as Appl. No. 16/779,321.
Prior Publication US 2021/0240689 A1, Aug. 5, 2021
Int. Cl. G06F 16/23 (2019.01); G06F 11/14 (2006.01)
CPC G06F 16/2343 (2019.01) [G06F 11/1451 (2013.01); G06F 2201/80 (2013.01)] 16 Claims
OG exemplary drawing
 
1. A method, comprising:
receiving, at a computer system, a request to perform an update operation on a multi-tenant database that includes updating database entries for a plurality of database tenants;
in response to receiving the request:
accessing, by an update process of the update operation, a list identifying database tenants having database entries, wherein accessing the list includes identifying ones of the database entries on which the update operation is to be performed;
holding, by the update process and while the update process accesses the list, a lock to prevent modification of the list by another process;
releasing the lock in response to the update process completing accessing of the list; and
performing the update operation while the lock is released;
during the update operation, updating, by the update process, the list to indicate which database tenants have been updated, wherein a clone process is executable to add update information to the list when the clone process clones a particular database tenant that has not yet been updated by the update process, and wherein the clone process is executable to forgo adding update information to the list when the clone process clones a particular database tenant that has already been updated by the update process; and
repeating, by the update process:
obtaining the lock on the list;
determining whether the list indicates that any remaining tenants need to be updated, including whether the list includes update information indicating that new tenants have been created by the clone process; and
in response to determining that the list indicates that remaining tenants need to be updated, performing the update operation for one or more of the remaining tenants;
wherein the repeating is performed until there are no further tenants of the multi-tenant database on which to perform the update operation.