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

ddl: Remove explicit exclude for "engine" notIn "tiflash" #58637

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Dec 31, 2024

What problem does this PR solve?

Issue Number: close #58633

Problem Summary:

When creating a placement policy through tidb, tidb will create a placement-rule with "engine" notIn "tiflash" #22065
However, under tiflash disaggregated compute and storage arch, the compute node will register store with label {"engine": "tiflash_compute"}.

The logic in PD of choosing store for rule: pkg/schedule/placement/label_constraint.go @ pd

  1. If the store's label.key is equal to "engine" (or "exclusive," or starts with '$'), and the rule's constraint does not contain a rule with the same label.key, then do not schedule the peer to this store.
  2. Otherwise, further check if the rule's constraint matches the store's label. If it matches, schedule the peer to this store.

So the PD would pick tiflash compute node as target store to place the Region peer.

What changed and how does it work?

Remove the explicit exclude rule "engine" notIn "tiflash" when generating rule

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  1. Deploy a cluster with tikv and disaggregated tiflash (1 tiflash compute node and 1 tiflash storage node)
  2. Load TPC-H dataset into the cluster and create tiflash replica
  3. Create placement policy
CREATE PLACEMENT POLICY evict_sata_dw CONSTRAINTS="[-disk=sata-new, -disk=dw-ssd]" SURVIVAL_PREFERENCES="[host]";
ALTER TABLE test.region PLACEMENT POLICY=evict_sata_dw;
ALTER RANGE global PLACEMENT POLICY evict_sata_dw;
  1. Check the cluster status, no node crashes
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

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

Fix a bug that after executing `ALTER TABLE ... PLACEMENT POLICY ...` Region peers may be unexpectedly added to the TiFlash Compute Node in the disaggregated storage and compute architecture

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 31, 2024
Copy link

tiprow bot commented Dec 31, 2024

Hi @JaySon-Huang. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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.

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.8622%. Comparing base (23ed0df) to head (7ae26a6).
Report is 121 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #58637        +/-   ##
================================================
+ Coverage   73.0885%   74.8622%   +1.7737%     
================================================
  Files          1676       1721        +45     
  Lines        463646     471816      +8170     
================================================
+ Hits         338872     353212     +14340     
+ Misses       103927      96287      -7640     
- Partials      20847      22317      +1470     
Flag Coverage Δ
integration 48.7790% <100.0000%> (?)
unit 72.2763% <100.0000%> (-0.0067%) ⬇️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 61.6314% <ø> (+15.8984%) ⬆️

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jan 7, 2025
@JaySon-Huang JaySon-Huang changed the title [WIP] ddl: Remove explicit exclude for "engine" notIn "tiflash" ddl: Remove explicit exclude for "engine" notIn "tiflash" Jan 7, 2025
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-triage-completed labels Jan 7, 2025
@JaySon-Huang
Copy link
Contributor Author

/retest-required

Copy link

tiprow bot commented Jan 7, 2025

@JaySon-Huang: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest-required

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.

@JaySon-Huang JaySon-Huang force-pushed the fix_compat_placement_in_sql branch from 1523e2e to 7ae26a6 Compare January 7, 2025 09:14
@JaySon-Huang
Copy link
Contributor Author

/cc @xhebox @tangenta PTAL

@ti-chi-bot ti-chi-bot bot requested review from xhebox and tangenta January 7, 2025 09:16
Copy link

ti-chi-bot bot commented Jan 7, 2025

@JaySon-Huang: GitHub didn't allow me to request PR reviews from the following users: PTAL.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @xhebox @tangenta PTAL

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.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 9, 2025
Copy link

ti-chi-bot bot commented Jan 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tangenta, xhebox

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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 9, 2025
Copy link

ti-chi-bot bot commented Jan 9, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-01-09 03:29:14.807669068 +0000 UTC m=+410698.096500772: ☑️ agreed by xhebox.
  • 2025-01-09 06:52:01.903978784 +0000 UTC m=+422865.192810490: ☑️ agreed by tangenta.

@ti-chi-bot ti-chi-bot bot merged commit 4240ce4 into pingcap:master Jan 9, 2025
27 checks passed
@JaySon-Huang JaySon-Huang deleted the fix_compat_placement_in_sql branch January 20, 2025 06:56
@ti-chi-bot ti-chi-bot bot added 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. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. labels Jan 20, 2025
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 20, 2025
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label Jan 24, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 24, 2025
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Jan 24, 2025
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jan 24, 2025
@ti-chi-bot ti-chi-bot bot removed needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The placement-rule generated by placement-rule-in-SQL may unexpectedly add Region peer to tiflash compute node
4 participants