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: Use Column Name Instead of Offset to Find the common handle cluster index (#5166) #5193

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #5166

What problem does this PR solve?

Issue Number: close #5154

Problem Summary:

What is changed and how it works?

in decodingSchemaSnapshot, we use column name instead of offset to find cluster index id of the common handle. Because in tiflash, we don't update the indexinfo of table_info except rename ddl action. Thus, the offset of tidb_table_info is not correctly in sometimes.

Besides, I add two DDL tests based on issue #5154, concerning about clustered index.

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

Fix the TiFlash crash issue that occurs after dropping a column of a table with clustered indexes under some situations.

@ti-chi-bot
Copy link
Member Author

ti-chi-bot commented Jun 22, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang
  • lidezhu

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 Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/cherry-pick-not-approved size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/bugfix This PR fixes a bug. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR. labels Jun 22, 2022
@VelocityLight VelocityLight added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels Jun 22, 2022
@hongyunyan
Copy link
Contributor

/rebuild

@hongyunyan
Copy link
Contributor

/run-all-tests

@hongyunyan
Copy link
Contributor

/run-unit-tests

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 23, 2022
@hongyunyan
Copy link
Contributor

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jun 23, 2022

Coverage for changed files

Filename                                                                  Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Core/Block.cpp                                                                218                79    63.76%          44                10    77.27%         383               162    57.70%         142                61    57.04%
Debug/MockTiDB.cpp                                                            154               150     2.60%          35                33     5.71%         481               463     3.74%         102               101     0.98%
Debug/dbgFuncMockRaftCommand.cpp                                               28                28     0.00%           4                 4     0.00%         183               183     0.00%          16                16     0.00%
Debug/dbgFuncMockRaftSnapshot.cpp                                             174               162     6.90%          23                15    34.78%         553               505     8.68%         118               116     1.69%
Debug/dbgFuncRegion.cpp                                                        95                95     0.00%          13                13     0.00%         253               253     0.00%          64                64     0.00%
Debug/dbgTools.cpp                                                            168               166     1.19%          24                22     8.33%         459               446     2.83%         182               182     0.00%
Storages/Transaction/DecodingStorageSchemaSnapshot.h                           33                 1    96.97%           1                 0   100.00%          63                 1    98.41%          26                 2    92.31%
Storages/Transaction/RegionBlockReader.cpp                                     82                26    68.29%           3                 0   100.00%         164                25    84.76%          60                24    60.00%
Storages/Transaction/TiDB.cpp                                                 480               266    44.58%          45                13    71.11%         853               394    53.81%         334               148    55.69%
Storages/Transaction/TiDB.h                                                    20                 7    65.00%          16                 3    81.25%          16                 3    81.25%           6                 6     0.00%
Storages/Transaction/TiKVRecordFormat.h                                        99                10    89.90%          37                 1    97.30%         263                18    93.16%          44                 5    88.64%
Storages/Transaction/tests/RowCodecTestUtils.h                                 76                 4    94.74%          14                 0   100.00%         168                 1    99.40%          30                 2    93.33%
Storages/Transaction/tests/gtest_decoding_storage_schema_snapshot.cpp         251                36    85.66%           3                 0   100.00%          25                 0   100.00%          72                36    50.00%
Storages/Transaction/tests/gtest_region_block_reader.cpp                      593                99    83.31%          21                 0   100.00%         256                 4    98.44%         208                87    58.17%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                        2471              1129    54.31%         283               114    59.72%        4120              2458    40.34%        1404               850    39.46%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18242      9787             46.35%    204444  98043        52.04%

full coverage report (for internal network access only)

Copy link
Contributor

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

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

LGTM

@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 Jun 23, 2022
@JaySon-Huang
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member Author

@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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

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

Commit hash: 1fd73e4

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 17, 2022
@ti-chi-bot
Copy link
Member Author

@ti-chi-bot: 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.

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 17, 2022

Coverage for changed files

Filename                                                                  Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Core/Block.cpp                                                                218                79    63.76%          44                10    77.27%         383               162    57.70%         142                61    57.04%
Debug/MockTiDB.cpp                                                            154               150     2.60%          35                33     5.71%         481               463     3.74%         102               101     0.98%
Debug/dbgFuncMockRaftCommand.cpp                                               28                28     0.00%           4                 4     0.00%         183               183     0.00%          16                16     0.00%
Debug/dbgFuncMockRaftSnapshot.cpp                                             174               162     6.90%          23                15    34.78%         553               505     8.68%         118               116     1.69%
Debug/dbgFuncRegion.cpp                                                        95                95     0.00%          13                13     0.00%         253               253     0.00%          64                64     0.00%
Debug/dbgTools.cpp                                                            168               166     1.19%          24                22     8.33%         459               446     2.83%         182               182     0.00%
Storages/Transaction/DecodingStorageSchemaSnapshot.h                           33                 1    96.97%           1                 0   100.00%          63                 1    98.41%          26                 2    92.31%
Storages/Transaction/RegionBlockReader.cpp                                     82                26    68.29%           3                 0   100.00%         164                25    84.76%          60                24    60.00%
Storages/Transaction/TiDB.cpp                                                 480               266    44.58%          45                13    71.11%         853               394    53.81%         334               148    55.69%
Storages/Transaction/TiDB.h                                                    20                 7    65.00%          16                 3    81.25%          16                 3    81.25%           6                 6     0.00%
Storages/Transaction/TiKVRecordFormat.h                                        99                10    89.90%          37                 1    97.30%         263                18    93.16%          44                 5    88.64%
Storages/Transaction/tests/RowCodecTestUtils.h                                 76                 4    94.74%          14                 0   100.00%         168                 1    99.40%          30                 2    93.33%
Storages/Transaction/tests/gtest_decoding_storage_schema_snapshot.cpp         251                36    85.66%           3                 0   100.00%          25                 0   100.00%          72                36    50.00%
Storages/Transaction/tests/gtest_region_block_reader.cpp                      593                99    83.31%          21                 0   100.00%         256                 4    98.44%         208                87    58.17%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                        2471              1129    54.31%         283               114    59.72%        4120              2458    40.34%        1404               850    39.46%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18249      9783             46.39%    204628  98036        52.09%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 623164f into pingcap:release-6.1 Aug 17, 2022
@jayl1e jayl1e added this to the v6.1.1 milestone Aug 23, 2022
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ 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. type/bugfix This PR fixes a bug. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants