-
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
*: don't save table IDs in schema diff of FLASHBACK DATABASE #54665
Conversation
Signed-off-by: lance6716 <lance6716@gmail.com>
Hi @lance6716. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #54665 +/- ##
=================================================
- Coverage 72.7514% 56.3531% -16.3984%
=================================================
Files 1551 1672 +121
Lines 436702 615251 +178549
=================================================
+ Hits 317707 346713 +29006
- Misses 99433 245121 +145688
- Partials 19562 23417 +3855
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/cc @tangenta |
pkg/parser/model/ddl.go
Outdated
@@ -1199,6 +1199,9 @@ type SchemaDiff struct { | |||
OldSchemaID int64 `json:"old_schema_id"` | |||
// RegenerateSchemaMap means whether to rebuild the schema map when applying to the schema diff. | |||
RegenerateSchemaMap bool `json:"regenerate_schema_map"` | |||
// RecoverSnapshotTS is set when the diff is too large to be saved in SchemaDiff. | |||
// infoschema should use this TS to read meta directly. | |||
RecoverSnapshotTS uint64 `json:"recover_snapshot_ts,omitempty"` |
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.
what if: after flashback schema job to done, and before reload, GC remove all those keys
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.
I remember it will fallback to full load
Line 345 in e858f55
// We can fall back to full load, don't need to return the error. |
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.
we can reload this schema only if we use current ts
pkg/infoschema/infoschema_v2.go
Outdated
@@ -871,6 +871,25 @@ func applyDropSchema(b *Builder, diff *model.SchemaDiff) []int64 { | |||
} | |||
|
|||
func applyRecoverSchema(b *Builder, m *meta.Meta, diff *model.SchemaDiff) ([]int64, error) { | |||
if snapTS := diff.RecoverSnapshotTS; snapTS > 0 { |
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.
i prefer reload from now, there is no difference.
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 in case the database is relatively small compared with full load.
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 full load? i mean load using current ts, not this saved one
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.
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
Signed-off-by: lance6716 <lance6716@gmail.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: D3Hunter, wjhuang2016 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: close #54415
Problem Summary:
What changed and how does it work?
as title. Follow up of #54439
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.