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

placement_rule: supports show origin placement rules #46750

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

HuSharp
Copy link
Contributor

@HuSharp HuSharp commented Sep 7, 2023

What problem does this PR solve?

Issue Number: close #46617

Problem Summary:

mysql> use test;
mysql> CREATE PLACEMENT POLICY follower3 FOLLOWERS=3;
mysql> CREATE PLACEMENT POLICY follower5 FOLLOWERS=5;

mysql> CREATE TABLE t1 (
  country VARCHAR(10) NOT NULL,
  userdata VARCHAR(100) NOT NULL
) PLACEMENT POLICY=follower3 PARTITION BY LIST COLUMNS (country) (
PARTITION A VALUES IN ('DE', 'FR', 'GB') PLACEMENT POLICY=follower5,
PARTITION B VALUES IN ('M')
);

mysql> SHOW PLACEMENT format = raw\G;
*************************** 1. row ***************************
          Target: POLICY follower3
       Placement: FOLLOWERS=3
Scheduling_State: NULL
*************************** 2. row ***************************
          Target: POLICY follower5
       Placement: FOLLOWERS=5
Scheduling_State: NULL
*************************** 3. row ***************************
          Target: Rule pd
       Placement:
{
    "group_id": "pd",
    "group_index": 0,
    "group_override": false,
    "rules": [
        {
            "group_id": "pd",
            "id": "default",
            "start_key": "",
            "end_key": "",
            "role": "voter",
            "count": 3
        }
    ]
}

Scheduling_State: NULL
*************************** 4. row ***************************
          Target: Rule TiDB_DDL_104
       Placement:
{
    "group_id": "TiDB_DDL_104",
    "group_index": 40,
    "group_override": true,
    "rules": [
        {
            "group_id": "TiDB_DDL_104",
            "id": "table_rule_104_0",
            "index": 40,
            "start_key": "7480000000000000ff6800000000000000f8",
            "end_key": "7480000000000000ff6900000000000000f8",
            "role": "voter",
            "count": 4,
            "label_constraints": [
                {
                    "key": "engine",
                    "op": "notIn",
                    "values": [
                        "tiflash"
                    ]
                }
            ]
        },
        {
            "group_id": "TiDB_DDL_104",
            "id": "partition_rule_105_0",
            "index": 80,
            "start_key": "7480000000000000ff6900000000000000f8",
            "end_key": "7480000000000000ff6a00000000000000f8",
            "role": "voter",
            "count": 4,
            "label_constraints": [
                {
                    "key": "engine",
                    "op": "notIn",
                    "values": [
                        "tiflash"
                    ]
                }
            ]
        },
        {
            "group_id": "TiDB_DDL_104",
            "id": "partition_rule_106_0",
            "index": 80,
            "start_key": "7480000000000000ff6a00000000000000f8",
            "end_key": "7480000000000000ff6b00000000000000f8",
            "role": "voter",
            "count": 4,
            "label_constraints": [
                {
                    "key": "engine",
                    "op": "notIn",
                    "values": [
                        "tiflash"
                    ]
                }
            ]
        }
    ]
}

Scheduling_State: NULL
*************************** 5. row ***************************
          Target: Rule TiDB_DDL_105
       Placement:
{
    "group_id": "TiDB_DDL_105",
    "group_index": 80,
    "group_override": true,
    "rules": [
        {
            "group_id": "TiDB_DDL_105",
            "id": "partition_rule_105_0",
            "index": 40,
            "start_key": "7480000000000000ff6900000000000000f8",
            "end_key": "7480000000000000ff6a00000000000000f8",
            "role": "voter",
            "count": 6,
            "label_constraints": [
                {
                    "key": "engine",
                    "op": "notIn",
                    "values": [
                        "tiflash"
                    ]
                }
            ]
        }
    ]
}

Scheduling_State: NULL
*************************** 6. row ***************************
          Target: Rule tiflash
       Placement:
{
    "group_id": "tiflash",
    "group_index": 120,
    "group_override": false,
    "rules": null
}

Scheduling_State: NULL
6 rows in set (0.00 sec)

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 7, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-tests-checked size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 7, 2023
@tiprow
Copy link

tiprow bot commented Sep 7, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 8, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 8, 2023

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

executor/builder.go Outdated Show resolved Hide resolved
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@nolouch
Copy link
Member

nolouch commented Oct 16, 2023

@HuSharp plz resolve conflicts and make it reviewable.

Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp marked this pull request as ready for review October 17, 2023 03:34
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 17, 2023
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Attention: Patch coverage is 2.94118% with 66 lines in your changes missing coverage. Please review.

Project coverage is 71.6826%. Comparing base (ce9e9ef) to head (cebac63).
Report is 2447 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #46750        +/-   ##
================================================
+ Coverage   71.0497%   71.6826%   +0.6328%     
================================================
  Files          1368       1414        +46     
  Lines        401707     416758     +15051     
================================================
+ Hits         285412     298743     +13331     
- Misses        96439      99168      +2729     
+ Partials      19856      18847      -1009     
Flag Coverage Δ
integration 43.6283% <2.9411%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9663% <ø> (ø)
parser ∅ <ø> (∅)
br 47.8567% <ø> (-5.0368%) ⬇️

Signed-off-by: husharp <jinhao.hu@pingcap.com>
Copy link
Member

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall lgtm. plz add some tests

@nolouch
Copy link
Member

nolouch commented Oct 19, 2023

/retest-required

@ti-chi-bot ti-chi-bot bot added the component/dumpling This is related to Dumpling of TiDB. label Dec 12, 2023
@HuSharp HuSharp marked this pull request as draft December 12, 2023 10:02
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 12, 2023
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
@HuSharp HuSharp marked this pull request as ready for review December 12, 2023 10:15
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 12, 2023
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Signed-off-by: husharp <jinhao.hu@pingcap.com>
Copy link

ti-chi-bot bot commented Dec 13, 2023

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/needs-tests-checked label, please finished the tests then check the finished items in description.

For example:

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

📖 For more info, you can check the "Contribute Code" section in the development guide.

Copy link

ti-chi-bot bot commented Dec 27, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nolouch
Once this PR has been reviewed and has the lgtm label, please assign bornchanger, d3hunter, tangenta, yudongusa for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 27, 2023
Copy link

ti-chi-bot bot commented Dec 27, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-12-27 07:52:48.708768002 +0000 UTC m=+1638659.745994926: ☑️ agreed by nolouch.

@nolouch
Copy link
Member

nolouch commented Dec 27, 2023

/retest-required t

Copy link

ti-chi-bot bot commented Oct 12, 2024

@HuSharp: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/build cebac63 link true /test build
pull-mysql-client-test cebac63 link true /test pull-mysql-client-test
idc-jenkins-ci-tidb/check_dev cebac63 link true /test check-dev
idc-jenkins-ci-tidb/check_dev_2 cebac63 link true /test check-dev2
idc-jenkins-ci-tidb/mysql-test cebac63 link true /test mysql-test
idc-jenkins-ci-tidb/unit-test cebac63 link true /test unit-test
pull-integration-ddl-test cebac63 link true /test pull-integration-ddl-test
pull-br-integration-test cebac63 link true /test pull-br-integration-test
pull-lightning-integration-test cebac63 link true /test pull-lightning-integration-test
pull-unit-test-ddlv1 cebac63 link true /test pull-unit-test-ddlv1

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/dumpling This is related to Dumpling of TiDB. do-not-merge/needs-tests-checked needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supports show origin placement rules
2 participants