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

Implememt pagestorage v3 #3909

Merged
merged 7 commits into from
Jan 28, 2022
Merged

Implememt pagestorage v3 #3909

merged 7 commits into from
Jan 28, 2022

Conversation

jiaqizho
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

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

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 20, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang

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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 20, 2022
@jiaqizho jiaqizho mentioned this pull request Jan 20, 2022
12 tasks
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 25, 2022
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.

Mostly LGTM, wait before #3908 merge and rebase.

@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 26, 2022
@jiaqizho
Copy link
Contributor Author

Mostly LGTM, wait before #3908 merge and rebase.

@JaySon-Huang done

@JaySon-Huang JaySon-Huang mentioned this pull request Jan 26, 2022
12 tasks
@@ -24,43 +26,46 @@ class PageStorageImpl : public DB::PageStorage

PageId getMaxId() override;

PageId getNormalPageId(PageId page_id, SnapshotPtr snapshot) override;
PageId getNormalPageId(PageId page_id, SnapshotPtr snapshot = {}) override;
Copy link
Contributor

@JaySon-Huang JaySon-Huang Jan 26, 2022

Choose a reason for hiding this comment

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

Using default value in a virtual/override function is not a good idea. It may cause problem if the default value is different.

However, I'll mark it in the TODO list and refactor it in the following PRs.

Example for causing confusing result:

>  cat a.cpp
#include <iostream>
#include <memory>

struct A {
    virtual void f(int x=999) {
        std::cout << "A::f() called with x=" << x << "\n";
    }
};

struct B : public A {
    void f(int x=100) override {
        std::cout << "B::f() called with x=" << x << "\n";
    }
};

struct C: public A {};

int main()
{
    std::unique_ptr<A> base_ptr_to_a = std::make_unique<A>();
    base_ptr_to_a->f();
    std::unique_ptr<A> base_ptr_to_b = std::make_unique<B>();
    base_ptr_to_b->f();
    std::unique_ptr<B> ptr_to_b = std::make_unique<B>();
    ptr_to_b->f();
}

>  g++ a.cpp -std=c++17 && ./a.out
A::f() called with x=999
B::f() called with x=999
B::f() called with x=100

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 26, 2022
@JaySon-Huang
Copy link
Contributor

/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: 3eed30c3d61eb4d9f6d6f75610c5ec55f54359f2

@ti-chi-bot ti-chi-bot added status/can-merge Indicates a PR has been approved by a committer. and removed status/can-merge Indicates a PR has been approved by a committer. labels Jan 26, 2022
@JaySon-Huang
Copy link
Contributor

/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: 8ce9bbc3eeff4828c8391c7ee1d5d8b7e64687ab

@ti-chi-bot ti-chi-bot added status/can-merge Indicates a PR has been approved by a committer. and removed status/can-merge Indicates a PR has been approved by a committer. labels Jan 26, 2022
@JaySon-Huang
Copy link
Contributor

/run-unit-test

1 similar comment
@JaySon-Huang
Copy link
Contributor

/run-unit-test

@sre-bot
Copy link
Collaborator

sre-bot commented Jan 26, 2022

Coverage for changed files

Filename                                            Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/tests/gtest_cpu_affinity_manager.cpp             454               120    73.57%           3                 0   100.00%          83                 0   100.00%         126                60    52.38%
Storages/Page/PageStorage.h                              15                 8    46.67%          15                 8    46.67%          52                20    61.54%           0                 0         -
Storages/Page/V1/PageStorage.cpp                        337               257    23.74%          23                13    43.48%         677               491    27.47%         264               204    22.73%
Storages/Page/V1/PageStorage.h                           10                 8    20.00%          10                 8    20.00%          10                 8    20.00%           0                 0         -
Storages/Page/V2/PageStorage.cpp                        518               146    71.81%          36                 3    91.67%         879               163    81.46%         350               144    58.86%
Storages/Page/V2/PageStorage.h                           33                 7    78.79%           8                 1    87.50%          36                 1    97.22%          20                 9    55.00%
Storages/Page/V3/BlobStore.cpp                          308               111    63.96%          34                 6    82.35%         676               218    67.75%         190                82    56.84%
Storages/Page/V3/PageDirectory.cpp                      182                38    79.12%          23                 3    86.96%         427                84    80.33%         136                33    75.74%
Storages/Page/V3/PageDirectory.h                         16                 4    75.00%          14                 4    71.43%          52                15    71.15%           2                 1    50.00%
Storages/Page/V3/PageStorageImpl.cpp                     70                27    61.43%          18                 9    50.00%         163                75    53.99%          40                24    40.00%
Storages/Page/V3/WALStore.cpp                            70                 4    94.29%           7                 0   100.00%         123                 0   100.00%          34                 7    79.41%
Storages/Page/V3/tests/gtest_page_directory.cpp        4001               660    83.50%          23                 0   100.00%         745                 0   100.00%        1270               632    50.24%
Storages/Page/V3/tests/gtest_page_storage.cpp          2337               884    62.17%          28                 8    71.43%         641               161    74.88%         750               454    39.47%
TestUtils/MockDiskDelegator.h                            18                 8    55.56%          16                 7    56.25%          47                18    61.70%           2                 1    50.00%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                  8369              2282    72.73%         258                70    72.87%        4611              1254    72.80%        3184              1651    48.15%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16296      9697             40.49%    178663  98369        44.94%

