Skip to content

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Aug 26, 2025

First-time contributors' checklist

What is changed, added or deleted? (Required)

According to the discussion with @JmPotato , the current implementation of LOCATION LABELS is not correct and may acts does not meet the user want. Fixing the behavior requires manpower, and there is currently no plan or demand from users. So just add warnings about it.

For example, if the user set LOCATION LABELS with the similar string as placement-rule-in-SQL does: https://docs.pingcap.com/zh/tidb/stable/placement-rules-in-sql/#%E6%8C%87%E5%AE%9A%E7%94%9F%E5%AD%98%E5%81%8F%E5%A5%BD

alter table t set tiflash replica 2 LOCATION LABELS "[region, zone, host]"

then the generated placement-rule in PD is

  {
    "group_id": "tiflash",
    ...
    "start_key": "748000000000055fff795f720000000000fa",
    "end_key": "748000000000055fff7a00000000000000f8",
    "role": "learner",
    "count": 2,
    "label_constraints": [
      {
        "key": "engine",
        "op": "in",
        "values": ["tiflash"]
      }
    ],
    "location_labels": [
      "[region, zone, host]"
    ],
  }

but not

  {
    "group_id": "tiflash",
    ...
    "start_key": "748000000000055fff795f720000000000fa",
    "end_key": "748000000000055fff7a00000000000000f8",
    "role": "learner",
    "count": 2,
    "label_constraints": [
      {
        "key": "engine",
        "op": "in",
        "values": ["tiflash"]
      }
    ],
    "location_labels": [
      "region",
      "zone",
      "host"
    ],
  }

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 26, 2025
@JaySon-Huang
Copy link
Contributor Author

/cc @JmPotato @joey-yez

@ti-chi-bot ti-chi-bot bot requested review from JmPotato and joey-yez August 26, 2025 07:49
@JaySon-Huang JaySon-Huang changed the title Add warnings about LOCATION LABELS on ALTER TABLE ... SET TIFLASH REPLICA tiflash: Add warnings about LOCATION LABELS on ALTER TABLE ... SET TIFLASH REPLICA Aug 26, 2025
Signed-off-by: JaySon-Huang <[email protected]>
Copy link

ti-chi-bot bot commented Aug 27, 2025

@JmPotato: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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-sigs/prow repository.

@hfxsd hfxsd self-requested a review August 27, 2025 08:39
@hfxsd hfxsd added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed missing-translation-status This PR does not have translation status info. labels Aug 27, 2025
@hfxsd hfxsd self-assigned this Aug 27, 2025
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 29, 2025
Copy link

ti-chi-bot bot commented Aug 29, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-08-29 03:49:06.828816601 +0000 UTC m=+498438.706647545: ☑️ agreed by hfxsd.

Signed-off-by: JaySon-Huang <[email protected]>
@hfxsd hfxsd added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. labels Sep 1, 2025
Copy link

ti-chi-bot bot commented Sep 1, 2025

@joey-yez: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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-sigs/prow repository.

@hfxsd hfxsd added the lgtm label Sep 1, 2025
@hfxsd
Copy link
Collaborator

hfxsd commented Sep 1, 2025

/approve

Copy link

ti-chi-bot bot commented Sep 1, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hfxsd

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

The pull request process is described 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 approved label Sep 1, 2025
@ti-chi-bot ti-chi-bot bot merged commit e8ced09 into pingcap:master Sep 1, 2025
7 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #20848.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #20849.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #20850.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-1-more-lgtm Indicates a PR needs 1 more LGTM. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants