Skip to content

Optimization of SegmentReadTaskPool::getTask#6097

Merged
ti-chi-bot merged 2 commits intopingcap:masterfrom
JinheLin:refine_seg_read_task
Oct 14, 2022
Merged

Optimization of SegmentReadTaskPool::getTask#6097
ti-chi-bot merged 2 commits intopingcap:masterfrom
JinheLin:refine_seg_read_task

Conversation

@JinheLin
Copy link
Contributor

@JinheLin JinheLin commented Oct 10, 2022

What problem does this PR solve?

Issue Number: ref #6092

Problem Summary:
SegmentReadTaskPool::getTask(UInt64 segment_id) need to scan a std::list to get a task with certain segment_id.

What is changed and how it works?

  • Use std::unordered_map to index tasks by segment ID if read thread enabled.
  • Still support in-order dequeue if read thread disabled (keep-order is required).

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 Oct 10, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang
  • Lloyd-Pottiger

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 10, 2022
@JinheLin
Copy link
Contributor Author

/run-all-tests

@JinheLin JinheLin force-pushed the refine_seg_read_task branch from a9f5507 to 0fc3ec3 Compare October 11, 2022 04:09
@JinheLin
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Oct 11, 2022

Coverage for changed files

Filename                                    Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DeltaMergeStore.cpp                             810               106    86.91%          44                 2    95.45%        1160               182    84.31%         436               131    69.95%
ReadThread/SegmentReadTaskScheduler.cpp         113                34    69.91%          11                 0   100.00%         181                24    86.74%          58                17    70.69%
SegmentReadTaskPool.cpp                         169                50    70.41%          27                 2    92.59%         235                48    79.57%          78                27    65.38%
SegmentReadTaskPool.h                            34                 1    97.06%          15                 1    93.33%          57                 3    94.74%           8                 1    87.50%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          1126               191    83.04%          97                 5    94.85%        1633               257    84.26%         580               176    69.66%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18394      7443             59.54%    215543  76462        64.53%

full coverage report (for internal network access only)

@JinheLin
Copy link
Contributor Author

/run-all-tests

@JinheLin JinheLin force-pushed the refine_seg_read_task branch from 0fc3ec3 to 573f7bb Compare October 11, 2022 07:37
@sre-bot
Copy link
Collaborator

sre-bot commented Oct 11, 2022

Coverage for changed files

Filename                                    Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DeltaMergeStore.cpp                             810               106    86.91%          44                 2    95.45%        1160               182    84.31%         436               131    69.95%
ReadThread/SegmentReadTaskScheduler.cpp         113                34    69.91%          11                 0   100.00%         181                24    86.74%          58                17    70.69%
SegmentReadTaskPool.cpp                         169                50    70.41%          27                 2    92.59%         235                48    79.57%          78                27    65.38%
SegmentReadTaskPool.h                            34                 1    97.06%          15                 1    93.33%          57                 3    94.74%           8                 1    87.50%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          1126               191    83.04%          97                 5    94.85%        1633               257    84.26%         580               176    69.66%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18394      7443             59.54%    215543  76429        64.54%

full coverage report (for internal network access only)

@JinheLin
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Oct 11, 2022

Coverage for changed files

Filename                                    Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DeltaMergeStore.cpp                             810               106    86.91%          44                 2    95.45%        1160               182    84.31%         436               131    69.95%
ReadThread/SegmentReadTaskScheduler.cpp         113                34    69.91%          11                 0   100.00%         181                24    86.74%          58                17    70.69%
SegmentReadTaskPool.cpp                         169                50    70.41%          27                 2    92.59%         235                48    79.57%          78                27    65.38%
SegmentReadTaskPool.h                            34                 1    97.06%          15                 1    93.33%          57                 3    94.74%           8                 1    87.50%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          1126               191    83.04%          97                 5    94.85%        1633               257    84.26%         580               176    69.66%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18394      7442             59.54%    215543  76436        64.54%

full coverage report (for internal network access only)

@lidezhu lidezhu force-pushed the refine_seg_read_task branch from 573f7bb to 9168573 Compare October 11, 2022 09:11
@JinheLin JinheLin self-assigned this Oct 11, 2022
@JinheLin JinheLin force-pushed the refine_seg_read_task branch from 9168573 to 1c8478f Compare October 12, 2022 04:02
@JinheLin
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Oct 12, 2022

Coverage for changed files

Filename                                    Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DeltaMergeStore.cpp                             810               106    86.91%          44                 2    95.45%        1160               182    84.31%         436               133    69.50%
ReadThread/SegmentReadTaskScheduler.cpp         113                34    69.91%          11                 0   100.00%         181                24    86.74%          58                17    70.69%
SegmentReadTaskPool.cpp                         169                47    72.19%          27                 2    92.59%         235                45    80.85%          78                24    69.23%
SegmentReadTaskPool.h                            34                 1    97.06%          15                 1    93.33%          57                 3    94.74%           8                 1    87.50%
tests/gtest_segment_read_task_pool.cpp           23                 0   100.00%           5                 0   100.00%          63                 0   100.00%           6                 0   100.00%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          1149               188    83.64%         102                 5    95.10%        1696               254    85.02%         586               175    70.14%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18365      7408             59.66%    215388  76231        64.61%

full coverage report (for internal network access only)

@JinheLin JinheLin marked this pull request as ready for review October 12, 2022 06:27
@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 Oct 12, 2022
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 13, 2022
Copy link
Contributor

@Lloyd-Pottiger Lloyd-Pottiger left a comment

Choose a reason for hiding this comment

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

Others LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 14, 2022
@JinheLin JinheLin force-pushed the refine_seg_read_task branch from a8eea20 to 2c24319 Compare October 14, 2022 06:23
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2022
@ti-chi-bot ti-chi-bot removed the status/LGT1 Indicates that a PR has LGTM 1. label Oct 14, 2022
@ti-chi-bot ti-chi-bot added the status/LGT2 Indicates that a PR has LGTM 2. label Oct 14, 2022
@JinheLin
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@JinheLin: 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: 2c24319

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 14, 2022
@JinheLin
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@JinheLin: 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.

@JinheLin
Copy link
Contributor Author

/build

@JinheLin
Copy link
Contributor Author

/run-integration-test

@ti-chi-bot ti-chi-bot merged commit ab8ff88 into pingcap:master Oct 14, 2022
@JinheLin JinheLin deleted the refine_seg_read_task branch October 20, 2022 08:57
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