Skip to content

keep delete entry when dump snapshot#5357

Merged
ti-chi-bot merged 12 commits into
pingcap:masterfrom
lidezhu:fix-blobstat-not-found
Jul 14, 2022
Merged

keep delete entry when dump snapshot#5357
ti-chi-bot merged 12 commits into
pingcap:masterfrom
lidezhu:fix-blobstat-not-found

Conversation

@lidezhu
Copy link
Copy Markdown
Contributor

@lidezhu lidezhu commented Jul 12, 2022

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.

Update:
For example:

put 5, version=<100, 0>
full GC start
del 5, version=<120, 0> => written to log_2_0
full GC end, move page 5 to a new location
upsert 5, version=<100, 1> => written to log_3_0

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

@ti-chi-bot
Copy link
Copy Markdown
Member

ti-chi-bot commented Jul 12, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang
  • flowbehappy

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/needs-linked-issue 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. and removed do-not-merge/needs-linked-issue labels Jul 12, 2022
@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 12, 2022

/rebuild

@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 12, 2022

/rebuild

1 similar comment
@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 12, 2022

/rebuild

@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 12, 2022

/run-all-tests

@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 12, 2022

/run-unit-test

2 similar comments
@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 12, 2022

/run-unit-test

@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 12, 2022

/run-unit-test

@sre-bot
Copy link
Copy Markdown
Collaborator

sre-bot commented Jul 12, 2022

Coverage for changed files

Filename                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BlobStore.cpp                        584               155    73.46%          56                 2    96.43%        1207               261    78.38%         368               134    63.59%
LogFile/LogFilename.h                  9                 0   100.00%           3                 0   100.00%          18                 3    83.33%           4                 0   100.00%
PageDirectory.cpp                    590                74    87.46%          32                 0   100.00%        1167               145    87.57%         448                90    79.91%
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        4094              1405    65.68%          51                 7    86.27%        1280               154    87.97%        1296               722    44.29%
tests/gtest_wal_log.cpp             2523               370    85.33%          49                 0   100.00%         529                 1    99.81%         772               351    54.53%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                               7879              2009    74.50%         224                12    94.64%        4440               577    87.00%        2940              1300    55.78%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18513      9569             48.31%    208837  96323        53.88%

full coverage report (for internal network access only)

@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 12, 2022

/rebuild

1 similar comment
@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 13, 2022

/rebuild

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 13, 2022
Comment thread dbms/src/Storages/Page/V3/BlobStore.cpp
Comment thread dbms/src/Storages/Page/V3/BlobStore.cpp
Comment thread dbms/src/Storages/Page/V3/tests/gtest_page_storage.cpp
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.

Basically lgtm

Comment thread dbms/src/Storages/Page/V3/BlobStore.cpp
Comment thread dbms/src/Storages/Page/V3/PageDirectoryFactory.cpp Outdated
Comment thread dbms/src/Storages/Page/V3/PageDirectory.h Outdated
Co-authored-by: JaySon <tshent@qq.com>
lidezhu and others added 2 commits July 14, 2022 14:46
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/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 14, 2022
@JaySon-Huang
Copy link
Copy Markdown
Contributor

JaySon-Huang commented Jul 14, 2022

We also need a cherry-pick on the release-6.1 branch? In case we may suggest some users to turn V3 on in v6.1.1 or later

@lidezhu lidezhu added the needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. label Jul 14, 2022
@lidezhu
Copy link
Copy Markdown
Contributor Author

lidezhu commented Jul 14, 2022

/merge

@ti-chi-bot
Copy link
Copy Markdown
Member

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

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

DetailsCommit hash: b4ab254

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

sre-bot commented Jul 14, 2022

Coverage for changed files

Filename                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BlobStore.cpp                        584               155    73.46%          56                 2    96.43%        1207               261    78.38%         368               134    63.59%
LogFile/LogFilename.h                  9                 0   100.00%           3                 0   100.00%          18                 3    83.33%           4                 0   100.00%
PageDirectory.cpp                    590                74    87.46%          32                 0   100.00%        1167               145    87.57%         448                89    80.13%
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        4094              1405    65.68%          51                 7    86.27%        1280               154    87.97%        1296               722    44.29%
tests/gtest_wal_log.cpp             2523               370    85.33%          49                 0   100.00%         529                 1    99.81%         772               351    54.53%
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                               7879              2009    74.50%         224                12    94.64%        4440               577    87.00%        2940              1299    55.82%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18532      9573             48.34%    208921  96388        53.86%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit c40c262 into pingcap:master Jul 14, 2022
ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Jul 14, 2022
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created: #5370.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can't find BlobStat with [blob_id=29]

6 participants