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

*: don't save table IDs in schema diff of FLASHBACK DATABASE #54665

Merged
merged 5 commits into from
Jul 18, 2024

Conversation

lance6716
Copy link
Contributor

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

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: lance6716 <lance6716@gmail.com>
@ti-chi-bot ti-chi-bot bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jul 16, 2024
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Jul 16, 2024
@ti-chi-bot ti-chi-bot bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 16, 2024
Copy link

tiprow bot commented Jul 16, 2024

Hi @lance6716. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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.

Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 9 lines in your changes missing coverage. Please review.

Project coverage is 56.3531%. Comparing base (bbc13a1) to head (8f5520c).
Report is 793 commits behind head on master.

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     
Flag Coverage Δ
integration 37.2795% <47.6190%> (?)
unit 71.7946% <57.1428%> (+0.0140%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 52.5535% <ø> (+6.6910%) ⬆️

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 17, 2024
@lance6716
Copy link
Contributor Author

/cc @tangenta

@ti-chi-bot ti-chi-bot bot requested a review from tangenta July 17, 2024 12:40
@@ -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"`
Copy link
Contributor

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

Copy link
Contributor Author

@lance6716 lance6716 Jul 18, 2024

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

// We can fall back to full load, don't need to return the error.

Copy link
Contributor

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

@@ -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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

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

Signed-off-by: lance6716 <lance6716@gmail.com>
Copy link

ti-chi-bot bot commented Jul 18, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 18, 2024
Copy link

ti-chi-bot bot commented Jul 18, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-17 09:02:53.279632118 +0000 UTC m=+430995.270573588: ☑️ agreed by wjhuang2016.
  • 2024-07-18 05:06:36.833028168 +0000 UTC m=+503218.823969636: ☑️ agreed by D3Hunter.

@ti-chi-bot ti-chi-bot bot merged commit 320d0f4 into pingcap:master Jul 18, 2024
23 checks passed
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 18, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #54737.

@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Jul 26, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 26, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #54953.

@ti-chi-bot ti-chi-bot removed the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Jul 31, 2024
@ti-chi-bot ti-chi-bot bot removed the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Sep 20, 2024
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Oct 28, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 28, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #56905.

@ti-chi-bot ti-chi-bot bot removed the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't FLASHBACK DATABASE if there're too many tables under the database
4 participants