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

Test: Refine dbgFuncCoprocessor #6088

Merged
merged 13 commits into from
Oct 26, 2022

Conversation

ywqzzy
Copy link
Contributor

@ywqzzy ywqzzy commented Oct 8, 2022

What problem does this PR solve?

Issue Number: ref #4609

Problem Summary:

What is changed and how it works?

  1. Clean up dbgFuncCoprocessor, make it only contains API for DBGInvoker.
  2. Add dbgFuncCoprocessorUtils.
  3. Separate code in dbgFuncCoprocessor into dbgQueryCompiler, which convert raw query into DAGRequests.
  4. Separate code in dbgFuncCoprocessor into dbgQueryExecutor, which take DAGRequests as input then convert them into BlockInputStreams or SelectResponse.

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 8, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Lloyd-Pottiger
  • SeaRise

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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 8, 2022
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 8, 2022

/run-all-tests

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 8, 2022

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Oct 8, 2022

Coverage for changed files

Filename                                              Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Columns/ColumnUtils.cpp                                     7                 7     0.00%           1                 1     0.00%          13                13     0.00%           4                 4     0.00%
Core/BlockUtils.cpp                                        23                23     0.00%           2                 2     0.00%          48                48     0.00%          14                14     0.00%
DataStreams/UniqRawResReformatBlockOutputStream.h          17                17     0.00%           4                 4     0.00%          33                33     0.00%           8                 8     0.00%
Debug/dbgFuncCoprocessor.cpp                               52                52     0.00%           6                 6     0.00%         117               117     0.00%          36                36     0.00%
Debug/dbgFuncCoprocessorUtils.cpp                         101                92     8.91%          10                 7    30.00%         164               140    14.63%          56                49    12.50%
Debug/dbgQueryCompiler.cpp                                148                74    50.00%           9                 2    77.78%         289               124    57.09%         116                66    43.10%
Debug/dbgQueryCompiler.h                                   25                 2    92.00%           4                 0   100.00%          49                 2    95.92%          14                 2    85.71%
Debug/dbgQueryExecutor.cpp                                 69                56    18.84%          11                 6    45.45%         224               140    37.50%          48                40    16.67%
Server/MockComputeClient.h                                  8                 2    75.00%           3                 0   100.00%          20                 6    70.00%           4                 2    50.00%
Storages/tests/gtest_filter_parser.cpp                    202                44    78.22%          12                 0   100.00%         402                 2    99.50%          34                26    23.53%
TestUtils/ExecutorTestUtils.h                               3                 1    66.67%           3                 1    66.67%          18                13    27.78%           0                 0         -
TestUtils/MPPTaskTestUtils.cpp                             37                 5    86.49%          13                 2    84.62%         115                19    83.48%          18                 3    83.33%
TestUtils/MPPTaskTestUtils.h                                6                 1    83.33%           3                 0   100.00%          13                 3    76.92%           2                 1    50.00%
TestUtils/mockExecutor.cpp                                 74                 3    95.95%          44                 1    97.73%         290                24    91.72%          34                 2    94.12%
TestUtils/mockExecutor.h                                   14                 4    71.43%          14                 4    71.43%          32                 6    81.25%           0                 0         -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                     786               383    51.27%         139                36    74.10%        1827               690    62.23%         388               253    34.79%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18393      7489             59.28%    215458  77198        64.17%

full coverage report (for internal network access only)

@sre-bot
Copy link
Collaborator

sre-bot commented Oct 8, 2022

Coverage for changed files

