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

Fix max_caps may not been update after GC #4323

Merged
merged 9 commits into from
Mar 21, 2022
Merged

Fix max_caps may not been update after GC #4323

merged 9 commits into from
Mar 21, 2022

Conversation

jiaqizho
Copy link
Contributor

@jiaqizho jiaqizho commented Mar 17, 2022

Signed-off-by: jiaqizho [email protected]

What problem does this PR solve?

Issue Number: ref #3594

Problem Summary:

  1. we need to update sm_max_caps after removing the position from the blob.
  2. also need to call recalculateCapability after restore.

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 Mar 17, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CalvinNeo
  • 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 do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. labels Mar 17, 2022
@jiaqizho jiaqizho requested a review from JaySon-Huang March 17, 2022 06:57
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 17, 2022
@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 Mar 17, 2022
Signed-off-by: jiaqizho <[email protected]>
dbms/src/Storages/Page/V3/spacemap/SpaceMap.h Outdated Show resolved Hide resolved
dbms/src/Storages/Page/V3/BlobStore.h Outdated Show resolved Hide resolved
dbms/src/Storages/Page/V3/BlobStore.h Outdated Show resolved Hide resolved
dbms/src/Storages/Page/V3/BlobStore.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/Page/V3/BlobStore.cpp Outdated Show resolved Hide resolved
Signed-off-by: jiaqizho <[email protected]>
@jiaqizho jiaqizho requested a review from CalvinNeo March 18, 2022 05:22
Signed-off-by: jiaqizho <[email protected]>
@JaySon-Huang
Copy link
Contributor

Seems existing_file_ids in restore is not needed after #4247

void BlobStore::BlobStats::restore()
{
BlobFileId max_restored_file_id = 0;
std::set<BlobFileId> existing_file_ids;
for (const auto & stat : stats_map)
{
stat->recalculateSpaceMap();
max_restored_file_id = std::max(stat->id, max_restored_file_id);
existing_file_ids.insert(stat->id);
}
// restore `roll_id`
roll_id = max_restored_file_id + 1;
}

@jiaqizho
Copy link
Contributor Author

Seems existing_file_ids in restore is not needed after #4247

void BlobStore::BlobStats::restore()
{
BlobFileId max_restored_file_id = 0;
std::set<BlobFileId> existing_file_ids;
for (const auto & stat : stats_map)
{
stat->recalculateSpaceMap();
max_restored_file_id = std::max(stat->id, max_restored_file_id);
existing_file_ids.insert(stat->id);
}
// restore `roll_id`
roll_id = max_restored_file_id + 1;
}

removed existing_file_ids

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 with nit comment

dbms/src/Storages/Page/V3/spacemap/SpaceMapSTDMap.h Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 21, 2022
Copy link
Member

@CalvinNeo CalvinNeo 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 Mar 21, 2022
@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: 7ba4e7b

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

sre-bot commented Mar 21, 2022

Coverage for changed files

Filename                        Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BlobStore.cpp                       358               112    68.72%          39                 3    92.31%         769               206    73.21%         224                89    60.27%
BlobStore.h                           7                 1    85.71%           7                 1    85.71%          25                10    60.00%           0                 0         -
spacemap/SpaceMap.h                   7                 2    71.43%           4                 1    75.00%          18                 5    72.22%           6                 1    83.33%
spacemap/SpaceMapRBTree.cpp         341                82    75.95%          18                 1    94.44%         566               114    79.86%         202                64    68.32%
spacemap/SpaceMapRBTree.h             2                 0   100.00%           2                 0   100.00%           5                 0   100.00%           0                 0         -
spacemap/SpaceMapSTDMap.h           143                11    92.31%          11                 0   100.00%         245                20    91.84%          92                18    80.43%
tests/gtest_blob_store.cpp         3548               590    83.37%          17                 0   100.00%         686                 0   100.00%        1102               520    52.81%
tests/gtest_free_map.cpp           1848               309    83.28%          12                 0   100.00%         241                 0   100.00%         616               308    50.00%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                              6254              1107    82.30%         110                 6    94.55%        2555               355    86.11%        2242              1000    55.40%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16926      9502             43.86%    190721  96488        49.41%

full coverage report (for internal network access only)

@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

@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 Mar 21, 2022

Coverage for changed files

Filename                        Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BlobStore.cpp                       361               113    68.70%          39                 3    92.31%         777               209    73.10%         224                89    60.27%
BlobStore.h                           7                 1    85.71%           7                 1    85.71%          25                10    60.00%           0                 0         -
spacemap/SpaceMap.h                   7                 2    71.43%           4                 1    75.00%          18                 5    72.22%           6                 1    83.33%
spacemap/SpaceMapRBTree.cpp         341                82    75.95%          18                 1    94.44%         566               114    79.86%         202                64    68.32%
spacemap/SpaceMapRBTree.h             2                 0   100.00%           2                 0   100.00%           5                 0   100.00%           0                 0         -
spacemap/SpaceMapSTDMap.h           143                11    92.31%          11                 0   100.00%         245                20    91.84%          92                18    80.43%
tests/gtest_blob_store.cpp         3548               590    83.37%          17                 0   100.00%         686                 0   100.00%        1102               520    52.81%
tests/gtest_free_map.cpp           1848               309    83.28%          12                 0   100.00%         241                 0   100.00%         616               308    50.00%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                              6257              1108    82.29%         110                 6    94.55%        2563               358    86.03%        2242              1000    55.40%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17020      9573             43.75%    191706  97053        49.37%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit f2d36c1 into pingcap:master Mar 21, 2022
@JaySon-Huang JaySon-Huang deleted the fix-max-caps branch March 21, 2022 06:24
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