Skip to content

[Resource Tag][Step1] Support setting tags for BE nodes, and support create table with specified tags#5903

Closed
morningman wants to merge 3 commits intoapache:masterfrom
morningman:mulit-tag
Closed

[Resource Tag][Step1] Support setting tags for BE nodes, and support create table with specified tags#5903
morningman wants to merge 3 commits intoapache:masterfrom
morningman:mulit-tag

Conversation

@morningman
Copy link
Contributor

Proposed changes

Step 1 of #5902
This CL mainly changes:

  1. Support setting tags for BE nodes:

    alter system add backend "1272:9050, 1212:9050" properties("tag.location": "zoneA");
    alter system modify backend "1272:9050, 1212:9050" set ("tag.location": "zoneB");
    

    And for compatibility, all BE nodes will be set a "default" tag: "tag.location": "default".

  2. Create a new class ReplicaAllocation to replace the previous replication_num.

    ReplicaAllocation represents the allocation of the replicas of a tablet. It contains a map from
    Tag to number of replicas.
    For example, if user set a table's replication num to 3, it will be converted to a ReplicaAllocation
    like: "tag.location.default" : "3", which means the tablet will have 3 replicas and all of them will be
    allocated in BE nodes with tag "default";

  3. Support create table with replication allocation:

    CREATE TABLE example_db.table_hash
    (
    k1 TINYINT
    )
    DISTRIBUTED BY HASH(k1) BUCKETS 32
    PROPERTIES (
        "replication_allocation"="tag.location.zone1:1, tag.location.zone1:2"
    );
    

    Also support set replica allocation for dynamic tables, and modify replica allocation at runtime.

    For compatibility, user can still set "replication_num" = "3", and it will be automatically converted to:
    "tag.location.default" = "3".

Types of changes

What types of changes does your code introduce to Doris?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Code refactor (Modify the code structure, format the code, etc...)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail
  • Compiling and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • If these changes need document changes, I have updated the document
  • Any dependent changes have been merged

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@morningman morningman added kind/feature Categorizes issue or PR as related to a new feature. kind/meta-version-change Categorizes issue or PR as related to changing meta version labels May 25, 2021
@morningman morningman marked this pull request as draft May 26, 2021 01:55
@morningman morningman marked this pull request as ready for review June 10, 2021 09:27
@morningman morningman force-pushed the mulit-tag branch 3 times, most recently from 4002c33 to 6934847 Compare June 29, 2021 15:38
@morningman
Copy link
Contributor Author

This PR is covered by #6203

@morningman morningman closed this Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. kind/meta-version-change Categorizes issue or PR as related to changing meta version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants