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

Fix crash when prehandle snapshot #4140

Merged
merged 5 commits into from
Feb 25, 2022

Conversation

lidezhu
Copy link
Contributor

@lidezhu lidezhu commented Feb 25, 2022

What problem does this PR solve?

Issue Number: close #4072

Problem Summary: When apply snapshot, it will first get a schema snapshot for decoding. And in the schema snapshot we store a pointer to the column infos. So if the schema of the column infos changed, the pointer may be invalid and it will cause crash.

What is changed and how it works?

Copy the value of the column infos instead of storing a pointer when creating schema snapshot.

Check List

Tests

  • Unit test
  • Integration test (3 tiflash nodes with two tiflash replica, under heavy dml + ddl workload and with region-shuffle-scheduler, the cluster works normally)
  • Manual test (add detailed scripts or steps below)
  • No code

Release note

Avoid the potential of crash when apply snapshot under heavy ddl scenario

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 25, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang

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 do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. and removed do-not-merge/needs-linked-issue labels Feb 25, 2022
@lidezhu lidezhu mentioned this pull request Feb 25, 2022
12 tasks
@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Feb 25, 2022
@lidezhu
Copy link
Contributor Author

lidezhu commented Feb 25, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Feb 25, 2022

Coverage for changed files

Filename                            Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DecodingStorageSchemaSnapshot.h          35                 1    97.14%           1                 0   100.00%          61                 1    98.36%          26                 2    92.31%
PartitionStreams.cpp                    238               189    20.59%          21                13    38.10%         571               391    31.52%         130               109    16.15%
RegionBlockReader.cpp                    82                26    68.29%           3                 0   100.00%         163                25    84.66%          60                24    60.00%
RowCodec.cpp                            243                33    86.42%          19                 0   100.00%         389                58    85.09%         204                45    77.94%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                   598               249    58.36%          44                13    70.45%        1184               475    59.88%         420               180    57.14%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16676      9482             43.14%    184701  95690        48.19%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 25, 2022
@lidezhu
Copy link
Contributor Author

lidezhu commented Feb 25, 2022

/merge

@ti-chi-bot
Copy link
Member

@lidezhu: 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

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

Commit hash: 73178f3

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 25, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Feb 25, 2022

Coverage for changed files

Filename                            Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DecodingStorageSchemaSnapshot.h          35                 1    97.14%           1                 0   100.00%          61                 1    98.36%          26                 2    92.31%
PartitionStreams.cpp                    238               189    20.59%          21                13    38.10%         571               391    31.52%         130               109    16.15%
RegionBlockReader.cpp                    82                26    68.29%           3                 0   100.00%         163                25    84.66%          60                24    60.00%
RowCodec.cpp                            243                33    86.42%          19                 0   100.00%         389                58    85.09%         204                45    77.94%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                   598               249    58.36%          44                13    70.45%        1184               475    59.88%         420               180    57.14%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16691      9483             43.18%    184951  95719        48.25%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit e74755b into pingcap:master Feb 25, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #4143.

@lidezhu lidezhu deleted the fix-prehandle-snapshot2 branch February 25, 2022 09:55
@sre-bot
Copy link
Collaborator

sre-bot commented Feb 28, 2022

Coverage for changed files

Filename                            Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DecodingStorageSchemaSnapshot.h          35                 1    97.14%           1                 0   100.00%          61                 1    98.36%          26                 2    92.31%
PartitionStreams.cpp                    238               189    20.59%          21                13    38.10%         571               391    31.52%         130               109    16.15%
RegionBlockReader.cpp                    82                26    68.29%           3                 0   100.00%         163                25    84.66%          60                24    60.00%
RowCodec.cpp                            243                33    86.42%          19                 0   100.00%         389                58    85.09%         204                45    77.94%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                   598               249    58.36%          44                13    70.45%        1184               475    59.88%         420               180    57.14%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16691      9483             43.18%    184951  95707        48.25%

full coverage report (for internal network access only)

lidezhu added a commit to lidezhu/tics that referenced this pull request Apr 14, 2022
lidezhu added a commit that referenced this pull request Apr 14, 2022
ti-chi-bot added a commit that referenced this pull request Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiFlash crash when PreHandleSnapshot
4 participants