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: Report the file usage of BlobStore #4999

Merged
merged 11 commits into from
May 27, 2022

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented May 25, 2022

Signed-off-by: JaySon-Huang tshent@qq.com

What problem does this PR solve?

Issue Number: close #4922

Problem Summary: Report the file size, valid data size, file num of all PageStorage instances in a TiFlash node

What is changed and how it works?

  • Report the file size, valid data size, file num of all PageStorage instances in AsynchronousMetrics::update
  • Show the file size, valid data size and file num in Grafana
  • Move "PageStorage Blob Status" into "StoragePool"

Check List

Tests

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 May 25, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

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

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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 25, 2022
JaySon-Huang and others added 3 commits May 27, 2022 14:18
Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 27, 2022
@JaySon-Huang JaySon-Huang changed the title [WIP]PageStorage: Report the file usage of BlobStore PageStorage: Report the file usage of BlobStore May 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 May 27, 2022
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@flowbehappy flowbehappy self-requested a review May 27, 2022 08:18
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 27, 2022
dbms/src/Interpreters/AsynchronousMetrics.cpp Outdated Show resolved Hide resolved
else
{
// Else the stat may being updated, acquire a lock to avoid data race.
auto lock = stat->lock();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this lock be removed? we mat not need an exact value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Running under TSan may complain about that
  2. We want a consistent value that total_size > valid size. Without lock, we may meet total_size < valid size, which is confusing
  3. The frequency of calling getFileUsageStatistics is very low, call it only once every 30s

So I would rather keep the lock here

Copy link
Contributor

Choose a reason for hiding this comment

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

okay

dbms/src/Storages/Page/V3/BlobStore.cpp Show resolved Hide resolved
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. label May 27, 2022
Copy link
Contributor

@jiaqizho jiaqizho 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 27, 2022
Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@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.

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: a0dcfc7

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

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

@JaySon-Huang
Copy link
Contributor Author

/run-unit-test

@sre-bot
Copy link
Collaborator

sre-bot commented May 27, 2022

Coverage for changed files

Filename                            Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DeltaMerge/StoragePool.h                 11                 1    90.91%          11                 1    90.91%          31                 9    70.97%           0                 0         -
Page/PageStorage.cpp                    149                38    74.50%          50                10    80.00%         410               112    72.68%         108                30    72.22%
Page/PageStorage.h                       20                 3    85.00%          20                 3    85.00%          88                 7    92.05%           0                 0         -
Page/Snapshot.h                           6                 0   100.00%           6                 0   100.00%          12                 0   100.00%           0                 0         -
Page/V3/BlobStore.cpp                   585               155    73.50%          54                 2    96.30%        1169               257    78.02%         370               134    63.78%
Page/V3/BlobStore.h                      12                 2    83.33%          10                 2    80.00%          50                23    54.00%           2                 0   100.00%
Page/V3/PageStorageImpl.cpp             135                32    76.30%          25                 6    76.00%         296                52    82.43%          72                22    69.44%
Page/V3/PageStorageImpl.h                 8                 2    75.00%           8                 2    75.00%          22                 2    90.91%           0                 0         -
Transaction/KVStore.h                     6                 4    33.33%           6                 4    33.33%           8                 6    25.00%           0                 0         -
Transaction/RegionPersister.cpp         160                80    50.00%          16                 3    81.25%         300               121    59.67%          84                46    45.24%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                  1092               317    70.97%         206                33    83.98%        2386               589    75.31%         636               232    63.52%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18285      9793             46.44%    204852  98176        52.07%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit d1ecebd into pingcap:master May 27, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #5027.

@JaySon-Huang JaySon-Huang deleted the add_blob_usage branch May 27, 2022 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. 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.

Show the file usage of PageStorage V3 in Grafana
5 participants