Filename                                              Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Columns/ColumnUtils.cpp                                     7                 7     0.00%           1                 1     0.00%          13                13     0.00%           4                 4     0.00%
Core/BlockUtils.cpp                                        23                23     0.00%           2                 2     0.00%          48                48     0.00%          14                14     0.00%
DataStreams/UniqRawResReformatBlockOutputStream.h          17                17     0.00%           4                 4     0.00%          33                33     0.00%           8                 8     0.00%
Debug/dbgFuncCoprocessor.cpp                               52                52     0.00%           6                 6     0.00%         117               117     0.00%          36                36     0.00%
Debug/dbgFuncCoprocessorUtils.cpp                          55                46    16.36%           8                 5    37.50%         115                91    20.87%          46                39    15.22%
Debug/dbgQueryCompiler.cpp                                148                74    50.00%           9                 2    77.78%         289               124    57.09%         116                66    43.10%
Debug/dbgQueryCompiler.h                                   25                 2    92.00%           4                 0   100.00%          49                 2    95.92%          14                 2    85.71%
Debug/dbgQueryExecutor.cpp                                115               102    11.30%          13                 8    38.46%         273               189    30.77%          58                50    13.79%
Server/MockComputeClient.h                                  8                 2    75.00%           3                 0   100.00%          20                 6    70.00%           4                 2    50.00%
Storages/tests/gtest_filter_parser.cpp                    202                44    78.22%          12                 0   100.00%         402                 2    99.50%          34                26    23.53%
TestUtils/ExecutorTestUtils.h                               3                 1    66.67%           3                 1    66.67%          18                13    27.78%           0                 0         -
TestUtils/MPPTaskTestUtils.cpp                             37                 5    86.49%          13                 2    84.62%         115                19    83.48%          18                 3    83.33%
TestUtils/MPPTaskTestUtils.h                                6                 1    83.33%           3                 0   100.00%          13                 3    76.92%           2                 1    50.00%
TestUtils/mockExecutor.cpp                                 74                 3    95.95%          44                 1    97.73%         290                24    91.72%          34                 2    94.12%
TestUtils/mockExecutor.h                                   14                 4    71.43%          14                 4    71.43%          32                 6    81.25%           0                 0         -
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                     786               383    51.27%         139                36    74.10%        1827               690    62.23%         388               253    34.79%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
18393      7487             59.29%    215458  77168        64.18%

full coverage report (for internal network access only)

@ywqzzy ywqzzy marked this pull request as ready for review October 8, 2022 10:17
@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 8, 2022
dbms/src/Core/BlockUtils.cpp Outdated Show resolved Hide resolved
dbms/src/Debug/dbgFuncCoprocessorUtils.cpp Outdated Show resolved Hide resolved
@ywqzzy ywqzzy force-pushed the refine_dbgFuncCoprocessor branch from f433a06 to 951a8f3 Compare October 9, 2022 03:42
@ywqzzy ywqzzy requested a review from Lloyd-Pottiger October 9, 2022 03:47
dbms/src/Core/BlockUtils.cpp Outdated Show resolved Hide resolved
dbms/src/Debug/dbgFuncCoprocessorUtils.cpp Show resolved Hide resolved
dbms/src/Debug/dbgFuncCoprocessorUtils.cpp Outdated Show resolved Hide resolved
return true;
}

String formatBlockData(const Block & block)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think getColumnsContent do the same jobs as this function

String getColumnsContent(const ColumnsWithTypeAndName & cols, size_t begin, size_t end)
{
const size_t col_num = cols.size();
if (col_num <= 0)
return "";


namespace DB
{
bool blockEqual(const Block & expected, const Block & actual, String & unequal_msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

It has a "gtest-specified" version in FunctionTestUtils.cpp 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has a "gtest-specified" version in FunctionTestUtils.cpp 😂

I will not modify the code, since dbgNaturalDag that use the utils is not used for now.

dbms/src/Core/BlockUtils.cpp Show resolved Hide resolved
@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 12, 2022
@SeaRise SeaRise self-requested a review October 25, 2022 06:19
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 25, 2022
@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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 25, 2022
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 25, 2022

/run-all-tests

1 similar comment
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 25, 2022

/run-all-tests

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 25, 2022

/run-all-tests

@ywqzzy ywqzzy force-pushed the refine_dbgFuncCoprocessor branch from 4f5d608 to c6ab143 Compare October 26, 2022 02:38
@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 26, 2022

/run-all-tests

@ywqzzy
Copy link
Contributor Author

ywqzzy commented Oct 26, 2022

/merge

@ti-chi-bot
Copy link
Member

@ywqzzy: 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: 19c3b3a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 26, 2022
@ti-chi-bot ti-chi-bot merged commit 8ae3dd7 into pingcap:master Oct 26, 2022
@SeaRise
Copy link
Contributor

SeaRise commented Oct 31, 2022

/run-build-release comment=true

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/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.

6 participants