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: Add mix mode #4726

Merged
merged 46 commits into from
May 12, 2022
Merged

PageStorage: Add mix mode #4726

merged 46 commits into from
May 12, 2022

Conversation

jiaqizho
Copy link
Contributor

@jiaqizho jiaqizho commented Apr 21, 2022

Signed-off-by: jiaqizho zhoujiaqi@pingcap.com

What problem does this PR solve?

Issue Number: ref #3594

Problem Summary:

  • When user already has some data which used PageStorage V2 format. Then it can't convert to V3

What is changed and how it works?

  • Changed PageWriter/PageReader to allow users used V3 format for write/read and V2 format for read-only.
  • When the user contains V2 format data. after set format_version = 4, Then we will be running PageStorage in Mix Mode. Which will both deal with V3 and V2 format data.
  • We also allow user running ONLY_V2/ONLY_V3(which means only single version of page data format):
    • PageFormat::V2 + isPageStorageV3Existed is false + whatever isPageStorageV2Existed true or false = ONLY_V2
    • PageFormat::V2 + isPageStorageV3Existed is true + whatever isPageStorageV2Existed true or false = ERROR Config
    • PageFormat::V3 + isPageStorageV2Existed is true + whatever isPageStorageV3Existed true or false = MIX_MODE
    • PageFormat::V3 + isPageStorageV2Existed is false + whatever isPageStorageV3Existed true or false = ONLY_V3
  • The data path for KVStore(RegionPersister) is changed:
    • $DATA_DIR/kvstore for kvstore (PageStorage V2/V1)
    • $DATA_DIR/page/kvstore for kvstore (PageStorage V3)
    • The hidden configuration storage.raft.dir/raft.kvstore_path will be ignored

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

ti-chi-bot commented Apr 21, 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.

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/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 21, 2022
@pingcap pingcap deleted a comment from sre-bot Apr 25, 2022
@pingcap pingcap deleted a comment from sre-bot Apr 25, 2022
@pingcap pingcap deleted a comment from sre-bot Apr 25, 2022
@pingcap pingcap deleted a comment from sre-bot Apr 26, 2022
@jiaqizho
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Apr 27, 2022

Coverage for changed files

too many lines from llvm-cov, please refer to full report instead

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17292      9374             45.79%    195466  95826        50.98%

full coverage report (for internal network access only)

@pingcap pingcap deleted a comment from sre-bot Apr 27, 2022
@pingcap pingcap deleted a comment from sre-bot Apr 27, 2022
@jiaqizho
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Apr 27, 2022

Coverage for changed files

too many lines from llvm-cov, please refer to full report instead

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17292      9376             45.78%    195463  95866        50.95%

full coverage report (for internal network access only)

@jiaqizho jiaqizho changed the title [WIP]PageStorage: Add mix mode PageStorage: Add mix mode Apr 27, 2022
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 27, 2022
@jiaqizho jiaqizho requested review from lidezhu, JaySon-Huang and flowbehappy and removed request for lidezhu April 27, 2022 14:29
@jiaqizho
Copy link
Contributor Author

pre PR : #4736

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 30, 2022
Signed-off-by: jiaqizho <zhoujiaqi@pingcap.com>
@JaySon-Huang
Copy link
Contributor

PTAL at https://github.com/jiaqizho/tiflash/pull/11.
Use inherite to hind the switch .. case statements

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

dbms/src/Storages/Page/PageStorage.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/Page/PageStorage.cpp Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 11, 2022
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented May 11, 2022

Coverage for changed files

too many lines from llvm-cov, please refer to full report instead

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18183      9847             45.85%    202958  98591        51.42%

full coverage report (for internal network access only)

@jiaqizho jiaqizho requested a review from hehechen May 11, 2022 10:20
@@ -178,7 +178,7 @@ class DeltaMergeStoreRWTest
return s;
}

std::pair<RowKeyRange, std::vector<PageId>> genDMFile(DMContext & context, const Block & block)
std::pair<RowKeyRange, PageIds> genDMFile(DMContext & context, const Block & block)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add UT to test delta merge storage in mix mode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to add it in the follow-up PR. Cause writing ut with GlobalPathPool is not easy.

otherwise, already have test cover in V3/gtest_page_storage_mix_mode.cpp.

@jiaqizho jiaqizho requested review from hehechen and lidezhu May 12, 2022 01:06
Copy link
Contributor

@lidezhu lidezhu 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 May 12, 2022
@jiaqizho
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@jiaqizho: 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: d2a6ae0

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

@jiaqizho: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

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.

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.

@sre-bot
Copy link
Collaborator

sre-bot commented May 12, 2022

Coverage for changed files

too many lines from llvm-cov, please refer to full report instead

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18152      9817             45.92%    202639  98303        51.49%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 506df23 into pingcap:master May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ 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.

7 participants