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 global max_id to fix reuse page_id problem (#4948) #4973

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #4948

What problem does this PR solve?

Issue Number: close #4939

#4872
#4849
#4889
We fix those two bugs with previous PRs, but it still causing problems like #4939 that If we reuse page_id, Then ref may can't deref count. Need to avoid page_id from being reused.

What is changed and how it works?

  • Add a global max_page_id in MVCC. update in apply and restore, and won't decrease it.

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

None

@ti-chi-bot
Copy link
Member Author

ti-chi-bot commented May 23, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang
  • jiaqizho

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/cherry-pick-not-approved release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 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 May 23, 2022
@MimeLyc MimeLyc added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels May 23, 2022
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 the status/LGT1 Indicates that a PR has LGTM 1. label May 23, 2022
@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 May 24, 2022
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

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

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

sre-bot commented May 24, 2022

Coverage for changed files

Filename                                   Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DeltaMerge/DeltaMergeStore.cpp                1453               511    64.83%          67                 5    92.54%        2040               465    77.21%         840               390    53.57%
DeltaMerge/StoragePool.cpp                     224               108    51.79%          31                 8    74.19%         491               220    55.19%         146                85    41.78%
DeltaMerge/StoragePool.h                        11                 1    90.91%          11                 1    90.91%          31                 9    70.97%           0                 0         -
Page/PageStorage.h                              19                 1    94.74%          19                 1    94.74%          85                 3    96.47%           0                 0         -
Page/V2/PageStorage.cpp                        553               156    71.79%          39                 4    89.74%         950               186    80.42%         370               149    59.73%
Page/V2/PageStorage.h                           49                10    79.59%          20                 3    85.00%          48                 3    93.75%          22                10    54.55%
Page/V3/PageDirectory.cpp                      565                88    84.42%          32                 2    93.75%        1123               164    85.40%         430                97    77.44%
Page/V3/PageDirectory.h                         25                 3    88.00%          25                 3    88.00%         104                10    90.38%           0                 0         -
Page/V3/PageDirectoryFactory.cpp                75                 4    94.67%           5                 0   100.00%         135                 3    97.78%          62                 7    88.71%
Page/V3/PageDirectoryFactory.h                   2                 0   100.00%           2                 0   100.00%           8                 0   100.00%           0                 0         -
Page/V3/PageStorageImpl.cpp                    134                28    79.10%          24                 7    70.83%         293                62    78.84%          72                25    65.28%
Page/V3/PageStorageImpl.h                        8                 2    75.00%           8                 2    75.00%          22                 2    90.91%           0                 0         -
Page/V3/WAL/serialize.cpp                       47                 2    95.74%          15                 0   100.00%         194                11    94.33%          52                 3    94.23%
Page/V3/tests/gtest_page_directory.cpp       10142              1867    81.59%          56                 0   100.00%        1922                 7    99.64%        3202              1623    49.31%
Page/V3/tests/gtest_page_storage.cpp          3642              1256    65.51%          44                 7    84.09%        1072               154    85.63%        1148               651    43.29%
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                        16949              4037    76.18%         398                43    89.20%        8518              1299    84.75%        6344              3040    52.08%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18222      9784             46.31%    204100  97944        52.01%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit c9fd034 into pingcap:release-6.1 May 24, 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-none Denotes a PR that doesn't merit a release note. 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. 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.

5 participants