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

*(all): update dependencies on tidb and pd. #8126

Merged
merged 32 commits into from
Feb 8, 2023

Conversation

asddongmen
Copy link
Contributor

@asddongmen asddongmen commented Jan 29, 2023

What problem does this PR solve?

Issue Number: close #8110 #8115

What is changed and how it works?

Upgrade tiflow's package dependencies on tidb, pd, and tikv to properly call the pdClient interface.

TiCDC behavior after PR merge:

  1. TiCDC version > 6.5.0:
    Compatible with both low and high version PDs.
    Can get the correct sourceID.
  2. TiCDC version = 6.5.0:
    Cannot get the correct sourceID from higher version PDs (v>6.5.0).
    No error, but no effect on data correctness.
  3. TiCDC version < 6.5.0:
    The interface to get the sourceID is not called.
    No compatibility issues.

Check List

Tests

  • Manual test (add detailed scripts or steps below)
  • Unit test

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

Fix the problem causing changefeed creation to fail due to inability to retrieve the sourceID from PD.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 29, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • hi-rustin
  • zhaoxinyu

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/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 29, 2023
@asddongmen asddongmen changed the title [WIP] ticdc: fix get source id error ticdc: fix get source id error Jan 29, 2023
@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jan 29, 2023
pkg/pdutil/utils.go Outdated Show resolved Hide resolved
@asddongmen asddongmen added the status/ptal Could you please take a look? label Jan 29, 2023
@asddongmen
Copy link
Contributor Author

/run-integration-tests

@HuSharp
Copy link

HuSharp commented Jan 29, 2023

I see that for ci The job was not started because recent account payments have failed or your spending limit needs to be increased.....

@asddongmen
Copy link
Contributor Author

/run-verify

@asddongmen
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 30, 2023
@asddongmen
Copy link
Contributor Author

/run-kafka-integration-test

@lance6716
Copy link
Contributor

/run-dm-integration-test

