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

disagg: Add exclusive label for tiflash compute node #9849

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Feb 7, 2025

What problem does this PR solve?

Issue Number: close #9750

Problem Summary:

When creating a placement policy through tidb, tidb will create a placement-rule with "engine" notIn "tiflash" pingcap/tidb#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 is changed and how it works?

Add a label with {"exclusive": "no-data"}, so that PD won't select TiFlash compute node stores for placing Region

We avoid Region data being placed to TiFlash compute node in 2 ways:

Check List

Tests

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

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

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 do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. labels Feb 7, 2025
@JaySon-Huang
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 7, 2025
@JaySon-Huang JaySon-Huang changed the title disagg: Add exclusive label for tiflash compute node [DNM] disagg: Add exclusive label for tiflash compute node Feb 7, 2025
@JaySon-Huang
Copy link
Contributor Author

Depends on pingcap/tidb-engine-ext#420

@JaySon-Huang JaySon-Huang changed the title [DNM] disagg: Add exclusive label for tiflash compute node disagg: Add exclusive label for tiflash compute node Feb 10, 2025
@JaySon-Huang
Copy link
Contributor Author

/test pull-integration-test

@JaySon-Huang
Copy link
Contributor Author

/unhold

The proxy change has been merged

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 10, 2025
@JaySon-Huang
Copy link
Contributor Author

@CalvinNeo @Lloyd-Pottiger @JinheLin PTAL

Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 10, 2025
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 11, 2025
Copy link
Contributor

ti-chi-bot bot commented Feb 11, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-10 09:42:26.195747943 +0000 UTC m=+263188.591970004: ☑️ agreed by CalvinNeo.
  • 2025-02-11 03:02:02.804762517 +0000 UTC m=+325565.200984579: ☑️ agreed by Lloyd-Pottiger.

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 11, 2025
@JaySon-Huang
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 11, 2025
Signed-off-by: JaySon-Huang <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 11, 2025
Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

ti-chi-bot bot commented Feb 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CalvinNeo, Lloyd-Pottiger

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:
  • OWNERS [CalvinNeo,Lloyd-Pottiger]

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

@JaySon-Huang
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot 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. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Feb 11, 2025
@ti-chi-bot ti-chi-bot bot merged commit 7694684 into pingcap:master Feb 11, 2025
5 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: failed to apply #9849 on top of branch "release-7.5":

[failed to git add conflicting files: exit status 128, failed to git commit: exit status 128]

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: failed to apply #9849 on top of branch "release-8.1":

[failed to git add conflicting files: exit status 128, failed to git commit: exit status 128]

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: failed to apply #9849 on top of branch "release-8.5":

[failed to git add conflicting files: exit status 128, failed to git commit: exit status 128]

@JaySon-Huang JaySon-Huang deleted the add_cn_exclusive branch February 11, 2025 06:42
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiFlash compute node crashes after executing ALTER RANGE in TiDB
4 participants