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

Use read tso instead of threrad ID in 'DBGInvoke search_log_for_key' #5715

Merged
merged 3 commits into from
Aug 29, 2022

Conversation

JinheLin
Copy link
Contributor

@JinheLin JinheLin commented Aug 26, 2022

What problem does this PR solve?

Issue Number: close #5718

Problem Summary:

  • DBGInvoke search_log_for_key uses thread ID to search log of a request, but the feature of read thread pool of storage breaks relative assumption.
  • Add read tso in req_id and use read tso to search log is more reasonable.

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 Aug 26, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Lloyd-Pottiger
  • 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 do-not-merge/needs-linked-issue 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 26, 2022
@JinheLin
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 26, 2022

Coverage for changed files

Filename                           Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/dbgFuncMisc.cpp                   38                38     0.00%           3                 3     0.00%          63                63     0.00%          28                28     0.00%
Storages/StorageDeltaMerge.cpp         708               331    53.25%          58                26    55.17%        1313               728    44.55%         364               233    35.99%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                  746               369    50.54%          61                29    52.46%        1376               791    42.51%         392               261    33.42%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18419      8327             54.79%    212987  85977        59.63%

full coverage report (for internal network access only)

@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 Aug 26, 2022
@JinheLin
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Aug 26, 2022

Coverage for changed files

Filename                           Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/dbgFuncMisc.cpp                   38                38     0.00%           3                 3     0.00%          63                63     0.00%          28                28     0.00%
Storages/StorageDeltaMerge.cpp         708               331    53.25%          58                26    55.17%        1313               728    44.55%         364               233    35.99%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                  746               369    50.54%          61                29    52.46%        1376               791    42.51%         392               261    33.42%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18419      8328             54.79%    212987  85970        59.64%

full coverage report (for internal network access only)

@JinheLin JinheLin marked this pull request as ready for review August 27, 2022 09:02
@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 Aug 27, 2022
@JinheLin JinheLin self-assigned this Aug 27, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 29, 2022
Copy link
Contributor

@lidezhu lidezhu 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 Aug 29, 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.

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: 860824c

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

sre-bot commented Aug 29, 2022

Coverage for changed files

Filename                           Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/dbgFuncMisc.cpp                   38                38     0.00%           3                 3     0.00%          63                63     0.00%          28                28     0.00%
Storages/StorageDeltaMerge.cpp         712               335    52.95%          59                27    54.24%        1320               735    44.32%         366               235    35.79%
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                  750               373    50.27%          62                30    51.61%        1383               798    42.30%         394               263    33.25%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18430      8331             54.80%    213129  86013        59.64%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit 7857124 into pingcap:master Aug 29, 2022
@JinheLin JinheLin mentioned this pull request Aug 30, 2022
12 tasks
@@ -646,7 +646,8 @@ BlockInputStreams StorageDeltaMerge::read(
throw Exception("TMTContext is not initialized", ErrorCodes::LOGICAL_ERROR);

const auto & mvcc_query_info = *query_info.mvcc_query_info;
auto tracing_logger = Logger::get("StorageDeltaMerge", log->identifier(), query_info.req_id);
auto req_id = fmt::format("{} read_tso={}", query_info.req_id, mvcc_query_info.read_tso);
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding read_tso={} make it too verbose for logging ....

[2022/09/06 17:05:28.830 +08:00] [DEBUG] [Segment.cpp:1470] ["Segment:<segment_id=146 epoch=17> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Begin segment getReadInfo"] [thread_id=89]
[2022/09/06 17:05:28.831 +08:00] [DEBUG] [Segment.cpp:1470] ["Segment:<segment_id=1 epoch=32> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Begin segment getReadInfo"] [thread_id=90]
[2022/09/06 17:05:28.831 +08:00] [DEBUG] [Segment.cpp:1470] ["Segment:<segment_id=146 epoch=17> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Begin segment getReadInfo"] [thread_id=91]
[2022/09/06 17:05:28.831 +08:00] [DEBUG] [Segment.cpp:1485] ["Segment:<segment_id=1 epoch=32> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Finish segment getReadInfo"] [thread_id=90]
[2022/09/06 17:05:28.831 +08:00] [DEBUG] [Segment.cpp:1470] ["Segment:<segment_id=149 epoch=14> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Begin segment getReadInfo"] [thread_id=92]
[2022/09/06 17:05:28.831 +08:00] [DEBUG] [Segment.cpp:1470] ["Segment:<segment_id=149 epoch=14> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Begin segment getReadInfo"] [thread_id=93]
[2022/09/06 17:05:28.832 +08:00] [DEBUG] [Segment.cpp:1485] ["Segment:<segment_id=149 epoch=14> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Finish segment getReadInfo"] [thread_id=92]
[2022/09/06 17:05:28.832 +08:00] [DEBUG] [Segment.cpp:1470] ["Segment:<segment_id=146 epoch=17> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Begin segment getReadInfo"] [thread_id=94]
[2022/09/06 17:05:28.832 +08:00] [DEBUG] [Segment.cpp:1485] ["Segment:<segment_id=149 epoch=14> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Finish segment getReadInfo"] [thread_id=93]
[2022/09/06 17:05:28.832 +08:00] [DEBUG] [Segment.cpp:1470] ["Segment:<segment_id=152 epoch=14> MPP<query:435802637197639681,task:1> Table<129> read_tso=435802637197639681 Begin segment getReadInfo"] [thread_id=95]

@JinheLin JinheLin deleted the use_tso_to_search_log branch March 27, 2023 08:17
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/M Denotes a PR that changes 30-99 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.

fullstack-test-dt/expr/timestamp_filter.test failed when read thread of storage enabled
6 participants