Skip to content

keep delete entry when dump snapshot (#5357)#5370

Merged
ti-chi-bot merged 5 commits into
pingcap:release-6.1from
ti-chi-bot:cherry-pick-5357-to-release-6.1
Aug 17, 2022
Merged

keep delete entry when dump snapshot (#5357)#5370
ti-chi-bot merged 5 commits into
pingcap:release-6.1from
ti-chi-bot:cherry-pick-5357-to-release-6.1

Conversation

@ti-chi-bot
Copy link
Copy Markdown
Member

This is an automated cherry-pick of #5357

What problem does this PR solve?

Issue Number: close #5230

Problem Summary: when enable ps v3, after doing large transaction update and restart tiflash multiple times, tiflash cannot restart correctly.

What is changed and how it works?

Previously, when dump snapshot for PageDirectory, we will remove obsolete entries if it is marked deleted. But the entry may have an upsert entry in later wal file which is not included in the snapshot. So if we remove the delete mark for the entry, the later upsert entry cannot be deleted after restart.
So we keep the last valid entry and the delete entry when dump snapshot.

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

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Copy Markdown
Member Author

ti-chi-bot commented Jul 14, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang
  • lidezhu

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.

Details

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/cherry-pick-for-release-6.1 This PR is cherry-picked to release-6.1 from a source PR. labels Jul 14, 2022
@lidezhu
Copy link
Copy Markdown
Contributor

lidezhu commented Jul 14, 2022

/rebuild

5 similar comments
@lidezhu
Copy link
Copy Markdown
Contributor

lidezhu commented Jul 14, 2022

/rebuild

@JaySon-Huang
Copy link
Copy Markdown
Contributor

/rebuild

@lidezhu
Copy link
Copy Markdown
Contributor

lidezhu commented Jul 14, 2022

/rebuild

@lidezhu
Copy link
Copy Markdown
Contributor

lidezhu commented Jul 15, 2022

/rebuild

@lidezhu
Copy link
Copy Markdown
Contributor

lidezhu commented Jul 15, 2022

/rebuild

@lidezhu
Copy link
Copy Markdown
Contributor

lidezhu commented Jul 15, 2022

/run-all-tests

@sre-bot
Copy link
Copy Markdown
Collaborator

sre-bot commented Jul 15, 2022

Coverage for changed files

Filename                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BlobStore.cpp                        571               173    69.70%          54                 2    96.30%        1158               271    76.60%         362               137    62.15%
LogFile/LogFilename.h                  9                 0   100.00%           3                 0   100.00%          18                 3    83.33%           4                 0   100.00%
PageDirectory.cpp                    580                87    85.00%          32                 1    96.88%        1161               181    84.41%         440               100    77.27%
PageDirectory.h                       25                 3    88.00%          25                 3    88.00%         104                10    90.38%           0                 0         -
PageDirectoryFactory.cpp              52                 2    96.15%           6                 0   100.00%         127                 3    97.64%          52                 3    94.23%
PageDirectoryFactory.h                 2                 0   100.00%           2                 0   100.00%           8                 0   100.00%           0                 0         -
tests/gtest_page_storage.cpp        3917              1356    65.38%          49                 7    85.71%        1212               154    87.29%        1238               695    43.86%
tests/gtest_wal_log.cpp             2523               370    85.33%          49                 0   100.00%         529                 1    99.81%         772               351    54.53%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                               7679              1991    74.07%         220                13    94.09%        4317               623    85.57%        2868              1286    55.16%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18243      9788             46.35%    204503  98052        52.05%

full coverage report (for internal network access only)

@lidezhu
Copy link
Copy Markdown
Contributor

lidezhu commented Aug 17, 2022

@JaySon-Huang @flowbehappy PTAL

Copy link
Copy Markdown
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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 17, 2022
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 17, 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 Aug 17, 2022
@VelocityLight VelocityLight added the cherry-pick-approved Cherry pick PR approved by release team. label Aug 17, 2022
Signed-off-by: JaySon-Huang <tshent@qq.com>
@JaySon-Huang
Copy link
Copy Markdown
Contributor

/merge

@ti-chi-bot
Copy link
Copy Markdown
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.

Details

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
Copy Markdown
Member Author

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

DetailsCommit hash: e59f466

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

sre-bot commented Aug 17, 2022

Coverage for changed files

Filename                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BlobStore.cpp                        572               172    69.93%          55                 2    96.36%        1170               270    76.92%         362               132    63.54%
LogFile/LogFilename.h                  9                 0   100.00%           3                 0   100.00%          18                 3    83.33%           4                 0   100.00%
PageDirectory.cpp                    580                87    85.00%          32                 1    96.88%        1161               181    84.41%         440               100    77.27%
PageDirectory.h                       25                 3    88.00%          25                 3    88.00%         104                10    90.38%           0                 0         -
PageDirectoryFactory.cpp              52                 2    96.15%           6                 0   100.00%         127                 3    97.64%          52                 3    94.23%
PageDirectoryFactory.h                 2                 0   100.00%           2                 0   100.00%           8                 0   100.00%           0                 0         -
tests/gtest_page_storage.cpp        4021              1387    65.51%          50                 7    86.00%        1228               154    87.46%        1266               710    43.92%
tests/gtest_wal_log.cpp             2523               370    85.33%          49                 0   100.00%         529                 1    99.81%         772               351    54.53%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                               7784              2021    74.04%         222                13    94.14%        4345               622    85.68%        2896              1296    55.25%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18253      9783             46.40%    204756  98033        52.12%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 6feacc2 into pingcap:release-6.1 Aug 17, 2022
@jayl1e jayl1e added this to the v6.1.1 milestone Aug 23, 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