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

domain: do not reset the data for infoschema v2 when full load #53543

Merged
merged 3 commits into from
May 31, 2024

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented May 24, 2024

What problem does this PR solve?

Issue Number: close #53442

Problem Summary:

What changed and how does it work?

The bug is caused by the clearing data operation.

The historial version is missing after clear, so tryDiffLoad get schema ID not exist error and then full reload.

Here is the stack:

[errorVerbose="[schema:1049]Unknown database '(Schema ID 100)'
github.com/pingcap/errors.AddStack
	/home/genius/go/pkg/mod/github.com/pingcap/[email protected]/errors.go:178
github.com/pingcap/errors.(*Error).GenWithStackByArgs
	/home/genius/go/pkg/mod/github.com/pingcap/[email protected]/normalize.go:175
github.com/pingcap/tidb/pkg/infoschema.(*Builder).applyTableUpdateV2
	/home/genius/project/src/github.com/pingcap/tidb/pkg/infoschema/infoschema_v2.go:815
github.com/pingcap/tidb/pkg/infoschema.applyTableUpdate
	/home/genius/project/src/github.com/pingcap/tidb/pkg/infoschema/infoschema_v2.go:714
github.com/pingcap/tidb/pkg/infoschema.applyDefaultAction
	/home/genius/project/src/github.com/pingcap/tidb/pkg/infoschema/builder.go:315
github.com/pingcap/tidb/pkg/infoschema.(*Builder).ApplyDiff
	/home/genius/project/src/github.com/pingcap/tidb/pkg/infoschema/builder.go:102
github.com/pingcap/tidb/pkg/domain.(*Domain).tryLoadSchemaDiffs
	/home/genius/project/src/github.com/pingcap/tidb/pkg/domain/domain.go:478
github.com/pingcap/tidb/pkg/domain.(*Domain).loadInfoSchema
	/home/genius/project/src/github.com/pingcap/tidb/pkg/domain/domain.go:283
github.com/pingcap/tidb/pkg/domain.(*Domain).Reload
	/home/genius/project/src/github.com/pingcap/tidb/pkg/domain/domain.go:613
github.com/pingcap/tidb/pkg/domain.(*Domain).loadSchemaInLoop
	/home/genius/project/src/github.com/pingcap/tidb/pkg/domain/domain.go:926
github.com/pingcap/tidb/pkg/domain.(*Domain).Init.func2
	/home/genius/project/src/github.com/pingcap/tidb/pkg/domain/domain.go:1294
github.com/pingcap/tidb/pkg/util.(*WaitGroupEnhancedWrapper).Run.func1
	/home/genius/project/src/github.com/pingcap/tidb/pkg/util/wait_group_wrapper.go:99
runtime.goexit
	/home/genius/project/go/src/runtime/asm_amd64.s:1650"]

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

@tiancaiamao tiancaiamao requested review from ywqzzy and wjhuang2016 May 24, 2024 09:25
@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 24, 2024
Copy link

tiprow bot commented May 24, 2024

Hi @tiancaiamao. 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.

Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.5878%. Comparing base (9745a16) to head (91802d5).
Report is 6 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53543        +/-   ##
================================================
+ Coverage   72.5287%   74.5878%   +2.0591%     
================================================
  Files          1506       1507         +1     
  Lines        430930     431928       +998     
================================================
+ Hits         312548     322166      +9618     
+ Misses        99026      89846      -9180     
- Partials      19356      19916       +560     
Flag Coverage Δ
integration 49.2124% <100.0000%> (?)
unit 71.4454% <100.0000%> (-0.0690%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 50.3015% <ø> (+8.4807%) ⬆️

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 30, 2024
Copy link

ti-chi-bot bot commented May 31, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wjhuang2016, ywqzzy

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 31, 2024
Copy link

ti-chi-bot bot commented May 31, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-30 13:01:43.453571742 +0000 UTC m=+2954257.210707313: ☑️ agreed by wjhuang2016.
  • 2024-05-31 09:46:21.663305757 +0000 UTC m=+3028935.420441329: ☑️ agreed by ywqzzy.

@ti-chi-bot ti-chi-bot bot merged commit 3fdb963 into pingcap:master May 31, 2024
22 of 23 checks passed
@tiancaiamao tiancaiamao deleted the issue53442 branch May 31, 2024 11:36
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected full reload caused by failing to load schema diff
3 participants