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

table, executor: let SplitIndexValue work with clustered index table. #53254

Merged
merged 6 commits into from
May 16, 2024

Conversation

Defined2014
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #49995

Problem Summary: Ref PR #50013, remove insert on duplicate part. /cc @L-maple

What changed and how does it work?

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 do-not-merge/needs-triage-completed release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 14, 2024
Copy link

tiprow bot commented May 14, 2024

Hi @Defined2014. 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.

@Defined2014
Copy link
Contributor Author

/run-check-issue-triage-complete

Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 86.95652% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 75.0451%. Comparing base (a2037fe) to head (abd336d).
Report is 27 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53254        +/-   ##
================================================
+ Coverage   72.4460%   75.0451%   +2.5990%     
================================================
  Files          1493       1499         +6     
  Lines        429361     437121      +7760     
================================================
+ Hits         311055     328038     +16983     
+ Misses        99031      88975     -10056     
- Partials      19275      20108       +833     
Flag Coverage Δ
integration 49.4781% <86.9565%> (?)
unit 71.4707% <82.6087%> (+0.1284%) ⬆️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.4343% <ø> (+9.0041%) ⬆️

@Defined2014
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented May 14, 2024

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

@Defined2014
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented May 14, 2024

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

@Defined2014 Defined2014 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 15, 2024
@@ -412,15 +412,12 @@ func (c *index) Delete(ctx table.MutateContext, txn kv.Transaction, indexedValue
// Only when pid in value equals to c.physicalID, the key can be deleted.
if c.idxInfo.Global {
Copy link
Contributor

Choose a reason for hiding this comment

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

L413~L425 are useless now, which can be deleted. ref: #52442

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thx.

}

// splitIndexValueForIndexValueVersion0 splits index value into segments.
func splitIndexValueForIndexValueVersion0(value []byte) (segs IndexValueSegments) {
Copy link
Contributor

Choose a reason for hiding this comment

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

not get the name splitIndexValueForIndexValueVersion0 logic behind? this is a extensible index value format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See

// +-- IndexValueVersion0 (with restore data, or common handle, or index is global)
, we have three different index value types.

Copy link
Contributor

Choose a reason for hiding this comment

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

okok

@L-maple
Copy link
Contributor

L-maple commented May 15, 2024

SplitIndexValue is really nice as a facade, thumb up for you @Defined2014

Copy link
Contributor

@mjonss mjonss left a comment

Choose a reason for hiding this comment

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

LGTM, with some questions:

  • So the default of creating a partitioned table with a global index, will still be non-clustered?
  • Should we also create a PR for supporting clustered tables for DDL, which seems to be disabled here?

@mjonss
Copy link
Contributor

mjonss commented May 15, 2024

/retest

Copy link

tiprow bot commented May 15, 2024

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

@Defined2014
Copy link
Contributor Author

Defined2014 commented May 15, 2024

  • So the default of creating a partitioned table with a global index, will still be non-clustered?

The problem is we run set @@tidb_enable_clustered_index='int_only' in mysql-tester, link

Should we also create a PR for supporting clustered tables for DDL, which seems to be disabled here?

This line means we couldn't create an index is global and also is a clustered primary key. Because the table id of a clustered index key should equals to partition id. But if table has a clustered index and want to add an global index, it's ok. I think this line wants to make error message more cleaner.

@mjonss

@Defined2014 Defined2014 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 16, 2024
Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@Defined2014
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented May 16, 2024

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

Copy link

ti-chi-bot bot commented May 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mjonss, zimulala

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

Copy link

ti-chi-bot bot commented May 16, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-16 04:00:23.784201274 +0000 UTC m=+1712177.541336844: ☑️ agreed by zimulala.
  • 2024-05-16 08:16:07.547252836 +0000 UTC m=+1727521.304388410: ☑️ agreed by mjonss.

@Defined2014
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented May 16, 2024

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

@ti-chi-bot ti-chi-bot bot merged commit 2809439 into pingcap:master May 16, 2024
23 checks passed
terry1purcell pushed a commit to terry1purcell/tidb that referenced this pull request May 17, 2024
RidRisR pushed a commit to RidRisR/tidb that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none 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.

executor: global index point get meets err for clustered index table
4 participants