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) #59040

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #58637

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 added 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. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR. labels Jan 20, 2025
Signed-off-by: JaySon-Huang <[email protected]>
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (release-7.5@1c32d6b). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-7.5     #59040   +/-   ##
================================================
  Coverage               ?   72.5510%           
================================================
  Files                  ?       1417           
  Lines                  ?     416919           
  Branches               ?          0           
================================================
  Hits                   ?     302479           
  Misses                 ?      94542           
  Partials               ?      19898           
Flag Coverage Δ
unit 72.5510% <100.0000%> (?)

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

Components Coverage Δ
dumpling 52.9400% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 53.6168% <0.0000%> (?)

@JaySon-Huang
Copy link
Contributor

@tangenta @xhebox PTAL

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

ti-chi-bot bot commented Feb 20, 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 Feb 20, 2025
Copy link

ti-chi-bot bot commented Feb 20, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-10 01:43:15.485801539 +0000 UTC m=+234437.882023586: ☑️ agreed by xhebox.
  • 2025-02-20 03:08:07.61807109 +0000 UTC m=+1103530.014293152: ☑️ agreed by tangenta.

@JaySon-Huang
Copy link
Contributor

/test unit-test

Copy link

tiprow bot commented Feb 21, 2025

@JaySon-Huang: No presubmit jobs available for pingcap/[email protected]

In response to this:

/test unit-test

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 merged commit 0b4f966 into pingcap:release-7.5 Feb 21, 2025
18 checks passed
@JaySon-Huang JaySon-Huang deleted the cherry-pick-58637-to-release-7.5 branch February 21, 2025 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cherry-pick-approved Cherry pick PR approved by release team. lgtm 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. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants