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

Add a background metrics for both v2 and v3 #4593

Merged
merged 12 commits into from
Apr 21, 2022
Merged

Add a background metrics for both v2 and v3 #4593

merged 12 commits into from
Apr 21, 2022

Conversation

jiaqizho
Copy link
Contributor

@jiaqizho jiaqizho commented Apr 6, 2022

What problem does this PR solve?

Issue Number: ref #3594

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 Apr 6, 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 release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 6, 2022
@jiaqizho jiaqizho changed the title Add a background metrics for both v2 and v3 [WIP]Add a background metrics for both v2 and v3 Apr 6, 2022
@ti-chi-bot ti-chi-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 6, 2022
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 6, 2022
@jiaqizho
Copy link
Contributor Author

jiaqizho commented Apr 7, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Apr 7, 2022

Coverage for changed files

Filename                                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/ProfileEvents.cpp                           138                 0   100.00%           2                 0   100.00%          11                 0   100.00%           0                 0         -
Storages/Page/PageUtil.h                            95                16    83.16%           8                 0   100.00%         143                19    86.71%          60                19    68.33%
Storages/Page/V2/PageFile.cpp                      561               196    65.06%          55                 3    94.55%        1010               236    76.63%         378               147    61.11%
Storages/Page/V2/PageFile.h                         70                15    78.57%          31                 2    93.55%          92                27    70.65%          40                19    52.50%
Storages/Page/V2/gc/DataCompactor.cpp              216                84    61.11%          10                 0   100.00%         359               109    69.64%         140                70    50.00%
Storages/Page/V2/tests/gtest_page_util.cpp          83                23    72.29%           3                 0   100.00%          52                 4    92.31%          22                 9    59.09%
Storages/Page/V3/BlobFile.cpp                       29                10    65.52%           6                 1    83.33%          84                27    67.86%          16                 8    50.00%
Storages/Page/V3/BlobFile.h                          2                 0   100.00%           2                 0   100.00%           6                 0   100.00%           0                 0         -
Storages/Page/V3/BlobStore.cpp                     459               141    69.28%          49                 4    91.84%         983               227    76.91%         278               107    61.51%
Storages/Page/V3/BlobStore.h                         7                 1    85.71%           7                 1    85.71%          25                10    60.00%           0                 0         -
Storages/Page/V3/LogFile/LogWriter.cpp              50                 1    98.00%           8                 1    87.50%         109                 8    92.66%          32                 1    96.88%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                             1710               487    71.52%         181                12    93.37%        2874               667    76.79%         966               380    60.66%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17020      9515             44.10%    191836  96428        49.73%

full coverage report (for internal network access only)

@jiaqizho jiaqizho changed the title [WIP]Add a background metrics for both v2 and v3 Add a background metrics for both v2 and v3 Apr 8, 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 8, 2022
@jiaqizho
Copy link
Contributor Author

jiaqizho commented Apr 8, 2022

image

image

@JaySon-Huang for both v2 and v3 support,PTAL

@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 11, 2022
@jiaqizho
Copy link
Contributor Author

/run-all-tests

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

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 13, 2022
dbms/src/Storages/Page/V2/PageFile.cpp Show resolved Hide resolved
dbms/src/Storages/Page/V2/PageFile.cpp Show resolved Hide resolved
@@ -488,7 +492,7 @@ PageFile::MetaMergingReaderPtr PageFile::MetaMergingReader::createFrom(PageFile
// Try to initiallize access to meta, read the whole metadata to memory.
// Status -> Finished if metadata size is zero.
// -> Opened if metadata successfully load from disk.
void PageFile::MetaMergingReader::initialize(std::optional<size_t> max_meta_offset, const ReadLimiterPtr & read_limiter)
void PageFile::MetaMergingReader::initialize(std::optional<size_t> max_meta_offset, const ReadLimiterPtr & read_limiter, const bool background = false)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void PageFile::MetaMergingReader::initialize(std::optional<size_t> max_meta_offset, const ReadLimiterPtr & read_limiter, const bool background = false)
void PageFile::MetaMergingReader::initialize(std::optional<size_t> max_meta_offset, const ReadLimiterPtr & read_limiter, bool background = false)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why remove const here?

Copy link
Contributor

Choose a reason for hiding this comment

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

const on arguments that is passed by value is unuseful. But is't not a big deal.

@@ -184,7 +190,7 @@ class PageFile : public Allocator<false>
}

