Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

lightning: refactor the backend package (#877) #902

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Mar 19, 2021

cherry-pick #877 to release-5.0
You can switch your code base to this Pull Request by using git-extras:

# In br repo:
git pr https://github.com/pingcap/br/pull/902

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/br.git pr/902:release-5.0-2652f252f175

What problem does this PR solve?

Split the pkg/lightning/backend package into multiple parts, intended to be the true fix for #837 surviving go mod tidy.

What is changed and how it works?

The backend package itself now only contains the abstract type Backend. The concrete stuff are now split into multiple subpackages:

  • Local backend into pkg/lightning/backend/local
  • TiDB backend into pkg/lightning/backend/tidb
  • Importer backend into pkg/lightning/backend/importer
  • KV encoder stuff into pkg/lightning/backend/kv, intended to be merged into pkg/kv in some future PR
  • TiKV connection stuff into pkg/lightning/tikv
  • The version checking code is split into pkg/lightning/backend/importer, pkg/lightning/backend/local, pkg/lightning/tikvandpkg/version` depending on the component being checked.

Reverted #838 as it is proved to be useless.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release Note

  • No release note

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@lysu
Copy link
Collaborator

lysu commented Mar 19, 2021

hi @kennytm please help merge this PR, tidb will introduce dirty dependencies without this PR in release-5.0

@glorv
Copy link
Collaborator

glorv commented Mar 19, 2021

/lgtm

@ti-srebot ti-srebot added the status/LGT1 LGTM1 label Mar 19, 2021
@lysu lysu requested a review from overvenus March 19, 2021 12:45
@kennytm
Copy link
Collaborator

kennytm commented Mar 19, 2021

/lgtm

@ti-srebot ti-srebot added status/LGT2 LGTM2 and removed status/LGT1 LGTM1 labels Mar 19, 2021
@kennytm
Copy link
Collaborator

kennytm commented Mar 19, 2021

/merge

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit c01fcc7 into pingcap:release-5.0 Mar 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants