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

PageStorage: Fix the WAL snapshot dumped into file may contains invalid "being_ref_count" (#4987) #4992

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #4987

What problem does this PR solve?

Issue Number: close #4957, close #4986

Problem Summary:

  • issue 4975:
    • We can not prevent being_ref_count to be modify unless we stop the write threads while dumping snapshot of WAL log files
  • issue 4986:
    • The encryption info of WAL log files are not removed after snapshot dumped

What is changed and how it works?

  • Create a reader for WAL log files and load the edit into another temporary PageDirectory instance, and dump it as a snapshot edit to the snapshot log file
  • Remove the encryption info of WAL log files after snapshot dumped

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 24, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CalvinNeo
  • 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 release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/cherry-pick-not-approved size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR. labels May 24, 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 the status/LGT1 Indicates that a PR has LGTM 1. label May 24, 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
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@JaySon-Huang
Copy link
Contributor

/run-all-tests

@VelocityLight VelocityLight added cherry-pick-approved Cherry pick PR approved by release team. and removed do-not-merge/cherry-pick-not-approved labels May 24, 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: 10416bd

@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
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Encryption/FileProvider.cpp                              82                12    85.37%          11                 0   100.00%         144                34    76.39%          62                16    74.19%
Encryption/FileProvider.h                                 2                 0   100.00%           2                 0   100.00%           2                 0   100.00%           0                 0         -
Encryption/MockKeyManager.cpp                            64                 6    90.62%           7                 0   100.00%          81                 9    88.89%          36                11    69.44%
Encryption/MockKeyManager.h                               1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
Storages/DeltaMerge/StoragePool.cpp                     224               108    51.79%          31                 8    74.19%         491               220    55.19%         146                85    41.78%
Storages/Page/PageStorage.h                              19                 1    94.74%          19                 1    94.74%          85                 3    96.47%           0                 0         -
Storages/Page/V3/PageDirectory.cpp                      565                89    84.25%          32                 1    96.88%        1132               173    84.72%         430                98    77.21%
Storages/Page/V3/PageDirectory.h                         25                 3    88.00%          25                 3    88.00%         104                10    90.38%           0                 0         -
Storages/Page/V3/PageDirectoryFactory.cpp                50                 3    94.00%           6                 0   100.00%         127                 6    95.28%          50                 4    92.00%
Storages/Page/V3/PageDirectoryFactory.h                   2                 0   100.00%           2                 0   100.00%           8                 0   100.00%           0                 0         -
Storages/Page/V3/PageStorageImpl.cpp                    134                28    79.10%          24                 7    70.83%         293                62    78.84%          72                25    65.28%
Storages/Page/V3/PageStorageImpl.h                        8                 2    75.00%           8                 2    75.00%          22                 2    90.91%           0                 0         -
Storages/Page/V3/WALStore.cpp                            80                 7    91.25%          10                 0   100.00%         154                10    93.51%          34                 8    76.47%
Storages/Page/V3/WALStore.h                              13                 4    69.23%           4                 0   100.00%          17                 3    82.35%          10                 8    20.00%
Storages/Page/V3/tests/entries_helper.h                  68                36    47.06%          10                 3    70.00%         242               112    53.72%          34                22    35.29%
Storages/Page/V3/tests/gtest_page_directory.cpp       10021              1821    81.83%          58                 0   100.00%        1859                 7    99.62%        3166              1603    49.37%
Storages/Page/V3/tests/gtest_page_storage.cpp          3683              1278    65.30%          45                 7    84.44%        1093               154    85.91%        1158               657    43.26%
Storages/Page/V3/tests/gtest_wal_store.cpp             2437               293    87.98%          13                 0   100.00%         546                13    97.62%         814               396    51.35%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                 17478              3691    78.88%         308                32    89.61%        6401               818    87.22%        6012              2933    51.21%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18230      9783             46.34%    204087  97962        52.00%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 2bcb47a 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/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.

6 participants