*: adjust delta schema count and add metrics#11625
Merged
tiancaiamao merged 11 commits intopingcap:masterfrom Sep 27, 2019
Merged
*: adjust delta schema count and add metrics#11625tiancaiamao merged 11 commits intopingcap:masterfrom
tiancaiamao merged 11 commits intopingcap:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11625 +/- ##
===============================================
- Coverage 79.7436% 79.671% -0.0726%
===============================================
Files 462 461 -1
Lines 102106 101461 -645
===============================================
- Hits 81423 80835 -588
- Misses 14799 14810 +11
+ Partials 5884 5816 -68 |
Contributor
|
@zimulala Please fix ci |
Contributor
Author
jackysp
reviewed
Aug 22, 2019
jackysp
reviewed
Aug 22, 2019
Contributor
Author
Contributor
Author
|
PTAL @tiancaiamao @jackysp @winkyao |
Contributor
Author
|
PTAL @jackysp. |
jackysp
reviewed
Aug 26, 2019
domain/schema_validator.go
Outdated
| maxCnt := int(variable.GetMaxDetalSchemaCount()) | ||
| if len(s.deltaSchemaInfos) > maxCnt && s.notMergeCnt > maxCnt/2 { | ||
| s.merge() | ||
| s.notMergeCnt = 1 |
Contributor
There was a problem hiding this comment.
Why set to 1 here? I think we don't know how many deltaSchemaInfos merged here.
Contributor
Author
There was a problem hiding this comment.
We call merge before setting the value. So I think that the previous deltaSchemaInfos have been merged.
Contributor
Author
|
PTAL @jackysp @tiancaiamao @winkyao |
Contributor
Author
|
PTAL @tiancaiamao @winkyao |
bb7133
reviewed
Aug 30, 2019
Contributor
Author
|
PTAL @bb7133 |
Contributor
Author
|
PTAL @AilinKid @tiancaiamao |
tiancaiamao
reviewed
Sep 27, 2019
| } | ||
| } | ||
|
|
||
| type ids []int64 |
Contributor
|
LGTM |
tiancaiamao
approved these changes
Sep 27, 2019
Contributor
|
/run-all-tests |
Contributor
|
LGTM |
Contributor
|
cherry pick to release-2.1 failed |
Contributor
|
cherry pick to release-3.0 failed |
zimulala
added a commit
to zimulala/tidb
that referenced
this pull request
Sep 30, 2019
zimulala
added a commit
to zimulala/tidb
that referenced
this pull request
Sep 30, 2019
zimulala
added a commit
to zimulala/tidb
that referenced
this pull request
Oct 3, 2019
sre-bot
pushed a commit
that referenced
this pull request
Oct 8, 2019
jackysp
pushed a commit
that referenced
this pull request
Oct 8, 2019
zimulala
added a commit
that referenced
this pull request
Oct 10, 2019
zimulala
added a commit
to zimulala/tidb
that referenced
this pull request
Oct 10, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What problem does this PR solve?
The original size of
deltaSchemaInfosis 100.Executing some SQLs may take a long time. At the same time, the TiDB cluster may do a lot of DDLs, which means we change a lot of schema versions. And the schema version changed in it may exceed 100. Then the SQLs will return the error of
Information schema is changed..If the DDL owner TiDB and the receiving request TiDB are on the same TiDB, it takes 50 + ms to update each mode version.
If the DDL owner TiDB and the receiving request TiDB aren't on the same TiDB, it takes 500 + ms to update each mode version.
The default of
MaxTxnTimeUseis 590s. So I set the size ofdeltaSchemaInfosto 1024.What is changed and how it works?
Add a variable of
TiDBMaxDeltaSchemaCountto update the max size ofdeltaSchemaInfos. Besides, add a function ofmergeAdd some metrics.
Check List
Tests
Related changes