IP Library Granted Patent US 10,592,361
Granted Patent B2
US 10,592,361 · App. 16/394,315 · Granted Mar 17, 2020

Method, system and apparatus for managing primary and secondary databases

Inventors: Zhenkun Yang (Hangzhou, CN); Gui Huang (Hanzghou, CN)
Assignee: Alibaba Group Holding Limited
G06F11/2041G06F11/142G06F11/1458G06F11/2025G06F11/2028G06F11/2033G06F11/2043G06F16/21G06F16/2343G06F16/27
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,592,361
App. No.
16/394,315
Granted
Mar 17, 2020
Kind
B2
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.

Claims (58)

1. 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 T 1 ,

the primary database sends, at a cycle with a second time period T 2 , 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 T 3 , a lock request for querying the status of the lock, wherein the second time period T 2 is smaller than the first time period T 1 , and the third time period T 3 is greater than or equal to the first time period T 1 ;

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.

2. The computer-implemented method of claim 1 , further comprising:

sending a lock expiration notification to the particular secondary database; and

receiving a lock request from the particular secondary database based on the lock expiration notification, and recording a receiving time of the lock request.

3. The computer-implemented method of claim 2 , wherein selecting the particular secondary database comprises:

selecting one of the secondary databases with an earliest receiving time.

4. The computer-implemented method of claim 1 , wherein a priority of the primary database is higher than a priority of the particular secondary database.

5. The computer-implemented method of claim 1 , wherein the particular secondary database comprises a hot standby database and a disaster recovery database, the primary database and the hot standby database are located in a same data center, and the primary database and the disaster recovery database are located in different data centers.

6. The computer-implemented method of claim 1 , further comprising:

performing operations comprising at least one of a maintenance or an upgrade on the primary database.

7. The computer-implemented method of claim 6 , further comprising:

determining whether the operations comprising at least one of the maintenance and the upgrade on the primary database are completed; and

in response to determining that the operations comprising at least one of the maintenance and the upgrade on the primary database are completed, restoring the primary database.

8. The computer-implemented method of claim 7 , wherein after the primary database is restored, the method further comprises:

receiving a lock request sent by an original primary database, and controlling the lock to be held by the original primary database after the lock expires, wherein the original primary database is restored to the primary database, and a current primary database is restored to one of the secondary databases.

9. The computer-implemented method of claim 8 , further comprising:

continuing to determine whether a lock held by the current primary database expires; and

in response to determining that the lock held by the current primary database has expired, determining whether lock requests of the original primary database, the current primary database, and other secondary databases are received.

10. The computer-implemented method of claim 8 , further comprising:

in response to determining that the lock request of the original primary database is received, restoring the original primary database to the primary database, and restoring the current primary database to one of the secondary databases.

11. The computer-implemented method of claim 8 , further comprising:

in response to determining that the lock request of the original primary database is not received and the lock requests of the current primary database and the other secondary databases are received, maintaining the current primary database as the primary database.

12. The computer-implemented method of claim 8 , further comprising:

in response to determining that the lock requests of the original primary database and the current primary database are not received and the lock requests of the other secondary databases are received, selecting one of the other secondary databases as the primary database, and restoring the current primary database to one of the secondary databases.

13. 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 T 1 ,

the primary database sends, at a cycle with a second time period T 2 , 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 T 3 , a lock request for querying the status of the lock, wherein the second time period T 2 is smaller than the first time period T 1 , and the third time period T 3 is greater than or equal to the first time period T 1 ;

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.

14. The non-transitory, computer-readable medium of claim 13 , the operations further comprising:

sending a lock expiration notification to the particular secondary database; and

receiving a lock request from the particular secondary database based on the lock expiration notification, and recording a receiving time of the lock request.

15. The non-transitory, computer-readable medium of claim 14 , wherein selecting the particular secondary database comprises:

selecting one of the secondary databases with an earliest receiving time.

16. The non-transitory, computer-readable medium of claim 13 , wherein a priority of the primary database is higher than a priority of the particular secondary database.

17. 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 T 1 ,

the primary database sends, at a cycle with a second time period T 2 , 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 T 3 , a lock request for querying the status of the lock, wherein the second time period T 2 is smaller than the first time period T 1 , and the third time period T 3 is greater than or equal to the first time period T 1 ;

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.

18. The system of claim 17 , wherein the operations further comprise:

sending a lock expiration notification to the particular secondary database; and

receiving a lock request from the particular secondary database based on the lock expiration notification, and recording a receiving time of the lock request.

19. The system of claim 18 , wherein selecting the particular secondary database comprises:

selecting one of the secondary databases with an earliest receiving time.

20. The system of claim 17 , wherein a priority of the primary database is higher than a priority of the particular secondary database.

Assignments (5)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 27, 2021
From: ANT FINANCIAL (HANG ZHOU) NETWORK TECHNOLOGY CO., LTD.
To: BEIJING OCEANBASE TECHNOLOGY CO., LTD.
Reel/Frame 057349/0070 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 11, 2021
From: ADVANCED NEW TECHNOLOGIES CO., LTD.
To: ANT FINANCIAL (HANG ZHOU) NETWORK TECHNOLOGY CO., LTD.
Reel/Frame 055237/0137 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053754/0625 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053743/0464 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 25, 2019
From: YANG, ZHENKUN; HUANG, GUI
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 049860/0154 →
Priority Claims (1)
CN 2016 1 1183638 · Dec 20, 2016 · national
Continuity (2)
Continuation PCTCN2017115392 · Dec 11, 2017
Related Publication 20190251008A1 · Aug 15, 2019