IP Library Granted Patent US 11,860,833
Granted Patent B2
US 11,860,833 · App. 17/370,275 · Granted Jan 2, 2024

Data redistribution method, apparatus, and system

Inventor: Qiang Tong (Beijing, CN)
Assignee: HUAWEI CLOUD COMPUTING TECHNOLOGIES CO., LTD.
G06F16/214G06F11/1451G06F16/128G06F16/164G06F16/2272G06F16/24544G06F16/278H04L9/088H04L9/3236
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 11,860,833
App. No.
17/370,275
Granted
Jan 2, 2024
Kind
B2
Abstract

A method includes determining a first node set and a second node set that are in a distributed database and that are separately associated with a first data table, where data in the first data table is stored in the first node set, migrating the data from the first node set to the second node set, receiving, in a process of migrating the data, a target service request for the first data table, determining, in response to the target service request, a third node set in the first node set and the second node set that is configured to respond to the target service request, and sending the target service request to a first data node in the third node set.

Claims (57)

1. A method, comprising:

storing first data associated with a first data table in a first node set in a distributed database;

filtering, before migration, the first data in the first node set to obtain second data that is associated with the first data table and that is not stored in a second node set in the distributed;

migrating the second data that is associated with the first data table from the first node set to the second node set in the distributed database by:

selecting, from unmigrated data in the first data table that corresponds to a currently executed distributed transaction, third data that meets a migration condition; and

migrating the third data from the first node set to the second node set, wherein the third data is locked in a migration process, and wherein the migration condition comprises either an amount of the third data that is migrated through the currently executed distributed transaction is less than or equal to a specified threshold of the amount of the third data or a migration duration of migration through the currently executed distributed transaction is less than or equal to a specified duration threshold;

receiving, in a process of migrating the second data, a target service request for the first data table;

obtaining, in response to the target service request, a third node set that is configured to respond to the target service request, wherein the third node set comprises at least a first portion of the first data in the first node set and at least a second portion of the second data in the second node set, and wherein the third node set comprises a first data node; and

sending the target service request to the first data node in the third node set to instruct the first data node to respond to the target service request.

2. The method of claim 1 , wherein the target service request is a data addition request, and wherein the third node set is configured to respond to the data addition request.

3. The method of claim 2 , further comprising:

calculating a hash value based on a key value of newly-added data carried in the data addition request; and

obtaining, in the second node set, a second data node corresponding to the hash value,

wherein the second data node belongs to the third node set.

4. The method of claim 1 , wherein the target service request is a data deletion request, a data modification request, or a data query request associated with the first data table, wherein obtaining the third node set comprises:

obtaining, in the first node set, a second data node configured to respond to the target service request; and

obtaining, in the second node set, a third data node configured to respond to the target service request, and

wherein the second data node and the third data node form the third node set.

5. The method of claim 1 , further comprising:

obtaining a first mapping relationship between the first data and a second data node in the first node set;

obtaining a second mapping relationship between the second data and a third data node in the second node set; and

obtaining target data on the second data node as the second data when the second data node and the third data node are different.

6. The method of claim 1 , further comprising rolling back data that has been migrated through the currently executed distributed transaction when a rollback trigger event is detected.

7. The method of claim 1 , further comprising setting a deletion flag for migrated data in the first node set in the first data table.

8. An apparatus, comprising:

a memory configured to store instructions; and

one or more processors coupled to the memory and configured to execute the instructions to cause the apparatus to be configured to:

store first data associated with a first data table in a first node set in a distributed database;

filter, before migration, the first data in the first node set to obtain second data that is associated with the first data table and that is not stored in a second node set in the distributed database;

migrate the second data that is associated with the first data table from the first node set to the second node set in the distributed database by:

selecting, from unmigrated data in the first data table that corresponds to a currently executed distributed transaction, third data that meets a migration condition; and

migrating the third data from the first node set to the second node set, wherein the third data is locked in a migration process, and wherein the migration condition comprises either an amount of the third data that is migrated through the currently executed distributed transaction is less than or equal to a specified threshold of the amount of the third data or a migration duration of migration through the currently executed distributed transaction is less than or equal to a specified duration threshold;

receive, in a process of migrating the second data, a target service request for the first data table;

obtain, in response to the target service request, a third node set that is configured to respond to the target service request, wherein the third node set comprises at least a first portion of the first data in the first node set and at least a second portion of the second data in the second node set, and wherein the third node set comprises a first data node; and

send the target service request to the first data node in the third node set to instruct the first data node to respond to the target service request.

9. The apparatus of claim 8 , wherein the target service request is a data addition request, and wherein the third node set is configured to respond to the data addition request.

10. The apparatus of claim 9 , wherein the one or more processors are further configured to execute the instructions to cause the apparatus to be configured to:

calculate a hash value based on a key value of newly-added data carried in the data addition request; and

obtain, in the second node set, a second data node corresponding to the hash value,

wherein the second data node belongs to the third node set.

11. The apparatus of claim 8 , wherein the target service request is a data deletion request, a data modification request, or a data query request associated with the first data table, wherein the one or more processors are further configured to execute the instructions to cause the apparatus to be configured to:

obtain, in the first node set, a second data node configured to respond to the target service request; and

obtain, in the second node set, a third data node configured to respond to the target service request, and

wherein the second data node and the third data node form the third node set.

12. The apparatus of claim 8 , wherein the one or more processors are further configured to:

obtain a first mapping relationship between the first data and a second data node in the first node set;

obtain a second mapping relationship between the second data and a third data node in the second node set; and

obtain target data on the second data node as the second data when the second data node and the third data node are different.

13. A computer program product comprising instructions stored on a non-transitory computer-readable medium that, when executed by one or more processors, cause an apparatus to:

store first data associated with a first data table in a first node set in a distributed database;

filter, before migration, the first data in the first node set to obtain second data that is associated with the first data table and that is not stored in a second node set in the distributed database;

migrate the second data that is associated with the first data table from the first node set to the second node set in the distributed database by:

selecting, from unmigrated data in the first data table that corresponds to a currently executed distributed transaction, third data that meets a migration condition; and

migrating the third data from the first node set to the second node set, wherein the third data is locked in a migration process, and wherein the migration condition comprises either an amount of the third data that is migrated through the currently executed distributed transaction is less than or equal to a specified threshold of the amount of the third data or a migration duration of migration through the currently executed distributed transaction is less than or equal to a specified duration threshold;

receive, in a process of migrating the second data, a target service request for the first data table;

obtain, in response to the target service request, a third node set that is configured to respond to the target service request, wherein the third node set comprises at least a first portion of the first data in the first node set and at least a second portion of the second data in the second node set, and wherein the third node set comprises a first data node; and

send the target service request to the first data node in the third node set to instruct the first data node to respond to the target service request.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 1, 2022
From: HUAWEI TECHNOLOGIES CO., LTD.
To: HUAWEI CLOUD COMPUTING TECHNOLOGIES CO., LTD.
Reel/Frame 059267/0088 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 8, 2021
From: TONG, QIANG
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 056791/0763 →
Continuity (2)
Continuation PCTCN2019105357 · Sep 11, 2019
Related Publication 20210334252A1 · Oct 28, 2021