domain: fix a bug when reloading take a long time in domain.Init (#45170)#45388
domain: fix a bug when reloading take a long time in domain.Init (#45170)#45388ti-chi-bot wants to merge 1 commit intopingcap:release-5.4from
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
This cherry pick PR is for a release branch and has not yet been approved by release team. To merge this cherry pick, it must first be approved by the collaborators. AFTER it has been approved by collaborators, please ping the release team in a comment to request a cherry pick review. DetailsInstructions 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. |
|
This pull request is closed because its related version has closed automatic cherry-picking. https://prow.tidb.net/command-help#cherrypick |
This is an automated cherry-pick of #45170
What problem does this PR solve?
Issue Number: close #45176
Problem Summary:
This problem should be that the load full schema takes 1min37s, that is, the lease period is exceeded, and there is no new load schema operation in the future. This error(
Information schema is out of date) is reported when an SQL statement comes in.Because the transaction will check the validity of the schema, and the validity check, if found
txnTSbigger thanschemaValidator.latestSchemaExpire, will quote this wrong.What is changed and how it works?
Do a new reload to update
schemaValidator.latestSchemaExpire, after the first reload indomain.Init.In the future, we need to optimize the load schema operation.
Check List
Tests
Case 1
Local cluster, 1 TiDB, 1 TiKV.
Make the first reload take 50s(do sleep in function) in
domain.Initfor master branch as test master.Before this PR:
Upgrade from v6.5.2 to test master, failed to upgrade due to
Information schema is out of date.After this PR:
Upgrade from v6.5.2 to test master, successful to upgrade.
Case 2
Benchbot cluster, 1 TiDB, 3 TiKV.
Make the first reload take 54s(create 500,000 tables ) in
domain.Initfor master branch as test master.Before this PR:
Upgrade from v6.5.2 to test master, failed to upgrade due to
Information schema is out of date.After this PR:
Upgrade from v6.5.2 to test master, successful to upgrade.
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.