@asddongmen asddongmen changed the title ticdc: fix get source id error ticdc: update dependencies on tidb and pd. Feb 7, 2023
Copy link
Member

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
cdc/api/v2/changefeed_test.go Show resolved Hide resolved
cdc/entry/schema_storage_test.go Outdated Show resolved Hide resolved
pkg/pdutil/utils.go Show resolved Hide resolved
pkg/pdutil/utils_test.go Outdated Show resolved Hide resolved
@Rustin170506 Rustin170506 changed the title ticdc: update dependencies on tidb and pd. *(all): update dependencies on tidb and pd. Feb 7, 2023
Makefile Show resolved Hide resolved
@@ -194,8 +194,8 @@ func truncateDDL(ctx context.Context, db *sql.DB) {

func ignoreableError(err error) bool {
knownErrorList := []string{
"Error 1146:", // table doesn't exist
"Error 1049", // database doesn't exist
"Error 1146", // table doesn't exist
Copy link
Member

Choose a reason for hiding this comment

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

Why change the test?

Copy link
Contributor

Choose a reason for hiding this comment

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

After we upgrade go-sql-driver, the error message is changed, for example

Error 1142 (42000): ALTER command denied

cdc/entry/schema/snapshot.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 7, 2023
ARCH := "$(shell uname -s)"
LINUX := "Linux"
MAC := "Darwin"
ifeq (${ARCH}, ${LINUX})
CGO := 0
Copy link
Member

Choose a reason for hiding this comment

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

What if someone cross compile macOS TiCDC on a linux machine?

Copy link
Member

Choose a reason for hiding this comment

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

I think only GOOS matters.

Copy link
Contributor Author

@asddongmen asddongmen Feb 7, 2023

Choose a reason for hiding this comment

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

Thank you! You are right, only GOOS matters, but no matter set CGO_ENABLED=0 or CGO_ENABLED=1 runGOOS=darwin make cdc fails.
I revert related changes and run the following commands:

➜  ticdc git:(fix-get-source-id) uname
Linux
➜  ticdc git:(fix-get-source-id) uname -m
x86_64

➜  ticdc git:(fix-get-source-id) CGO_ENABLED=0 GOOS=darwin make cdc
GO111MODULE=on go build  -trimpath  -ldflags '-X "github.com/pingcap/tiflow/pkg/version.ReleaseVersion=v6.5.0-master-dirty" -X "github.com/pingcap/tiflow/pkg/version.BuildTS=2023-02-07 09:41:40" -X "github.com/pingcap/tiflow/pkg/version.GitHash=03e6f4650e98fe8b47788622844fc1a5f9272ead" -X "github.com/pingcap/tiflow/pkg/version.GitBranch=fix-get-source-id" -X "github.com/pingcap/tiflow/pkg/version.GoVersion=go version go1.19.3 linux/amd64"' -o bin/cdc ./cmd/cdc/main.go
# github.com/cloudfoundry/gosigar
vendor/github.com/cloudfoundry/gosigar/concrete_sigar.go:20:12: cpuUsage.Get undefined (type Cpu has no field or method Get)
vendor/github.com/cloudfoundry/gosigar/concrete_sigar.go:30:14: cpuUsage.Get undefined (type Cpu has no field or method Get)
vendor/github.com/cloudfoundry/gosigar/concrete_sigar.go:49:11: l.Get undefined (type LoadAverage has no field or method Get)
vendor/github.com/cloudfoundry/gosigar/concrete_sigar.go:55:11: m.Get undefined (type Mem has no field or method Get)
vendor/github.com/cloudfoundry/gosigar/concrete_sigar.go:61:11: m.GetIgnoringCGroups undefined (type Mem has no field or method GetIgnoringCGroups)
vendor/github.com/cloudfoundry/gosigar/concrete_sigar.go:67:11: s.Get undefined (type Swap has no field or method Get)
vendor/github.com/cloudfoundry/gosigar/sigar_shared.go:12:21: procTime.Get undefined (type *ProcTime has no field or method Get)
^Cmake: *** [cdc] Interrupt

➜  ticdc git:(fix-get-source-id) ✗ CGO_ENABLED=1 GOOS=darwin make cdc
GO111MODULE=on go build  -trimpath  -ldflags '-X "github.com/pingcap/tiflow/pkg/version.ReleaseVersion=v6.5.0-master-dirty" -X "github.com/pingcap/tiflow/pkg/version.BuildTS=2023-02-07 09:41:32" -X "github.com/pingcap/tiflow/pkg/version.GitHash=03e6f4650e98fe8b47788622844fc1a5f9272ead" -X "github.com/pingcap/tiflow/pkg/version.GitBranch=fix-get-source-id" -X "github.com/pingcap/tiflow/pkg/version.GoVersion=go version go1.19.3 linux/amd64"' -o bin/cdc ./cmd/cdc/main.go
# runtime/cgo
gcc: error: x86_64: No such file or directory
gcc: error: unrecognized command line option '-arch'
make: *** [cdc] Error 2

Do you have any idea to fix this problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

pingcap/tidb#41165

use CGO_ENABLED=1 is the only way to build on darwin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pingcap/tidb#41165

use CGO_ENABLED=1 is the only way to build on darwin.

Yes, but can't build a darwin cdc on linux machine.

Makefile Outdated Show resolved Hide resolved
@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 Feb 7, 2023
Co-authored-by: 二手掉包工程师 <rustin.liu@gmail.com>
@asddongmen
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 3fd5f58

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

@asddongmen: 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

trigger some heavy tests which will not run always when PR updated.

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.

@asddongmen
Copy link
Contributor Author

/run-dm-integration-test

@ti-chi-bot ti-chi-bot merged commit 5a38ed9 into pingcap:master Feb 8, 2023
asddongmen added a commit to asddongmen/tiflow that referenced this pull request Feb 15, 2023
@asddongmen asddongmen deleted the fix-get-source-id branch May 18, 2023 05:29
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/XXL Denotes a PR that changes 1000+ 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. status/ptal Could you please take a look?
Projects
None yet
7 participants