private:
void initialize(std::optional<size_t> max_meta_offset, const ReadLimiterPtr & read_limiter);
void initialize(std::optional<size_t> max_meta_offset, const ReadLimiterPtr & read_limiter, const bool background = false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
void initialize(std::optional<size_t> max_meta_offset, const ReadLimiterPtr & read_limiter, const bool background = false);
void initialize(std::optional<size_t> max_meta_offset, const ReadLimiterPtr & read_limiter, bool background = false);

@jiaqizho
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Apr 15, 2022

Coverage for changed files

Filename                                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/ProfileEvents.cpp                           138                 0   100.00%           2                 0   100.00%          11                 0   100.00%           0                 0         -
Storages/Page/PageUtil.h                            95                16    83.16%           8                 0   100.00%         143                19    86.71%          60                19    68.33%
Storages/Page/V2/PageFile.cpp                      561               196    65.06%          55                 3    94.55%        1010               236    76.63%         378               147    61.11%
Storages/Page/V2/PageFile.h                         70                15    78.57%          31                 2    93.55%          92                27    70.65%          40                19    52.50%
Storages/Page/V2/gc/DataCompactor.cpp              216                84    61.11%          10                 0   100.00%         359               109    69.64%         140                70    50.00%
Storages/Page/V2/gc/LegacyCompactor.cpp            133                87    34.59%           8                 3    62.50%         199               107    46.23%          96                72    25.00%
Storages/Page/V2/tests/gtest_page_util.cpp          83                23    72.29%           3                 0   100.00%          52                 4    92.31%          22                 9    59.09%
Storages/Page/V3/BlobFile.cpp                       29                10    65.52%           6                 1    83.33%          84                27    67.86%          16                 8    50.00%
Storages/Page/V3/BlobFile.h                          2                 0   100.00%           2                 0   100.00%           6                 0   100.00%           0                 0         -
Storages/Page/V3/BlobStore.cpp                     438               136    68.95%          49                 5    89.80%         952               241    74.68%         274               106    61.31%
Storages/Page/V3/BlobStore.h                         7                 1    85.71%           7                 1    85.71%          25                10    60.00%           0                 0         -
Storages/Page/V3/LogFile/LogWriter.cpp              50                 1    98.00%           8                 1    87.50%         109                 8    92.66%          32                 1    96.88%
Storages/Page/V3/LogFile/LogWriter.h                 1                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
Storages/Page/V3/WALStore.cpp                       81                46    43.21%           9                 2    77.78%         147                55    62.59%          36                19    47.22%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                             1904               615    67.70%         199                18    90.95%        3192               843    73.59%        1094               470    57.04%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17023      9511             44.13%    191880  96446        49.74%

full coverage report (for internal network access only)

@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 Apr 15, 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: ac2d71c

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 21, 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 Apr 21, 2022

Coverage for changed files

Filename                                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Common/ProfileEvents.cpp                           138                 0   100.00%           2                 0   100.00%          11                 0   100.00%           0                 0         -
Storages/Page/PageUtil.h                            95                16    83.16%           8                 0   100.00%         143                19    86.71%          60                19    68.33%
Storages/Page/V2/PageFile.cpp                      561               196    65.06%          55                 3    94.55%        1010               236    76.63%         378               147    61.11%
Storages/Page/V2/PageFile.h                         70                15    78.57%          31                 2    93.55%          92                27    70.65%          40                19    52.50%
Storages/Page/V2/gc/DataCompactor.cpp              216                84    61.11%          10                 0   100.00%         359               109    69.64%         140                70    50.00%
Storages/Page/V2/gc/LegacyCompactor.cpp            133                87    34.59%           8                 3    62.50%         199               107    46.23%          96                72    25.00%
Storages/Page/V2/tests/gtest_page_util.cpp          83                23    72.29%           3                 0   100.00%          52                 4    92.31%          22                 9    59.09%
Storages/Page/V3/BlobFile.cpp                       29                10    65.52%           6                 1    83.33%          84                27    67.86%          16                 8    50.00%
Storages/Page/V3/BlobFile.h                          2                 0   100.00%           2                 0   100.00%           6                 0   100.00%           0                 0         -
Storages/Page/V3/BlobStore.cpp                     438               136    68.95%          49                 5    89.80%         953               241    74.71%         274               106    61.31%
Storages/Page/V3/BlobStore.h                         7                 1    85.71%           7                 1    85.71%          25                10    60.00%           0                 0         -
Storages/Page/V3/LogFile/LogWriter.cpp              50                 1    98.00%           8                 1    87.50%         109                 8    92.66%          32                 1    96.88%
Storages/Page/V3/LogFile/LogWriter.h                 1                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
Storages/Page/V3/WALStore.cpp                       81                46    43.21%           9                 2    77.78%         147                55    62.59%          36                19    47.22%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                             1904               615    67.70%         199                18    90.95%        3193               843    73.60%        1094               470    57.04%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17132      9492             44.59%    192864  96266        50.09%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit ebb28dc into pingcap:master Apr 21, 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/L Denotes a PR that changes 100-499 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.

5 participants