-
Notifications
You must be signed in to change notification settings - Fork 130
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
Conversation
/run-all-tests |
/run-all-tests |
refine |
@@ -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 { |
There was a problem hiding this comment.
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))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just same with tidb's code
https://github.com/pingcap/tidb/blob/f522de2e8fea1f9b7e32dda9522f0e8df59f4da4/meta/meta.go#L693
it dosen't matter
PTAL again @GregoryIan @july2993 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
/run-all-tests |
/run-all-tests |
There was a problem hiding this 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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
errorWhat is changed and how it works?
sort job id by schema version
Check List
Tests
Related changes