full coverage report (for internal network access only)

@JaySon-Huang
Copy link
Contributor

We have to resolve the clang-tidy check before merging this PR
https://ci.pingcap.net/blue/organizations/jenkins/tics_ghpr_build/detail/tics_ghpr_build/8383/pipeline

@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: 94534e7b07996973b77a1067304fcb4b0b7776a2

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

sre-bot commented Jan 27, 2022

Coverage for changed files

Filename                                            Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/tests/gtest_cpu_affinity_manager.cpp             454               120    73.57%           3                 0   100.00%          83                 0   100.00%         126                60    52.38%
Storages/Page/PageStorage.h                              15                 8    46.67%          15                 8    46.67%          52                20    61.54%           0                 0         -
Storages/Page/V1/PageStorage.cpp                        337               257    23.74%          23                13    43.48%         677               491    27.47%         264               204    22.73%
Storages/Page/V1/PageStorage.h                           10                 8    20.00%          10                 8    20.00%          10                 8    20.00%           0                 0         -
Storages/Page/V2/PageStorage.cpp                        518               146    71.81%          36                 3    91.67%         879               163    81.46%         350               144    58.86%
Storages/Page/V2/PageStorage.h                           33                 7    78.79%           8                 1    87.50%          36                 1    97.22%          20                 9    55.00%
Storages/Page/V3/BlobStore.cpp                          308               111    63.96%          34                 6    82.35%         676               218    67.75%         190                82    56.84%
Storages/Page/V3/PageDirectory.cpp                      182                38    79.12%          23                 3    86.96%         427                84    80.33%         136                33    75.74%
Storages/Page/V3/PageDirectory.h                         16                 4    75.00%          14                 4    71.43%          52                15    71.15%           2                 1    50.00%
Storages/Page/V3/PageStorageImpl.cpp                     70                27    61.43%          18                 9    50.00%         163                75    53.99%          40                24    40.00%
Storages/Page/V3/WALStore.cpp                            70                 4    94.29%           7                 0   100.00%         123                 0   100.00%          34                 7    79.41%
Storages/Page/V3/tests/gtest_page_directory.cpp        4001               660    83.50%          23                 0   100.00%         745                 0   100.00%        1270               632    50.24%
Storages/Page/V3/tests/gtest_page_storage.cpp          2337               884    62.17%          28                 8    71.43%         641               161    74.88%         750               454    39.47%
TestUtils/MockDiskDelegator.h                            18                 8    55.56%          16                 7    56.25%          47                18    61.70%           2                 1    50.00%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                  8369              2282    72.73%         258                70    72.87%        4611              1254    72.80%        3184              1651    48.15%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16296      9698             40.49%    178663  98414        44.92%

full coverage report (for internal network access only)

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

sre-bot commented Jan 27, 2022

Coverage for changed files

