Skip to content

*: move config file option tidb_txn_total_size_limit and tidb_txn_entry_size_limit to sysvar#34448

Open
Alkaagr81 wants to merge 23 commits intopingcap:masterfrom
Alkaagr81:tidb_txn_total_size_limit
Open

*: move config file option tidb_txn_total_size_limit and tidb_txn_entry_size_limit to sysvar#34448
Alkaagr81 wants to merge 23 commits intopingcap:masterfrom
Alkaagr81:tidb_txn_total_size_limit

Conversation

@Alkaagr81
Copy link
Collaborator

What problem does this PR solve?

Issue Number: ref #33769

Problem Summary:

The option tidb_txn_total_size_limit and tidb_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

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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.

The option `tidb_txn_total_size_limit` and `tidb_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.

@Alkaagr81 Alkaagr81 requested a review from a team as a code owner May 7, 2022 08:56
@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 7, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • morgo
  • you06

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 7, 2022
@morgo morgo self-requested a review May 10, 2022 16:47
Copy link
Contributor

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

@Alkaagr81 Alkaagr81 requested a review from morgo May 12, 2022 18:38
@morgo
Copy link
Contributor

morgo commented May 12, 2022

/run-unit-test

@morgo
Copy link
Contributor

morgo commented May 13, 2022

/run-all-tests

@ti-chi-bot ti-chi-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 13, 2022
@morgo morgo requested a review from you06 May 16, 2022 15:52
@morgo
Copy link
Contributor

morgo commented May 16, 2022

For this one, we can add upgrade (import values from config) in a followup PR. We have some PRs that have already merged that we need to followup with a bootstrap task to upgrade.

Nevermind, upgrade task has been added

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 17, 2022
kv/kv.go Outdated
var (
// TxnEntrySizeLimit is limit of single entry size (len(key) + len(value)).
TxnEntrySizeLimit uint64 = config.DefTxnEntrySizeLimit
TxnEntrySizeLimit = atomic.NewUint64(10485760) //DefTiDBTxnEntrySizeLimit
Copy link
Member

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))

Copy link
Contributor

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.

TxnEntrySizeLimit = atomic.NewUint64(10485760) //DefTiDBTxnEntrySizeLimit
// TxnTotalSizeLimit is limit of the sum of all entry size.
TxnTotalSizeLimit uint64 = config.DefTxnTotalSizeLimit
TxnTotalSizeLimit = atomic.NewUint64(100 * 1024 * 1024) //DefTiDBTxnTotalSizeLimit
Copy link
Member

Choose a reason for hiding this comment

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

Ditto


// CMSketchSizeLimit indicates the size limit of CMSketch.
var CMSketchSizeLimit = kv.TxnEntrySizeLimit / binary.MaxVarintLen32
var CMSketchSizeLimit = kv.TxnEntrySizeLimit.Load() / binary.MaxVarintLen32
Copy link
Member

Choose a reason for hiding this comment

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

This variable is initialized once and will not be updated with the change of TxnEntrySizeLimit, it could be a risk.

@XuHuaiyu @chrysan Do you have any idea how this should work with the new tidb_entry_size_limit variable?

@bb7133
Copy link
Member

bb7133 commented May 17, 2022

/hold

We need to verify the change related to CMSketchSizeLimit.

@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 17, 2022
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 31, 2022
@ti-chi-bot
Copy link
Member

@Alkaagr81: PR needs rebase.

Details

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
Copy link

codecov bot commented Jul 22, 2023

Codecov Report

❌ Patch coverage is 26.31579% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.8116%. Comparing base (9f7813c) to head (1eaae25).
⚠️ Report is 10084 commits behind head on master.

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     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Dec 19, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 26, 2025

@Alkaagr81: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/build 1eaae25 link true /test build
idc-jenkins-ci-tidb/check_dev 1eaae25 link true /test check-dev
idc-jenkins-ci-tidb/mysql-test 1eaae25 link true /test mysql-test
idc-jenkins-ci-tidb/check_dev_2 1eaae25 link true /test check-dev2
pull-mysql-client-test 1eaae25 link true /test pull-mysql-client-test
pull-integration-ddl-test 1eaae25 link true /test pull-integration-ddl-test
idc-jenkins-ci-tidb/unit-test 1eaae25 link true /test unit-test
pull-br-integration-test 1eaae25 link true /test pull-br-integration-test
pull-lightning-integration-test 1eaae25 link true /test pull-lightning-integration-test
pull-integration-e2e-test 1eaae25 link true /test pull-integration-e2e-test
pull-integration-realcluster-test-next-gen 1eaae25 link true /test pull-integration-realcluster-test-next-gen
pull-unit-test-next-gen 1eaae25 link true /test pull-unit-test-next-gen

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants