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

Add a protect if snapshot can't get any valid version #4171

Merged
merged 5 commits into from
Mar 7, 2022
Merged

Add a protect if snapshot can't get any valid version #4171

merged 5 commits into from
Mar 7, 2022

Conversation

jiaqizho
Copy link
Contributor

@jiaqizho jiaqizho commented Mar 2, 2022

What problem does this PR solve?

Issue Number: close #4179

Problem Summary:

  1. A nullptr error comes from DeltaMergeStore.cpp when TiFlash is running(no signal to shutdown or other crash) make TiFlash crash.
  2. I can't find any reason other than OOM which makes the version chain be nullptr here.
  3. Also the error is from AsynchronousMetrics.cpp, which means I don't know which db+table lost the PageStorage instance. Cause it will scan all tables.
  4. So I think just add a protected, and we may get more info about this crash.

What is changed and how it works?

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 bug that reporting metrics may make TiFlash crash

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 2, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CalvinNeo
  • 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. labels Mar 2, 2022
@jiaqizho
Copy link
Contributor Author

jiaqizho commented Mar 2, 2022

飞书20220302-145035

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/LGT1 Indicates that a PR has LGTM 1. 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 Mar 2, 2022
Copy link
Member

@CalvinNeo CalvinNeo 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 Mar 2, 2022
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Mar 2, 2022

Coverage for changed files

Filename                                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/build/tics/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp        1317               466    64.62%          65                 5    92.31%        1880               426    77.34%         766               366    52.22%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                               1317               466    64.62%          65                 5    92.31%        1880               426    77.34%         766               366    52.22%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16569      9524             42.52%    182988  96241        47.41%

full coverage report (for internal network access only)

@jiaqizho
Copy link
Contributor Author

jiaqizho commented Mar 3, 2022

/merge

@ti-chi-bot
Copy link
Member

@jiaqizho: 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: 686fbe8

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

sre-bot commented Mar 3, 2022

Coverage for changed files

Filename                                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/build/tics/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp        1317               454    65.53%          65                 5    92.31%        1880               422    77.55%         766               359    53.13%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                               1317               454    65.53%          65                 5    92.31%        1880               422    77.55%         766               359    53.13%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16569      9523             42.53%    182988  96234        47.41%

full coverage report (for internal network access only)

@jiaqizho
Copy link
Contributor Author

jiaqizho commented Mar 3, 2022

/merge

@ti-chi-bot
Copy link
Member

@jiaqizho: 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.

@sre-bot
Copy link
Collaborator

sre-bot commented Mar 3, 2022

Coverage for changed files

Filename                                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/build/tics/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp        1317               467    64.54%          65                 5    92.31%        1880               426    77.34%         766               367    52.09%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                               1317               467    64.54%          65                 5    92.31%        1880               426    77.34%         766               367    52.09%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16569      9524             42.52%    182988  96228        47.41%

full coverage report (for internal network access only)

@jiaqizho
Copy link
Contributor Author

jiaqizho commented Mar 4, 2022

/merge

@ti-chi-bot
Copy link
Member

@jiaqizho: 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.

@JaySon-Huang
Copy link
Contributor

@jiaqizho you need to create an issue for it and fill it in the body of this PR to get the do-not-merge/needs-linked-issue label removed

image

@sre-bot
Copy link
Collaborator

sre-bot commented Mar 4, 2022

Coverage for changed files

Filename                                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/build/tics/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp        1317               466    64.62%          65                 5    92.31%        1880               426    77.34%         766               366    52.22%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                               1317               466    64.62%          65                 5    92.31%        1880               426    77.34%         766               366    52.22%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16569      9525             42.51%    182988  96236        47.41%

full coverage report (for internal network access only)

@JaySon-Huang
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@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.

@sre-bot
Copy link
Collaborator

sre-bot commented Mar 4, 2022

Coverage for changed files

Filename                                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/build/tics/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp        1317               466    64.62%          65                 5    92.31%        1882               426    77.36%         766               367    52.09%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                               1317               466    64.62%          65                 5    92.31%        1882               426    77.36%         766               367    52.09%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16703      9456             43.39%    187189  95580        48.94%

full coverage report (for internal network access only)

@jiaqizho
Copy link
Contributor Author

jiaqizho commented Mar 4, 2022

/run-all-tests

1 similar comment
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Mar 5, 2022

Coverage for changed files

Filename                                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/build/tics/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp        1317               466    64.62%          65                 5    92.31%        1882               426    77.36%         766               367    52.09%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                               1317               466    64.62%          65                 5    92.31%        1882               426    77.36%         766               367    52.09%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16703      9456             43.39%    187189  95579        48.94%

full coverage report (for internal network access only)

@jiaqizho
Copy link
Contributor Author

jiaqizho commented Mar 7, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Mar 7, 2022

Coverage for changed files

Filename                                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/build/tics/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp        1317               467    64.54%          65                 5    92.31%        1882               426    77.36%         766               368    51.96%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                               1317               467    64.54%          65                 5    92.31%        1882               426    77.36%         766               368    51.96%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16703      9456             43.39%    187189  95577        48.94%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 5229725 into pingcap:master Mar 7, 2022
@jiaqizho jiaqizho deleted the nullptr-from-ps2-version branch March 7, 2022 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiFlash crash in DeltaMergeStore::getStat
5 participants