Filename                                            Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/tests/gtest_cpu_affinity_manager.cpp             454               120    73.57%           3                 0   100.00%          83                 0   100.00%         126                60    52.38%
Storages/Page/PageStorage.h                              15                 8    46.67%          15                 8    46.67%          52                20    61.54%           0                 0         -
Storages/Page/V1/PageStorage.cpp                        337               257    23.74%          23                13    43.48%         677               491    27.47%         264               204    22.73%
Storages/Page/V1/PageStorage.h                           10                 8    20.00%          10                 8    20.00%          10                 8    20.00%           0                 0         -
Storages/Page/V2/PageStorage.cpp                        518               146    71.81%          36                 3    91.67%         879               163    81.46%         350               144    58.86%
Storages/Page/V2/PageStorage.h                           33                 7    78.79%           8                 1    87.50%          36                 1    97.22%          20                 9    55.00%
Storages/Page/V3/BlobStore.cpp                          308               111    63.96%          34                 6    82.35%         676               218    67.75%         190                82    56.84%
Storages/Page/V3/PageDirectory.cpp                      182                38    79.12%          23                 3    86.96%         427                84    80.33%         136                33    75.74%
Storages/Page/V3/PageDirectory.h                         16                 4    75.00%          14                 4    71.43%          52                15    71.15%           2                 1    50.00%
Storages/Page/V3/PageStorageImpl.cpp                     70                27    61.43%          18                 9    50.00%         163                75    53.99%          40                24    40.00%
Storages/Page/V3/WALStore.cpp                            70                 4    94.29%           7                 0   100.00%         123                 0   100.00%          34                 7    79.41%
Storages/Page/V3/tests/gtest_page_directory.cpp        4001               660    83.50%          23                 0   100.00%         745                 0   100.00%        1270               632    50.24%
Storages/Page/V3/tests/gtest_page_storage.cpp          2337               884    62.17%          28                 8    71.43%         641               161    74.88%         750               454    39.47%
TestUtils/MockDiskDelegator.h                            18                 8    55.56%          16                 7    56.25%          47                18    61.70%           2                 1    50.00%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                  8369              2282    72.73%         258                70    72.87%        4611              1254    72.80%        3184              1651    48.15%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16307      9703             40.50%    178692  98445        44.91%

full coverage report (for internal network access only)

@JaySon-Huang
Copy link
Contributor

JaySon-Huang commented Jan 27, 2022

/hold
for splitting out refactor on V1/V2 #3952

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 27, 2022
jiaqizho and others added 7 commits January 27, 2022 23:03
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@JaySon-Huang
Copy link
Contributor

/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: 5fd7c35

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

sre-bot commented Jan 28, 2022

Coverage for changed files

Filename                                            Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/tests/gtest_cpu_affinity_manager.cpp             454               120    73.57%           3                 0   100.00%          83                 0   100.00%         126                60    52.38%
Storages/Page/V3/BlobStore.cpp                          305               108    64.59%          34                 6    82.35%         667               209    68.67%         188                80    57.45%
Storages/Page/V3/PageDirectory.cpp                      182                38    79.12%          23                 3    86.96%         427                84    80.33%         136                33    75.74%
Storages/Page/V3/PageDirectory.h                         16                 4    75.00%          14                 4    71.43%          52                15    71.15%           2                 1    50.00%
Storages/Page/V3/PageStorageImpl.cpp                     70                27    61.43%          18                 9    50.00%         163                75    53.99%          40                24    40.00%
Storages/Page/V3/PageStorageImpl.h                        8                 4    50.00%           8                 4    50.00%           8                 4    50.00%           0                 0         -
Storages/Page/V3/WALStore.cpp                            70                 4    94.29%           7                 0   100.00%         123                 0   100.00%          34                 7    79.41%
Storages/Page/V3/tests/gtest_page_directory.cpp        4001               660    83.50%          23                 0   100.00%         745                 0   100.00%        1270               632    50.24%
Storages/Page/V3/tests/gtest_page_storage.cpp          2337               884    62.17%          28                 8    71.43%         641               161    74.88%         750               454    39.47%
TestUtils/MockDiskDelegator.h                            18                 8    55.56%          16                 7    56.25%          47                18    61.70%           2                 1    50.00%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                  7461              1857    75.11%         174                41    76.44%        2956               566    80.85%        2548              1292    49.29%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16344      9707             40.61%    179163  98360        45.10%

full coverage report (for internal network access only)

@JaySon-Huang
Copy link
Contributor

/unhold

@ti-chi-bot ti-chi-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 28, 2022
@ti-chi-bot ti-chi-bot merged commit fe880ee into pingcap:master Jan 28, 2022
@JaySon-Huang JaySon-Huang deleted the ps-v3-combine-split branch January 28, 2022 02:20
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