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

brie: add error info column and history backup/restore info in sql #22699

Merged
merged 22 commits into from Jul 30, 2021

Conversation

lichunzhu
Copy link
Contributor

@lichunzhu lichunzhu commented Feb 3, 2021

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary: When we use BRIE to run a backup job, if our mysql connection is broken due to some reason, we can't infer whether this BRIE job is successful or not.

What is changed and how it works?

What's Changed: Save history brie jobs in the task queue and add an error info column.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    Run a BR job and stop the network.
    Current:
mysql> show backups;
+----------------------+--------+-------------------+---------------------+---------------------+---------------------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Destination          | State  | Progress          | Queue_time          | Execution_time      | Finish_time         | Connection | Message                                                                                                                                                                                                                                         |
+----------------------+--------+-------------------+---------------------+---------------------+---------------------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| s3://chunzhu/backup/ | Backup | 83.33333333333333 | 2021-02-03 17:46:52 | 2021-02-03 17:46:52 | 2021-02-03 17:48:31 |          3 | [executor:8124]Backup failed: msg:"Io(Custom { kind: Other, error: \"failed to put object Error during dispatch: error trying to connect: tcp connect error: Connection refused (os error 111)\" })" : [BR:KV:ErrKVUnknown]unknown tikv error |
+----------------------+--------+-------------------+---------------------+---------------------+---------------------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Previous:
No backup can be found.

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
  • Breaking backward compatibility

Release note

  • No release note

@lichunzhu lichunzhu requested review from a team as code owners February 3, 2021 09:48
@lichunzhu lichunzhu requested review from lzmhhh123 and removed request for a team February 3, 2021 09:48
@ti-srebot ti-srebot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Feb 3, 2021
@github-actions github-actions bot added the sig/execution SIG execution label Feb 3, 2021
@lichunzhu
Copy link
Contributor Author

/cc kennytm,3pointer,overvenus,glorv

@lichunzhu
Copy link
Contributor Author

/unlabel sig/execution

@ti-srebot ti-srebot removed the sig/execution SIG execution label Feb 22, 2021
@github-actions github-actions bot added the sig/execution SIG execution label Feb 22, 2021
@lichunzhu
Copy link
Contributor Author

/remove-sig execution

executor/brie.go Outdated
Comment on lines 412 to 416
if len(item.info.errStr) > 0 {
e.result.AppendString(7, item.info.errStr)
} else {
e.result.AppendNull(7)
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a test to cover them?

@lichunzhu
Copy link
Contributor Author

/remove-sig execution

@ti-chi-bot ti-chi-bot removed the sig/execution SIG execution label Feb 23, 2021
@github-actions github-actions bot added the sig/execution SIG execution label Feb 23, 2021
@lichunzhu
Copy link
Contributor Author

/remove-sig execution

@ti-chi-bot ti-chi-bot removed the sig/execution SIG execution label Feb 23, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 23, 2021
@github-actions github-actions bot added the sig/execution SIG execution label Feb 23, 2021
@lichunzhu
Copy link
Contributor Author

/run-integration-br-test

1 similar comment
@overvenus
Copy link
Member

/run-integration-br-test

Copy link
Member

@overvenus overvenus left a comment

Choose a reason for hiding this comment

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

Rest LGTM

executor/brie.go Show resolved Hide resolved
Comment on lines +225 to +226
} else {
switch ft[colIdx].EvalType() {
Copy link
Member

Choose a reason for hiding this comment

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

Why replace continue with else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If colIdx is the last column of this row, we shouldn't put the comma(, ) after nil nor NULL.

Copy link
Member

@overvenus overvenus 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
Copy link
Member

@overvenus: Please use /LGTM instead of LGTM when you want to approve the pull request by comment.
If you use the GitHub review feature, please approve the PR directly, the comment will not take effect in the GitHub review feature.
If you have any qustions please refer to lgtm command help or lgtm plugin design.

If you have approved this PR, please ignore this reply. This reply is being used as a temporary reply during the migration of the new bot and will be removed on April 1.

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 ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 21, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • kennytm
  • winoros

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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 21, 2021
@glorv
Copy link
Contributor

glorv commented Jun 28, 2021

/run-check_dev_2

@lzmhhh123 lzmhhh123 removed their request for review June 28, 2021 06:16
@glorv
Copy link
Contributor

glorv commented Jul 16, 2021

/run-check_dev_2

@kennytm
Copy link
Contributor

kennytm commented Jul 18, 2021

@kennytm
Copy link
Contributor

kennytm commented Jul 29, 2021

/run-check_dev_2

@kennytm
Copy link
Contributor

kennytm commented Jul 30, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: c936e17

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. sig/execution SIG execution sig/migrate 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.

None yet

7 participants