Skip to content

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #47818

What problem does this PR solve?

Issue Number: close #46306

Problem Summary:
Ref: #45679. Before this PR(#45679 ), we used [startKey, endKey] with endInclude as the table range. After this PR we used [startKey, endKey.next).
We do "add index" on a branch without #45679, then get startKey and endKey with the range [startKey, endKey].
Then we do upgrade, we will continue to "add index" in the branch with #45679. And we use [startKey, endKey).

What is changed and how it works?

If the old version upgrades to the new version, we add Next to the endKey.

Check List

Tests

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

deploy v7.1.1+ cluster
set @@global.tidb_ddl_enable_fast_reorg = 0;
Create a table and import 3.5 million rows.

Do alter table t add index idx(a, b);, and when it backfills 700,000+ indexes, kill the cluster.
Then upgrade this cluster to master.
After upgrading successfully, do admin check index t idx

Result:

  • Before this PR, we will get an error like ERROR 8223 (HY000): data inconsistency in table: t, index: idx, handle: 3572562, index-values:"" != record-values:"handle: 3572562, values: [KindString 131 KindString xxx]"
  • After this PR, we get Query OK.
  • 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 added 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. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR. labels Oct 20, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 20, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tammyxia for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 added the cherry-pick-approved Cherry pick PR approved by release team. label Oct 23, 2023
@zimulala zimulala added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 23, 2023
@zimulala
Copy link
Contributor

This PR will lead to an issue #47912. So don't merge it to this branch

@zimulala zimulala closed this Oct 23, 2023
@zimulala zimulala removed the cherry-pick-approved Cherry pick PR approved by release team. label Oct 23, 2023
@ti-chi-bot ti-chi-bot removed the cherry-pick-approved Cherry pick PR approved by release team. label Oct 23, 2023
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Oct 23, 2023
@ti-chi-bot ti-chi-bot deleted the cherry-pick-47818-to-release-7.5 branch April 15, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants