Skip to content

PageStorage: Add V3 framework#3593

Merged
ti-chi-bot merged 7 commits intopingcap:masterfrom
JaySon-Huang:ps_v3_framework
Dec 7, 2021
Merged

PageStorage: Add V3 framework#3593
ti-chi-bot merged 7 commits intopingcap:masterfrom
JaySon-Huang:ps_v3_framework

Conversation

@JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Dec 3, 2021

Signed-off-by: JaySon-Huang jayson.hjs@gmail.com

What problem does this PR solve?

Issue Number: related to #3594

Problem Summary:

Add some data structure / class interface for PageStorage V3 inside.

What is changed and how it works?

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: JaySon-Huang <jayson.hjs@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 3, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

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

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 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. labels Dec 3, 2021
@JaySon-Huang JaySon-Huang requested a review from jiaqizho December 3, 2021 06:52
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
using PageMap = std::map<PageId, Page>;
using PageHandler = std::function<void(PageId page_id, const Page &)>;

// TODO: Move it into V2
Copy link
Contributor

Choose a reason for hiding this comment

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

PageEntry used by Page/PageStorage.h, if we moved it into v2. we may need use using to redirect this class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I may refactor out PageStorage::getEntry and make it an internal class inside PageStorageV2/V1 in another PR.

record.type = WriteBatch::WriteType::PUT;
record.page_id = page_id;
record.entry = entry;
records.emplace_back(record);
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure we need to use std::move(record) in here.

JaySon-Huang and others added 2 commits December 3, 2021 17:39
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@SchrodingerZhu SchrodingerZhu changed the title PagStorage: Add V3 framework PageStorage: Add V3 framework Dec 6, 2021
@jiaqizho
Copy link
Contributor

jiaqizho commented Dec 6, 2021

LGTM,

just a little suggestion: change the SnapshotPtr, Maybe we can point it to PageDirectorySnapshotPtr when enabling the V3 tests.

{
// Persist Page data to BlobStore
PageEntriesEdit edit(write_batch.getWrites().size());
// {
Copy link
Contributor

Choose a reason for hiding this comment

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

rm annotation in this method pls. cause it should be moved to blobstore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

@JaySon-Huang
Copy link
Contributor Author

JaySon-Huang commented Dec 6, 2021

just a little suggestion: change the SnapshotPtr, Maybe we can point it to PageDirectorySnapshotPtr when enabling the V3 tests.

The todo-list for the following two changes has been added to #3594 and I will take care of them.

  • Refactor out PageStorage::getEntry and make it an internal class inside PageStorageV2/V1
  • Make PageStorage::Snapshot an abstract class and make it compatible for V1, V2 and V3

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@jiaqizho
Copy link
Contributor

jiaqizho commented Dec 7, 2021

LGTM

@jiaqizho jiaqizho self-requested a review December 7, 2021 05:53
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 7, 2021
@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.

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
Member

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

DetailsCommit hash: 9dad156

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

sre-bot commented Dec 7, 2021

Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/282/cobertura/
(Coverage detail url is limited office network access)

lines: 40.3% (44439 out of 110245)
branches: 5.6% (67139 out of 1198228)

@ti-chi-bot ti-chi-bot merged commit 5325787 into pingcap:master Dec 7, 2021
@JaySon-Huang JaySon-Huang deleted the ps_v3_framework branch December 7, 2021 06:48
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/LGT1 Indicates that a PR has LGTM 1.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants