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
ddl: get key ranges for flashback cluser
ddl job
#37542
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-check-issue-triage-complete |
flashback cluser
ddl job
ddl/cluster.go
Outdated
if !table.IsBaseTable() || table.ID > meta.MaxGlobalID { | ||
continue | ||
} | ||
nonFlashbackPhysicalIDs, allPhysicalIDs = addToSlice(db.Name.L, table.Name.L, table.ID, nonFlashbackPhysicalIDs, allPhysicalIDs) |
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.
if table.Partition != nil
For partitioned tables, (at least for now) we don't need to explicitly add its table id to physical IDs since there's no data prefixed with it.
However, this might not be the case in the future(for example, the 'global index' for partitioned tables(/cc @tiancaiamao and @mjonss ). So it might be a good idea to keep it as now.
@@ -156,44 +237,55 @@ func (w *worker) onFlashbackCluster(d *ddlCtx, t *meta.Meta, job *model.Job) (ve | |||
return ver, err | |||
} | |||
|
|||
// stage 1, check and set FlashbackClusterJobID. | |||
// Stage 1, check and set FlashbackClusterJobID, and save the PD schedule. | |||
if flashbackJobID == 0 { | |||
err = kv.RunInNewTxn(w.ctx, w.store, true, func(ctx context.Context, txn kv.Transaction) error { | |||
return meta.NewMeta(txn).SetFlashbackClusterJobID(job.ID) |
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 do we need a kv
key? Could we a variable like GC
? At present, some kv
are replaced with variables, so if it is not necessary, introduce this kind of kv
as little as possible
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.
Sounds good, maybe I can change it to global variables in next PR
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.
Approve by mistake..
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
/merge |
3 similar comments
/merge |
/merge |
/merge |
/run-mysql-test tidb-test=pr/1957 |
/check-issue-triage-complete |
/merge |
@Defined2014: 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 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. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: b61fd89
|
/run-mysql-test tidb-test=pr/1957 |
What problem does this PR solve?
Issue Number: close #37540
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.