Skip to content

Conversation

mjonss
Copy link
Contributor

@mjonss mjonss commented Feb 18, 2025

What problem does this PR solve?

Issue Number: close #59534

Problem Summary:
The validation for RANGE COLUMNS partitioned tables in EXCHANGE PARTITION only checked the first column.

What changed and how does it work?

Extended the implementation for multiple columns and added tests to verify the validation.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • 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.

`ALTER TABLE pt EXCHANGE PARTITION p1 WITH TABLE npt` for RANGE COLUMNS partitioned tables, only checked the first partitioning column, now fixed to handle the full list in PARTITION BY RANGE COLUMNS (c1,c2,c3,...)

@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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 18, 2025
Copy link

tiprow bot commented Feb 18, 2025

Hi @mjonss. 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 Feb 18, 2025

Codecov Report

Attention: Patch coverage is 92.10526% with 6 lines in your changes missing coverage. Please review.

Project coverage is 74.9588%. Comparing base (fea442b) to head (f5c0015).
Report is 220 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #59612        +/-   ##
================================================
+ Coverage   72.9712%   74.9588%   +1.9876%     
================================================
  Files          1699       1745        +46     
  Lines        469334     478593      +9259     
================================================
+ Hits         342479     358748     +16269     
+ Misses       105754      97333      -8421     
- Partials      21101      22512      +1411     
Flag Coverage Δ
integration 48.9252% <30.2631%> (?)
unit 72.6199% <92.1052%> (+0.1564%) ⬆️

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

Components Coverage Δ
dumpling ∅ <ø> (∅)
parser ∅ <ø> (∅)
br 62.3937% <ø> (+15.9723%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Feb 25, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • pkg/ddl/tests/partition/BUILD.bazel: Language not supported
Comments suppressed due to low confidence (4)

pkg/ddl/partition.go:4353

  • Ensure that the handling of MAXVALUE in the first partition is covered by tests.
// TODO: Handle MAXVALUE in first partition

pkg/ddl/partition.go:4482

  • Verify the correctness of the logic for list columns partition and ensure it is covered by tests.
// TODO: Verify if this is correct!!!

pkg/ddl/partition.go:4483

  • Ensure that the handling of DEFAULT partition is covered by tests.
// TODO: Handle DEFAULT partition!

pkg/ddl/partition.go:4484

  • Verify the usage of paramList with column names and ensure it is covered by tests.
// TODO: use paramList with column names, instead of quoting.

Copy link
Contributor

@Defined2014 Defined2014 left a comment

Choose a reason for hiding this comment

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

TestMultiSchemaPartitionByGlobalIndex test failed

@mjonss
Copy link
Contributor Author

mjonss commented Feb 26, 2025

/retest

Copy link

tiprow bot commented Feb 26, 2025

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

In response to this:

/retest

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.

@mjonss
Copy link
Contributor Author

mjonss commented Feb 26, 2025

/retest

Copy link

tiprow bot commented Feb 26, 2025

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

In response to this:

/retest

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.

@mjonss mjonss requested a review from wjhuang2016 February 27, 2025 00:03
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 27, 2025
@Defined2014 Defined2014 requested a review from tangenta February 27, 2025 02:05
Copy link

ti-chi-bot bot commented Feb 28, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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 28, 2025
Copy link

ti-chi-bot bot commented Feb 28, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-27 02:05:04.946224327 +0000 UTC m=+494252.899382588: ☑️ agreed by Defined2014.
  • 2025-02-28 03:39:20.272947161 +0000 UTC m=+586308.226105424: ☑️ agreed by tangenta.

@ti-chi-bot ti-chi-bot bot merged commit d392685 into pingcap:master Feb 28, 2025
27 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #59837.
But this PR has conflicts, please resolve them!

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

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

@mjonss mjonss deleted the multi-column-partition-exchange-59534 branch April 15, 2025 11:51
ti-chi-bot bot pushed a commit that referenced this pull request Apr 15, 2025
zeminzhou pushed a commit to zeminzhou/tidb that referenced this pull request May 6, 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.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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

exchange partition incorrectly report Found a row that does not match the partition
4 participants