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

drainer: history job need sort by schema version #444

Merged
merged 8 commits into from
Jan 21, 2019

Conversation

WangXiangUSTC
Copy link
Contributor

What problem does this PR solve?

issue:https://internal.pingcap.net/jira/browse/TOOL-823
get history ddl job from tidb return ddl job order by job id, job finished earlier may have bigger job id, should sort the job by schema version, or may meet table not found error

What is changed and how it works?

sort job id by schema version

Check List

Tests

  • Integration test

Related changes

  • Need to cherry-pick to the release branch

@WangXiangUSTC
Copy link
Contributor Author

/run-all-tests

@WangXiangUSTC
Copy link
Contributor Author

/run-all-tests

@IANTHEREAL
Copy link
Collaborator

refine table not found log, add more information for debug, like table id that not found,and commit ts of binlog

@@ -179,3 +185,20 @@ func filterIgnoreSchema(schema *model.DBInfo, ignoreSchemaNames map[string]struc
_, ok := ignoreSchemaNames[schema.Name.L]
return ok
}

// jobsSorter implements the sort.Interface interface.
type jobsSorter struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just like type JobsBySchemaVersion []*model.Job
and sort.Sort(JobsBySchemaVersion(jobs))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@WangXiangUSTC
Copy link
Contributor Author

PTAL again @GregoryIan @july2993

Copy link
Contributor

@july2993 july2993 left a comment

Choose a reason for hiding this comment

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

LGTM

@july2993
Copy link
Contributor

/run-all-tests

@WangXiangUSTC
Copy link
Contributor Author

/run-all-tests

@WangXiangUSTC
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

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

Co-Authored-By: WangXiangUSTC <[email protected]>
Copy link
Contributor

@amyangfei amyangfei left a comment

Choose a reason for hiding this comment

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

LGTM

@WangXiangUSTC WangXiangUSTC merged commit 3a221bd into master Jan 21, 2019
@WangXiangUSTC WangXiangUSTC deleted the xiang/schemaversion branch January 21, 2019 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants