×

Lease based leader election system

  • US 9,984,140 B1
  • Filed: 02/05/2015
  • Issued: 05/29/2018
  • Est. Priority Date: 02/05/2015
  • Status: Active Grant
First Claim
Patent Images

1. A system, comprising:

  • a database service, implemented by one or more computing devices and configured to store a replica of a database table on respective master hosts on computing devices in the system, each master host residing in a different availability zone, wherein a master host configured to act as a primary master host can service write requests that are directed to the database table;

    a data storage service, implemented by one or more computing devices;

    wherein one of the master hosts is configured to assume the role of primary master host for the database table, wherein to assume the role of primary master host, the one of the master hosts is configured to;

    update a lease record maintained by the data storage service to reflect that the one of the master hosts holds a lease for the database table, wherein the lease represents an authorization to act as the primary master host for the database table for a pre-determined lease period; and

    enter a writable mode that enables writing to the replica of the database table stored on the one of the master hosts;

    wherein the other one of the master hosts is configured to;

    access the lease record to determine whether the lease is held; and

    in response to determining that the lease is held by the one of the master hosts, maintain the replica of the database table stored on the other one of the master hosts in a read-only mode;

    wherein the one of the master hosts is further configured to;

    access, subsequent to assuming the role of primary master host and prior to expiration of the pre-determined lease period, the lease record to determine whether the lease is still held by the one of the master hosts;

    maintain the replica of the database table stored on the one of the master hosts in the writable mode and renew the lease, in response to determining that the lease is still held by the one of the master hosts, wherein to renew the lease, the one of the master hosts updates the lease record to reflect that the one of the master hosts still holds the lease and that it has been renewed; and

    enter a read-only mode and refrain from renewing the lease, in response to determining that the lease is held by the other one of the master hosts.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×