Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for Region Label Feature #3839

Closed
23 tasks done
disksing opened this issue Jul 6, 2021 · 6 comments
Closed
23 tasks done

Tracking issue for Region Label Feature #3839

disksing opened this issue Jul 6, 2021 · 6 comments
Assignees
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@disksing
Copy link
Contributor

disksing commented Jul 6, 2021

Region Label is a system that runs inside PD and is used to identify different types of Regions, based on Region Label we can bind different behaviors to different regions.

For example, by setting labels for different tables of regions, we can control some tables from being merged.

In the first phase, we will support syncing part of the schema from TiDB to PD as region labels, and use region labels to control the behavior of region merge on top of that.

Sub tasks break up:

@disksing disksing added the type/enhancement The issue or PR belongs to an enhancement. label Jul 6, 2021
@tisonkun tisonkun changed the title Region Label Feature (Tracking issue) Tracking issue for Region Label Feature Jul 18, 2021
@tisonkun
Copy link
Contributor

Hi @disksing , thanks for creating this tracking issue. Is there a design for this feature? I'd like to know how region label feature is integrated with region merge on top of that.

@sunxiaoguang
Copy link
Member

Could you please help me to understand why region rule better than placement rule? Is it because we want to configure rules at finer granularity? Thanks.

@disksing
Copy link
Contributor Author

Hi @disksing , thanks for creating this tracking issue. Is there a design for this feature? I'd like to know how region label feature is integrated with region merge on top of that.

The detailed design is in Chinese so not linked. sorry :(

Our plan is to support binding some attributes for table (or database or partition) in SQL, and these attributes will be synchronized to PD in the form of label.

For example, if we define a special label called 'nomerge', after TiDB adds this keyword to the attribute, the label configuration will be synchronized to PD, and then in PD, we will be able to query the region label of nomerge from the region belonging to the corresponding schema. so that we can make the appropriate judgments before PD will merge two regions.

@disksing
Copy link
Contributor Author

Could you please help me to understand why region rule better than placement rule? Is it because we want to configure rules at finer granularity? Thanks.

The region label is not used to replace the placement rule, but to reinforce it.

A region label is essentially a system for categorizing the data in a cluster. By setting various rules, we can classify regions based on key range / key prefix / region size. This classification information can then be easily used by other modules to handle different types of data in a special way.

A powerful scenario for TiDB is to inject the mapping between key-range and DB schema into PD through region label configration, so that we actually have the ability to specialize the data belonging to different schemas in PD, and PD does not need to understand the concept of schema - -They just arbitrary labels for PD.

Once we have synchronized the mapping of schema and key-range to PD, we can improve the original placement rules by allowing the original key range configuration to be changed to a region label. This way the placement rule does not need to care about the key range binding of the schema, especially when the key range of the table changes, the placement rule configuration does not need to be updated. At the same time, the placement rule will be more powerful due to the diversity of region label configurations - for example, placement policy for prefixes, specialized placement policy for small regions, specialized placement policy for hot regions.

@tisonkun
Copy link
Contributor

@rleungx I can see you create several PR against this issue, which subtask they target to? We can create a subtask issue for each and let the PR close that one. As tikv/tikv#10537

@rleungx
Copy link
Member

rleungx commented Nov 29, 2021

This issue has been finished. Close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

5 participants