-
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
*: move config file option tidb_txn_total_size_limit and tidb_txn_entry_size_limit to sysvar #34448
base: master
Are you sure you want to change the base?
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
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
/run-unit-test |
/run-all-tests |
Nevermind, upgrade task has been added |
kv/kv.go
Outdated
@@ -46,9 +46,9 @@ const UnCommitIndexKVFlag byte = '1' | |||
// Those limits is enforced to make sure the transaction can be well handled by TiKV. | |||
var ( | |||
// TxnEntrySizeLimit is limit of single entry size (len(key) + len(value)). | |||
TxnEntrySizeLimit uint64 = config.DefTxnEntrySizeLimit | |||
TxnEntrySizeLimit = atomic.NewUint64(10485760) //DefTiDBTxnEntrySizeLimit |
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 not using DefTiDBTxnEntrySizeLimit
directly? BTW 10485760
is not equal to DefTiDBTxnEntrySizeLimit((6 * 1024 * 1024))
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.
Afaik this is due to circular dependencies since sessionctx/variable
imports kv
. But I agree we can change the starting value to 6M. It will be overwritten in the startup procedure though, as the sysvar cache is populated.
// TxnTotalSizeLimit is limit of the sum of all entry size. | ||
TxnTotalSizeLimit uint64 = config.DefTxnTotalSizeLimit | ||
TxnTotalSizeLimit = atomic.NewUint64(100 * 1024 * 1024) //DefTiDBTxnTotalSizeLimit |
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.
Ditto
@@ -2522,7 +2522,7 @@ func (b *PlanBuilder) buildAnalyzeAllIndex(as *ast.AnalyzeTableStmt, opts map[as | |||
} | |||
|
|||
// CMSketchSizeLimit indicates the size limit of CMSketch. | |||
var CMSketchSizeLimit = kv.TxnEntrySizeLimit / binary.MaxVarintLen32 | |||
var CMSketchSizeLimit = kv.TxnEntrySizeLimit.Load() / binary.MaxVarintLen32 |
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.
/hold We need to verify the change related to |
@Alkaagr81: PR needs rebase. 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/test-infra repository. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #34448 +/- ##
================================================
- Coverage 62.8182% 62.8116% -0.0067%
================================================
Files 850 850
Lines 276679 276686 +7
================================================
- Hits 173805 173791 -14
- Misses 89080 89098 +18
- Partials 13794 13797 +3 |
@Alkaagr81: The following tests failed, say
Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: ref #33769
Problem Summary:
The option
tidb_txn_total_size_limit
andtidb_txn_entry_size_limit
has historically been a config option. But based on requirements from cloud & PM it should instead be a sysvar scope Global.What is changed and how it works?
Remove them from the config list and add them to global sysvars.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.