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: Fixed partitioning a non-partitioned table with placement rules (#57560) #57811

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #57560

What problem does this PR solve?

Issue Number: close #55705

Problem Summary:
When updating the placement rule bundle, the table ID was included both as the table and the partition id.

What changed and how does it work?

Not adding it as partition id for non-partitioned table (which uses the original table as a single partition, hence the same ID).

Also simplified the bundle handling during schema update / ApplyDiff, by removing logic that:

  • first went through all partitions and marked the partition to update the bundle, then went through all partition updates and updated its table

to

  • mark the table directly that it should update the bundle.

For REORGANIZE PARTITION, there the bundles will be updated twice, first with the intermediate set of partitions (both old and new), so that data copying and index creations on the new partitions will follow the correct policies directly, and then with the final partition set, avoiding having to move the data again when the DDL is done.

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.

fixed an issue with partitioning a non-partitioned table with placement rules.

@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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Nov 29, 2024
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 29, 2024
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 77.98165% with 24 lines in your changes missing coverage. Please review.

Please upload report for BASE (release-8.5@64ce2c0). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-8.5     #57811   +/-   ##
================================================
  Coverage               ?   56.8894%           
================================================
  Files                  ?       1770           
  Lines                  ?     626744           
  Branches               ?          0           
================================================
  Hits                   ?     356551           
  Misses                 ?     246050           
  Partials               ?      24143           
Flag Coverage Δ
integration 36.8443% <61.4678%> (?)
unit 72.5396% <77.9816%> (?)

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

Components Coverage Δ
dumpling 52.9478% <0.0000%> (?)
parser ∅ <0.0000%> (?)
br 52.2971% <0.0000%> (?)

@mjonss mjonss requested a review from wjhuang2016 November 29, 2024 03:17
@ti-chi-bot ti-chi-bot bot added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Nov 29, 2024
Copy link
Member

@bb7133 bb7133 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 29, 2024
Copy link

ti-chi-bot bot commented Nov 29, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-29 01:26:06.391415403 +0000 UTC m=+772554.011069916: ☑️ agreed by mjonss.
  • 2024-11-29 07:11:04.828294824 +0000 UTC m=+793252.447949341: ☑️ agreed by bb7133.

Copy link

ti-chi-bot bot commented Nov 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, mjonss, wjhuang2016

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 Nov 29, 2024
@mjonss
Copy link
Contributor

mjonss commented Nov 29, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit 62a1bb5 into pingcap:release-8.5 Nov 29, 2024
19 checks passed
@bb7133 bb7133 deleted the cherry-pick-57560-to-release-8.5 branch November 29, 2024 17:25
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants