Skip to content

PageStorage: Fix lints on some files#3952

Merged
ti-chi-bot merged 11 commits intopingcap:masterfrom
JaySon-Huang:fix_ps_lint
Jan 27, 2022
Merged

PageStorage: Fix lints on some files#3952
ti-chi-bot merged 11 commits intopingcap:masterfrom
JaySon-Huang:fix_ps_lint

Conversation

@JaySon-Huang
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

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>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 27, 2022

[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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 27, 2022
@JaySon-Huang JaySon-Huang mentioned this pull request Jan 27, 2022
12 tasks
Signed-off-by: JaySon-Huang <tshent@qq.com>
// Legacy and checkpoint files will be removed from `page_files` after `tryCompact`.
LegacyCompactor compactor(*this, write_limiter, read_limiter);
PageFileSet page_files_to_archive;
auto files_to_compact = std::move(page_files);
Copy link
Contributor

Choose a reason for hiding this comment

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

just

PageFileSet page_files_rc;
std::tie(page_files_rc, page_files_to_archive, gc_context.num_bytes_written_in_compact_legacy)
            = compactor.tryCompact(std::move(page_files), writing_files_snapshot);

and use it in layer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

compactor.tryCompact will take the files_to_compact and split it into page_files, page_files_to_archive . And later in line 1075, we need to apply compactor.tryMigrate on the page_files.
So we can't use a page_files_rc that only live inside this block.

https://github.com/pingcap/tics/blob/a48d12bf2f364da13b03eca7de778e4acb318c3e/dbms/src/Storages/Page/V2/PageStorage.cpp#L1060-L1075

Signed-off-by: JaySon-Huang <tshent@qq.com>
NOLINTBEGIN only effective in clang-14

Signed-off-by: JaySon-Huang <tshent@qq.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 27, 2022
@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: 83dae16

@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
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Server/tests/gtest_server_config.cpp                               1660               289    82.59%          10                 0   100.00%         333                 3    99.10%         508               257    49.41%
Storages/Page/PageStorage.h                                          16                 8    50.00%          16                 8    50.00%          53                20    62.26%           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%         880               163    81.48%         350               144    58.86%
Storages/Page/V2/PageStorage.h                                       41                 9    78.05%          16                 3    81.25%          44                 3    93.18%          20                 9    55.00%
Storages/Page/V2/tests/gtest_data_compactor.cpp                     320                87    72.81%           1                 0   100.00%          83                 2    97.59%          98                46    53.06%
Storages/Page/V2/tests/gtest_page_storage_multi_writers.cpp         420               420     0.00%          22                22     0.00%         192               192     0.00%          94                94     0.00%
Storages/Transaction/RegionPersister.cpp                             85                25    70.59%          12                 2    83.33%         168                33    80.36%          46                21    54.35%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                              3407              1249    63.34%         146                59    59.59%        2440               915    62.50%        1380               775    43.84%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16270      9693             40.42%    177911  98228        44.79%

full coverage report (for internal network access only)

@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
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Server/tests/gtest_server_config.cpp                               1660               289    82.59%          10                 0   100.00%         333                 3    99.10%         508               257    49.41%
Storages/Page/PageStorage.h                                          16                 8    50.00%          16                 8    50.00%          53                20    62.26%           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%         880               163    81.48%         350               144    58.86%
Storages/Page/V2/PageStorage.h                                       41                 9    78.05%          16                 3    81.25%          44                 3    93.18%          20                 9    55.00%
Storages/Page/V2/tests/gtest_data_compactor.cpp                     320                87    72.81%           1                 0   100.00%          83                 2    97.59%          98                46    53.06%
Storages/Page/V2/tests/gtest_page_storage_multi_writers.cpp         420               420     0.00%          22                22     0.00%         192               192     0.00%          94                94     0.00%
Storages/Transaction/RegionPersister.cpp                             85                25    70.59%          12                 2    83.33%         168                33    80.36%          46                21    54.35%
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                              3407              1249    63.34%         146                59    59.59%        2440               915    62.50%        1380               775    43.84%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16270      9694             40.42%    177902  98229        44.78%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 997e42d into pingcap:master Jan 27, 2022
@JaySon-Huang JaySon-Huang deleted the fix_ps_lint branch January 27, 2022 14:29
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/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/LGT1 Indicates that a PR has LGTM 1.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants