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 pages are not deleted under some cases (#5069) #5070

Merged
merged 4 commits into from
Jun 3, 2022

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Jun 3, 2022

cherry-pick of #5069


What problem does this PR solve?

Issue Number: close #5054

Problem Summary: as the issue described. V2.data.getAliveExternalPageIds returns the dtfile ids after deleted, so the deleted dtfiles can not be removed from disk. Restart the TiFlash process can workaround the issue as the page ids are deleted when restored from v2 wal.

What is changed and how it works?

  • StoragePool only need to remove DTFiles ids that are not exist in the V3.data, cause we perform force transform from V2.data to V3.data when restore
  • Keep tombstone when merging the delta version for page entries in V2, or the page id will shown in getAliveExternalPageIds after deleted

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code
  • Manual test steps:
    • Deploy cluster and load some data into TiFlash with storage.format_version = 3
    • Change the storage.format_version = 4
    • Use alter table t compact tiflash replica to perform delta-merge
    • Check that the old DTFiles are removed

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

ti-chi-bot commented Jun 3, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • flowbehappy
  • hehechen

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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 3, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 3, 2022
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Jun 3, 2022

Coverage for changed files

Filename                                          Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DeltaMerge/StoragePool.cpp                            223               107    52.02%          30                 7    76.67%         478               207    56.69%         146                85    41.78%
Page/Page.h                                            61                 6    90.16%          15                 1    93.33%          80                17    78.75%          38                12    68.42%
Page/V2/PageEntries.h                                 128                14    89.06%          49                11    77.55%         300                54    82.00%          64                 5    92.19%
Page/V3/tests/gtest_page_storage_mix_mode.cpp        2161               562    73.99%          16                 0   100.00%         583                21    96.40%         626               319    49.04%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                2573               689    73.22%         110                19    82.73%        1441               299    79.25%         874               421    51.83%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18239      9788             46.33%    204363  98050        52.02%

full coverage report (for internal network access only)

@sre-bot sre-bot added the cherry-pick-approved Cherry pick PR approved by release team. label Jun 3, 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 Jun 3, 2022
@JaySon-Huang
Copy link
Contributor Author

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

@ti-chi-bot
Copy link
Member

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

Commit hash: 336801c

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

sre-bot commented Jun 3, 2022

Coverage for changed files

Filename                                          Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DeltaMerge/StoragePool.cpp                            223               107    52.02%          30                 7    76.67%         478               207    56.69%         146                85    41.78%
Page/Page.h                                            61                 6    90.16%          15                 1    93.33%          80                17    78.75%          38                12    68.42%
Page/V2/PageEntries.h                                 128                14    89.06%          49                11    77.55%         300                54    82.00%          64                 5    92.19%
Page/V3/tests/gtest_page_storage_mix_mode.cpp        2161               562    73.99%          16                 0   100.00%         583                21    96.40%         626               319    49.04%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                2573               689    73.22%         110                19    82.73%        1441               299    79.25%         874               421    51.83%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18239      9788             46.33%    204363  98044        52.02%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit df059cc into pingcap:release-6.1 Jun 3, 2022
@JaySon-Huang JaySon-Huang deleted the fix_page_undeleted-6.1 branch June 3, 2022 08:20
@sre-bot
Copy link
Collaborator

sre-bot commented Jun 3, 2022

Coverage for changed files

Filename                                          Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DeltaMerge/StoragePool.cpp                            223               107    52.02%          30                 7    76.67%         478               207    56.69%         146                85    41.78%
Page/Page.h                                            61                 6    90.16%          15                 1    93.33%          80                17    78.75%          38                12    68.42%
Page/V2/PageEntries.h                                 128                14    89.06%          49                11    77.55%         300                54    82.00%          64                 5    92.19%
Page/V3/tests/gtest_page_storage_mix_mode.cpp        2161               562    73.99%          16                 0   100.00%         583                21    96.40%         626               319    49.04%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                2573               689    73.22%         110                19    82.73%        1441               299    79.25%         874               421    51.83%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18239      9788             46.33%    204363  98046        52.02%

full coverage report (for internal network access only)

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/L Denotes a PR that changes 100-499 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.

5 participants