-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: add function flashback database #30217
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. 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. |
/cc @crazycs520 |
ddl/ddl_api.go
Outdated
Args: []interface{}{recoverSchemaInfo.SchemaInfo, recoverSchemaInfo.RecoversInfo, | ||
recoverSchemaInfo.DropJobID, recoverSchemaInfo.SnapshotTS, recoverSchemaInfo.OldSchemaName}, | ||
} | ||
err = d.doDDLJob(ctx, job) |
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.
Please handle the error here.
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.
no need to handle error in here?
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.
@erwadba Please address this comment
Please add some more test cases for your feature. |
Please fix the lint checking(https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_check/detail/tidb_ghpr_check/36907/pipeline):
|
c2ba7f3
to
068b3f0
Compare
/cc @bb7133 @crazycs520 |
/cc @bb7133 @crazycs520 |
@erwadba Sorry that I missed this PR before, I will try to review it recently. |
LGTM,but this feature should be designed under BR system, so please add BR PM and reviewed with LGTM. |
ddl/schema.go
Outdated
ver, err = updateVersionAndTableInfo(t, job, recoverInfo.TableInfo, false) | ||
if err != nil { | ||
return ver, errors.Trace(err) | ||
} |
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.
ver, err = updateVersionAndTableInfo(t, job, recoverInfo.TableInfo, false) | |
if err != nil { | |
return ver, errors.Trace(err) | |
} |
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.
Should only update schema version once in this situation. the related schema change should be set in updateSchemaVersion
, related with the comment: https://github.com/pingcap/tidb/pull/30217/files#r767778383
ddl/schema.go
Outdated
schemaInfo.State = model.StatePublic | ||
err = t.UpdateDatabase(schemaInfo) | ||
if err != nil { | ||
return ver, errors.Trace(err) | ||
} |
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.
schemaInfo.State = model.StatePublic | |
err = t.UpdateDatabase(schemaInfo) | |
if err != nil { | |
return ver, errors.Trace(err) | |
} |
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.
you can create database with public
state, then no need update schema info here.
/run-unit-test |
1 similar comment
/run-unit-test |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/6336add026a26e8cc598e191b3d0c936bc6584ab |
infoschema/builder.go
Outdated
tids, err = b.applyCreateTable(m, di, tblInfo.ID, allocs, diff.Type, tids) | ||
if err != nil { | ||
return errors.Trace(err) | ||
} |
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.
also need applyPlacementUpdate
for each table?
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.
@erwadba Please check this comment.
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.
@xhebox Could you give some advice?
ddl/ddl_worker.go
Outdated
@@ -1066,6 +1090,7 @@ func updateSchemaVersion(t *meta.Meta, job *model.Job) (int64, error) { | |||
diff.AffectedOpts = buildPlacementAffects(oldIDs, oldIDs) |
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.
cc @djshow832 I'm not sure whether ActionRecoverSchema
ddl job need this to update placement rule cache, PTAL
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.
@xhebox @lcwangchao PTAL
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.
@lcwangchao Do we implement it in this PR or not? I think we could recover placement rules without much problem..
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.
cc @djshow832 PTAL, some part about placement rule, I'm not familiar with it.
/run-unit-test |
@erwadba: PR needs rebase. 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 kubernetes/test-infra repository. |
Hi @erwadba Could you please resolve the conflicts? Thanks. |
/cc @bb7133 |
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.
Please resolve all the comments
/run-all-tests |
/cc @bb7133 @wjhuang2016 |
ddl/ddl_api.go
Outdated
SchemaID: recoverSchemaInfo.SchemaInfo.ID, | ||
Type: model.ActionRecoverSchema, | ||
BinlogInfo: &model.HistoryInfo{}, | ||
Args: []interface{}{recoverSchemaInfo, recoverCheckFlagNone}, | ||
} | ||
err = d.doDDLJob(ctx, job) |
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.
err = d.doDDLJob(ctx, job) | |
err = d.doDDLJob(ctx, job) | |
if err != nil { | |
return err | |
} |
@erwadba: PR needs rebase. 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 kubernetes/test-infra repository. |
6336add
to
d1f75f0
Compare
Hi @erwadba , this PR has been closed(due to a bug of Github, I believe), would you like to file another PR and we could work on it? |
What problem does this PR solve?
Issue Number: close #20463
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note