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: properly handle existence checks for deleted records in temp index #39371

Merged

Conversation

Benjamin2037
Copy link
Collaborator

@Benjamin2037 Benjamin2037 commented Nov 24, 2022

What problem does this PR solve?

Issue Number: close #39321

Problem Summary:
When set fast reorg variable on, some ut will failed.

What is changed and how it works?

TestCreateUniqueExpressionIndex

When user issue insert on dulplicate update statement during add index processing.

  1. During insert on dulplicate update, it need check unique key exists. when this check processing is in fast_reorg add index period, the check key exists should be done on temp index.
  2. Also the deleted key in temp index is not real delete, it is marked delete. So if this key was return, it should be skiped.
  3. When user insert one row in unique index, we also need check if there is marked deleted key exist, if this deleted key exist, then we skip unique conflict check and then let insert could be successful.

TestIndexChange

This case has some trick place, it test different adding index schema stage to see if key is exist or not. But here still has above problem. In non-public status index, all changes on table that is adding index will reflect to temp idx.
So we have to change key exist also on temp index first.

Check List

Tests

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

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
Copy link
Member

ti-chi-bot commented Nov 24, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • tangenta
  • wjhuang2016

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added 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. labels Nov 24, 2022
@Benjamin2037
Copy link
Collaborator Author

/run-mysql-test

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 25, 2022
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 25, 2022
@Benjamin2037
Copy link
Collaborator Author

/run-build

Co-authored-by: tangenta <tangenta@126.com>
@tangenta tangenta changed the title ddl: fix tempidx key check exist logic. ddl: properly handle existence checks for deleted records in temporary index Nov 25, 2022
@tangenta tangenta changed the title ddl: properly handle existence checks for deleted records in temporary index ddl: properly handle existence checks for deleted records in temp index Nov 25, 2022
table/tables/index.go Outdated Show resolved Hide resolved
@Benjamin2037
Copy link
Collaborator Author

/run-mysql-test

ddl/index_merge_tmp_test.go Show resolved Hide resolved
table/tables/index.go Outdated Show resolved Hide resolved
table/tables/index.go Outdated Show resolved Hide resolved
table/tables/index.go Show resolved Hide resolved
table/tables/index.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 28, 2022
executor/insert.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 28, 2022
@Benjamin2037
Copy link
Collaborator Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: a16e7eb

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 28, 2022
@Benjamin2037
Copy link
Collaborator Author

/merge

@ti-chi-bot ti-chi-bot merged commit 03034b6 into pingcap:master Nov 28, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Nov 28, 2022

TiDB MergeCI notify

🔴 Bad News! New failing [1] after this pr merged.
These new failed integration tests seem to be caused by the current PR, please try to fix these new failed integration tests, thanks!

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/sqllogic-test-2 🟥 failed 1, success 27, total 28 8 min 43 sec New failing
idc-jenkins-ci-tidb/integration-ddl-test ✅ all 6 tests passed 7 min 33 sec Fixed
idc-jenkins-ci-tidb/integration-common-test 🟢 all 17 tests passed 27 min Existing passed
idc-jenkins-ci/integration-cdc-test 🟢 all 40 tests passed 20 min Existing passed
idc-jenkins-ci-tidb/common-test 🟢 all 11 tests passed 18 min Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 6 min 46 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 6 min 24 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 6 min 11 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 3 min 12 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unit tests failed when fast reorg is enabled
5 participants