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

Support ddl job CreateTables in TiFlash #4201

Merged
merged 15 commits into from
Mar 11, 2022
Merged

Conversation

CalvinNeo
Copy link
Member

@CalvinNeo CalvinNeo commented Mar 8, 2022

What problem does this PR solve?

Issue Number: close #4194. Related to pingcap/tidb#28763

Problem Summary:

For all ddl jobs need handled before CreateTables, is not addressed in this PR. We only generate an error message.

ref #4215

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

Support BR restoring tables with ddl job `CreateTables` in TiFlash

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 8, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JaySon-Huang
  • windtalker

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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed do-not-merge/needs-linked-issue labels Mar 8, 2022
@CalvinNeo CalvinNeo changed the title Fix4194 Handle CreateTables ddl job Mar 8, 2022
@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Mar 8, 2022
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 9, 2022
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@fengou1
Copy link

fengou1 commented Mar 9, 2022

a manual test show this solution works, steps as follows:

  1. create sql with TiFlash's some table replicas
    mysql> alter table t1 set tiflash replica 1;
  2. backup the TiDB cluster
  3. restore to another tidb cluster with TiFlash's
  4. check the TiFlash's table t1, it works
    ZMabcc1hkC

@ti-chi-bot
Copy link
Member

@fengou1: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

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.

@fengou1
Copy link

fengou1 commented Mar 9, 2022

/run-build

f
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@fengou1
Copy link

fengou1 commented Mar 10, 2022

/cc @windtalker PTAL

@ti-chi-bot
Copy link
Member

@fengou1: GitHub didn't allow me to request PR reviews from the following users: PTAL.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @windtalker PTAL

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 kubernetes/test-infra repository.

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>

for (ASTs::size_type i = 1; i < args.size(); i++)
{
String schema_str = "i Int64";
Copy link
Contributor

Choose a reason for hiding this comment

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

A hard-coded schema for all the tables?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, since newTables is just a delegate of addTable. This ut is to ensure this behavior.
If it can not support other schemas, test for mock_tidb_table shall fail.

dbms/src/Storages/Transaction/SchemaGetter.h Show resolved Hide resolved
@CalvinNeo
Copy link
Member Author

Test passed
image

Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@CalvinNeo CalvinNeo changed the title Handle CreateTables ddl job Support ddl job CreateTables in TiFlash Mar 10, 2022
@CalvinNeo
Copy link
Member Author

/run-all-tests

@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 10, 2022
@CalvinNeo
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

@CalvinNeo: 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: 740d6ff

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

@CalvinNeo: 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 10, 2022

Coverage for changed files

Filename                                   Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/DBGInvoker.cpp                            30                29     3.33%          10                 9    10.00%         138                75    45.65%          14                14     0.00%
Debug/MockTiDB.cpp                             139               135     2.88%          34                32     5.88%         422               404     4.27%          92                91     1.09%
Debug/MockTiDB.h                                 8                 6    25.00%           8                 6    25.00%          15                13    13.33%           0                 0         -
Debug/dbgFuncMockTiDBTable.cpp                 109               109     0.00%          14                14     0.00%         219               219     0.00%          72                72     0.00%
Debug/dbgFuncSchema.cpp                         44                44     0.00%           5                 5     0.00%          62                62     0.00%          28                28     0.00%
Storages/Transaction/SchemaBuilder.cpp         651               616     5.38%          46                42     8.70%        1020               948     7.06%         404               386     4.46%
Storages/Transaction/SchemaBuilder.h             1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Storages/Transaction/SchemaGetter.h              1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          983               941     4.27%         119               110     7.56%        1878              1723     8.25%         610               591     3.11%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16777      9446             43.70%    188928  95772        49.31%

full coverage report (for internal network access only)

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

@CalvinNeo: 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: 9f4c4e0

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

sre-bot commented Mar 10, 2022

Coverage for changed files

Filename                                   Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/DBGInvoker.cpp                            30                29     3.33%          10                 9    10.00%         138                75    45.65%          14                14     0.00%
Debug/MockTiDB.cpp                             139               135     2.88%          34                32     5.88%         421               403     4.28%          92                91     1.09%
Debug/MockTiDB.h                                 8                 6    25.00%           8                 6    25.00%          15                13    13.33%           0                 0         -
Debug/dbgFuncMockTiDBTable.cpp                 109               109     0.00%          14                14     0.00%         219               219     0.00%          72                72     0.00%
Debug/dbgFuncSchema.cpp                         44                44     0.00%           5                 5     0.00%          62                62     0.00%          28                28     0.00%
Storages/Transaction/SchemaBuilder.cpp         651               616     5.38%          46                42     8.70%        1020               948     7.06%         404               386     4.46%
Storages/Transaction/SchemaBuilder.h             1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Storages/Transaction/SchemaGetter.h              1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          983               941     4.27%         119               110     7.56%        1877              1722     8.26%         610               591     3.11%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16777      9447             43.69%    188928  95758        49.32%

full coverage report (for internal network access only)

f
Signed-off-by: CalvinNeo <calvinneo1995@gmail.com>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Mar 10, 2022
@CalvinNeo
Copy link
Member Author

/merge

@ti-chi-bot
Copy link
Member

@CalvinNeo: 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: abdae32

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

sre-bot commented Mar 10, 2022

Coverage for changed files

Filename                                   Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Debug/DBGInvoker.cpp                            30                29     3.33%          10                 9    10.00%         138                75    45.65%          14                14     0.00%
Debug/MockTiDB.cpp                             139               135     2.88%          34                32     5.88%         421               403     4.28%          92                91     1.09%
Debug/MockTiDB.h                                 8                 6    25.00%           8                 6    25.00%          15                13    13.33%           0                 0         -
Debug/dbgFuncMockTiDBTable.cpp                 109               109     0.00%          14                14     0.00%         219               219     0.00%          72                72     0.00%
Debug/dbgFuncSchema.cpp                         44                44     0.00%           5                 5     0.00%          62                62     0.00%          28                28     0.00%
Storages/Transaction/SchemaBuilder.cpp         651               616     5.38%          46                42     8.70%        1020               948     7.06%         404               386     4.46%
Storages/Transaction/SchemaBuilder.h             1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
Storages/Transaction/SchemaGetter.h              1                 1     0.00%           1                 1     0.00%           1                 1     0.00%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                          983               941     4.27%         119               110     7.56%        1877              1722     8.26%         610               591     3.11%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
16777      9447             43.69%    188928  95743        49.32%

full coverage report (for internal network access only)

@CalvinNeo
Copy link
Member Author

/run-integration-tests

2 similar comments
@CalvinNeo
Copy link
Member Author

/run-integration-tests

@CalvinNeo
Copy link
Member Author

/run-integration-tests

@fengou1
Copy link

fengou1 commented Mar 11, 2022

/run-integration-test

2 similar comments
@JaySon-Huang
Copy link
Contributor

/run-integration-test

@JaySon-Huang
Copy link
Contributor

/run-integration-test

@ti-chi-bot ti-chi-bot merged commit b887653 into pingcap:master Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Support ddl job CreateTables in TiFlash
6 participants