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

br/pkg/lightning: make tidb version check more compitible #29505

Merged
merged 5 commits into from
Nov 5, 2021

Conversation

glorv
Copy link
Contributor

@glorv glorv commented Nov 5, 2021

Cherry-pick #29500 to release-5.2

What problem does this PR solve?

TiDB version string can be customized by set the corresponding config field. So parse the result from select verson() to get tidb release version is not correct in some case.

What is changed and how it works?

  • Try to exec select version() and parse the result as tidb version; If the query returns error, fallback to select version(); so we can still be compitible with MySQL/MariaDB.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    • Run dumpling and lightning(local backend) with TiDB playground v5.2.2 (server-version = 'Test-5.7.22'), both can detect tidb version correctly and export/import successfully
    • Run dumpling and lightning (tidb backend) with MySQL 5.7.22, both can export/import successfully.
  • 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

Avoid version check failure when tidb version is customized.

@glorv glorv added the component/lightning This issue is related to Lightning of TiDB. label Nov 5, 2021
@glorv glorv requested review from 3pointer and lichunzhu November 5, 2021 07:22
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 5, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • 3pointer
  • lichunzhu

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/cherry-pick-not-approved 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. labels Nov 5, 2021
@glorv glorv changed the title cherry-pick #29500 to release-5.2 lightning: make tidb version check more compitible Nov 5, 2021
@sre-bot
Copy link
Contributor

sre-bot commented Nov 5, 2021

Please follow PR Title Format:

  • pkg [, pkg2, pkg3]: what is changed

Or if the count of mainly changed packages are more than 3, use

  • *: what is changed

After you have format title, you can leave a comment /run-check_title to recheck it

@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label Nov 5, 2021
@glorv glorv changed the title lightning: make tidb version check more compitible br/pkg/lightning: make tidb version check more compitible Nov 5, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 5, 2021
@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 Nov 5, 2021
@glorv
Copy link
Contributor Author

glorv commented Nov 5, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 68bf571

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 5, 2021
@glorv
Copy link
Contributor Author

glorv commented Nov 5, 2021

/run-check_dev

2 similar comments
@glorv
Copy link
Contributor Author

glorv commented Nov 5, 2021

/run-check_dev

@glorv
Copy link
Contributor Author

glorv commented Nov 5, 2021

/run-check_dev

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Nov 5, 2021
@glorv
Copy link
Contributor Author

glorv commented Nov 5, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: f418b7f

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 5, 2021
@glorv
Copy link
Contributor Author

glorv commented Nov 5, 2021

/run-check_dev

@ti-chi-bot ti-chi-bot merged commit feb4b14 into pingcap:release-5.2 Nov 5, 2021
@glorv glorv deleted the cp-29500 branch November 5, 2021 11:29
@zhouqiang-cl zhouqiang-cl added this to the v5.2.4 milestone Apr 18, 2022
@n0vad3v n0vad3v removed this from the v5.2.4 milestone Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. component/lightning This issue is related to Lightning of TiDB. 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.

7 participants