Method, system and apparatus for managing primary and secondary databases
AssigneeAlibaba Group Holding Limited
InventorsZhenkun Yang, Gui Huang
Life of this patent
Estimating the term…
Abstract
The present application describes techniques for managing primary and secondary databases. One example method includes determining whether a lock held by a primary database expires, wherein the primary database and the secondary databases share the lock; in response to determining that the lock held by the primary database has expired, determining whether a lock renewal request of the primary database has been received; and in response to determining that the lock renewal request of the primary database has not been received, selecting a particular secondary database from the secondary databases as a new primary database, and controlling the primary database to be switched to the particular secondary database.
Claims20
A computer-implemented method for managing primary and secondary databases, the computer-implemented method comprising:
- determining that a lock held by a primary database has expired, wherein the primary database and the secondary databases share the lock, and wherein the lock is updated to extend a validity period of the lock before the validity period expires, wherein:
- the lock is updated during an update cycle having a first time period T1,
- the primary database sends, at a cycle with a second time period T2, a lock request for querying a status of the lock, and
- a particular secondary database from the secondary databases sends, at a cycle with a third time period T3, a lock request for querying the status of the lock, wherein the second time period T2 is smaller than the first time period T1, and the third time period T3 is greater than or equal to the first time period T1;
- in response to determining that the lock held by the primary database has expired, determining that a lock renewal request of the primary database has not been received after the lock has expired;
- and
- in response to determining that the lock renewal request of the primary database has not been received, selecting the particular secondary database as a new primary database, and controlling the primary database to be switched to the secondary database.
A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations for managing primary and secondary databases, the operations comprising:
- determining that a lock held by a primary database has expired, wherein the primary database and the secondary databases share the lock, and wherein the lock is updated to extend a validity period of the lock before the validity period expires, wherein:
- the lock is updated during an update cycle having a first time period T1,
- the primary database sends, at a cycle with a second time period T2, a lock request for querying a status of the lock, and
- a particular secondary database from the secondary databases sends, at a cycle with a third time period T3, a lock request for querying the status of the lock, wherein the second time period T2 is smaller than the first time period T1, and the third time period T3 is greater than or equal to the first time period T1;
- in response to determining that the lock held by the primary database has expired, determining that a lock renewal request of the primary database has not been received after the lock has expired;
- and
- in response to determining that the lock renewal request of the primary database has not been received, selecting the particular secondary database as a new primary database, and controlling the primary database to be switched to the secondary database.
A computer-implemented system for managing primary and secondary databases, comprising:
- one or more computers;
- and
- one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:
- determining that a lock held by a primary database has expired, wherein the primary database and the secondary databases share the lock, and wherein the lock is updated to extend a validity period of the lock before the validity period expires, wherein:
- the lock is updated during an update cycle having a first time period T1,
- the primary database sends, at a cycle with a second time period T2, a lock request for querying a status of the lock, and
- a particular secondary database from the secondary databases sends, at a cycle with a third time period T3, a lock request for querying the status of the lock, wherein the second time period T2 is smaller than the first time period T1, and the third time period T3 is greater than or equal to the first time period T1;
- in response to determining that the lock held by the primary database has expired, determining that a lock renewal request of the primary database has not been received after the lock has expired;
- and
- in response to determining that the lock renewal request of the primary database has not been received, selecting the particular secondary database as a new primary database, and controlling the primary database to be switched to the secondary database.
Dependencies are inferred from the claim text.