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

Merged
merged 6 commits into from
Mar 17, 2021

Conversation

kennytm
Copy link
Collaborator

@kennytm kennytm commented Mar 15, 2021

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

@kennytm kennytm force-pushed the move-backends branch 3 times, most recently from 6f92aad to ca53dce Compare March 16, 2021 08:06
@kennytm kennytm marked this pull request as ready for review March 16, 2021 10:02
@kennytm kennytm requested a review from glorv March 16, 2021 11:01
@glorv
Copy link
Collaborator

glorv commented Mar 17, 2021

/lgtm

@ti-srebot ti-srebot added the status/LGT1 LGTM1 label Mar 17, 2021
@kennytm kennytm requested a review from YuJuncen March 17, 2021 03:22
Copy link
Collaborator

@YuJuncen YuJuncen 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

cmd/tidb-lightning-ctl/main.go Outdated Show resolved Hide resolved
@YuJuncen
Copy link
Collaborator

/lgtm

@ti-srebot ti-srebot removed the status/LGT1 LGTM1 label Mar 17, 2021
@ti-srebot ti-srebot added the status/LGT2 LGTM2 label Mar 17, 2021
@kennytm
Copy link
Collaborator Author

kennytm commented Mar 17, 2021

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 2652f25 into pingcap:master Mar 17, 2021
@kennytm kennytm deleted the move-backends branch March 17, 2021 10:07
@kennytm
Copy link
Collaborator Author

kennytm commented Mar 17, 2021

We will run cherry-pick after it is confirmed this is sufficient for the go-client.

ti-srebot pushed a commit to ti-srebot/br that referenced this pull request Mar 19, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #902

ti-srebot added a commit that referenced this pull request Mar 19, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
ti-srebot pushed a commit to ti-srebot/br that referenced this pull request Mar 29, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #957

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.

5 participants