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

parser: support pre-split global index add special comment support for pre_split index option #58408

Merged
merged 5 commits into from
Dec 23, 2024

Conversation

tangenta
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #57552, ref #57551

Problem Summary:

Wrap the pre_split index option with the special comment to avoid TiCDC failing to sync downstream.

What changed and how does it work?

See code changes.

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.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 19, 2024
Copy link

tiprow bot commented Dec 19, 2024

Hi @tangenta. 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 19, 2024

Codecov Report

Attention: Patch coverage is 30.00000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 74.9054%. Comparing base (1fa2955) to head (2041a7d).
Report is 26 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #58408        +/-   ##
================================================
+ Coverage   73.1670%   74.9054%   +1.7384%     
================================================
  Files          1680       1726        +46     
  Lines        463042     474904     +11862     
================================================
+ Hits         338794     355729     +16935     
+ Misses       103444      96909      -6535     
- Partials      20804      22266      +1462     
Flag Coverage Δ
integration 49.2462% <0.0000%> (?)
unit 72.3717% <30.0000%> (+0.0711%) ⬆️

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

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

@tangenta
Copy link
Contributor Author

/approve

@ti-chi-bot ti-chi-bot bot added the approved label Dec 19, 2024
@tangenta tangenta added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 19, 2024
@tangenta
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Dec 20, 2024

@tangenta: 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.

@tangenta tangenta removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 20, 2024
@tangenta tangenta requested a review from D3Hunter December 20, 2024 08:20
@D3Hunter D3Hunter changed the title parser: add special comment support for pre_split index option parser: support pre-split global index add special comment support for pre_split index option Dec 20, 2024
Copy link
Contributor

@D3Hunter D3Hunter left a comment

Choose a reason for hiding this comment

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

rest lgtm

pkg/parser/ast/ddl.go Outdated Show resolved Hide resolved
tk.MustExec("create table t (a int, b int) partition by range (b)" +
" (partition p0 values less than (10), " +
" partition p1 values less than (maxvalue));")
tk.MustExec("alter table t add unique index p_a (a) global pre_split_regions = (by (5), (15));")
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use comments to specify the option to check that it works

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 23, 2024
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 23, 2024
@@ -120,6 +118,17 @@ func getSplitIdxKeysFromValueList(
return getSplitIdxPhysicalKeysFromValueList(sctx, tblInfo, idxInfo, tblInfo.ID, byRows, destKeys)
}

if idxInfo.Global {
var idxTblID int64
if pi.NewTableID != 0 && idxInfo.State != model.StatePublic {
Copy link
Member

Choose a reason for hiding this comment

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

Please add comment for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used in reorg partition. Since we don't support pre_split option in reorg partition, let's remove this.

Copy link

ti-chi-bot bot commented Dec 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, tangenta, 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 23, 2024
Copy link

ti-chi-bot bot commented Dec 23, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-23 02:48:53.246419032 +0000 UTC m=+1443523.335221570: ☑️ agreed by D3Hunter.
  • 2024-12-23 04:38:03.762540596 +0000 UTC m=+1450073.851343139: ☑️ agreed by wjhuang2016.

Copy link

tiprow bot commented Dec 23, 2024

@tangenta: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
fast_test_tiprow 2041a7d link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot merged commit 3735ed5 into pingcap:master Dec 23, 2024
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. 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.

3 participants