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

*: refactor and fix the usages of DecodeIndexKV for clustered index #23096

Merged
merged 16 commits into from
Mar 10, 2021

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Mar 4, 2021

What problem does this PR solve?

Problem Summary: Fix #23106.

In the process of the work "remove alter-primary-key configuration", I found TestAddIndex5 should test the clustered index case but it doesn't because the config alter-primary-key is enabled.

For details, see #23106.

What is changed and how it works?

What's Changed:

Bugfix:

  • checkHandleExists: fix the comparison of the handle.
  • (c *indexIter) Next(): fix handle decoding.

Test:

  • *: Set the config correctly.

Refactor:

  • decodeRestoredValuesV5: reduce the memory allocation, improve the readability.
  • BuildRowcodecColInfoForIndexColumns: extract the process of building []rowcodec.ColumnInfo from index columns into a separated function.

Related changes

NA

Check List

Tests

  • Unit test
  • Integration test

Side effects

NA

Release note

  • No release note

@tangenta tangenta requested review from a team as code owners March 4, 2021 03:04
@tangenta tangenta requested review from qw4990 and XuHuaiyu and removed request for a team March 4, 2021 03:04
@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 4, 2021
@tangenta tangenta requested review from coocood and wjhuang2016 and removed request for qw4990 and XuHuaiyu March 4, 2021 03:04
@github-actions github-actions bot added sig/execution SIG execution sig/sql-infra SIG: SQL Infra labels Mar 4, 2021
@tangenta tangenta force-pushed the clustered-index-fix-add-index-test branch from c954d3f to 9fa4c8a Compare March 4, 2021 03:32
@tangenta tangenta requested a review from lysu March 4, 2021 04:09
@wjhuang2016
Copy link
Member

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 4, 2021
@tangenta tangenta force-pushed the clustered-index-fix-add-index-test branch from 2a757f5 to b44fe65 Compare March 5, 2021 02:53
@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 5, 2021
@tangenta tangenta changed the title *: refactor and fix TestAddIndex5 for clustered index *: refactor and fix the usages of DecodeIndexKV for clustered index Mar 5, 2021
@lysu lysu requested a review from jackysp March 5, 2021 04:02
table/tables/index.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 8, 2021
@wjhuang2016
Copy link
Member

/run-check_dev_2 tikv=pr/9182

@coocood coocood removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 9, 2021
@coocood
Copy link
Member

coocood commented Mar 9, 2021

/run-all-tests

@ichn-hu ichn-hu mentioned this pull request Mar 9, 2021
@wjhuang2016
Copy link
Member

/run-all-tests

@tangenta
Copy link
Contributor Author

[2021-03-09T11:04:53.261Z] FAIL: 2pc_test.go:735: testCommitterSuite.TestElapsedTTL
[2021-03-09T11:04:53.261Z] 
[2021-03-09T11:04:53.261Z] 2pc_test.go:749:
[2021-03-09T11:04:53.261Z]     c.Assert(lockInfo.LockTtl-atomic.LoadUint64(&ManagedLockTTL), Less, uint64(150))
[2021-03-09T11:04:53.262Z] ... compare_one uint64 = 0x97
[2021-03-09T11:04:53.262Z] ... compare_two uint64 = 0x96

/run-unit-test

@coocood
Copy link
Member

coocood commented Mar 10, 2021

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • coocood
  • 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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@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 Mar 10, 2021
@coocood
Copy link
Member

coocood commented Mar 10, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 9518be9

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 10, 2021
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Mar 10, 2021
@tangenta
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: e13700f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 10, 2021
@coocood
Copy link
Member

coocood commented Mar 10, 2021

/run-unit-test

@ti-chi-bot
Copy link
Member

@tangenta: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit f8da635 into pingcap:master Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/sql-infra SIG: SQL Infra size/XL Denotes a PR that changes 500-999 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.

Adding unique index on duplicate rows hangs (clustered_index + new collation)
7 participants