Skip to content

sessionctx: restore tidb_paging_size_bytes default to 0 - #70052

Merged
ti-chi-bot[bot] merged 1 commit into
pingcap:masterfrom
JmPotato:revert-paging-size-bytes-default-0
Jul 27, 2026
Merged

sessionctx: restore tidb_paging_size_bytes default to 0#70052
ti-chi-bot[bot] merged 1 commit into
pingcap:masterfrom
JmPotato:revert-paging-size-bytes-default-0

Conversation

@JmPotato

@JmPotato JmPotato commented Jul 24, 2026

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: ref #68085

Problem Summary:

#69868 changed the default of tidb_paging_size_bytes from 0 to 4 MiB. After further consideration, keep byte-budget paging opt-in by default to avoid surprising behavior changes for clusters that have not explicitly enabled this path. Operators can still set a non-zero value when needed.

What changed and how does it work?

  • Restore DefPagingSizeBytes / tidb_paging_size_bytes default from 4 MiB back to 0 (disabled).
  • Keep the comments that document:
    • when a non-zero value takes effect (Resource Control enabled and the active Resource Group is non-burstable);
    • the tested workload matrix and why 4 MiB is a good candidate when enabling the feature.
  • Update integration-test expectations for the initial and reset-to-default values.

This intentionally does not remove the SET_VAR hint support or the
scope documentation introduced around #69868.

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.

Restore the default of `tidb_paging_size_bytes` to `0` (byte-budget paging disabled). Set a non-zero value such as 4 MiB (4194304) to enable it for resource groups with limited burst.

Summary by CodeRabbit

  • Bug Fixes
    • Changed the default value of tidb_paging_size_bytes to 0, disabling byte-budget paging by default.
    • Byte-budget paging now applies only when Resource Control is enabled and the active resource group is non-burstable.

Keep the Resource Control scope notes and the tested 4 MiB guidance so
operators can still opt in explicitly, but leave byte-budget paging
disabled by default.

Signed-off-by: JmPotato <github@ipotato.me>
@ti-chi-bot ti-chi-bot Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/needs-linked-issue do-not-merge/needs-triage-completed and removed do-not-merge/needs-linked-issue do-not-merge/needs-triage-completed labels Jul 24, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

@YuhaoZhang00: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

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.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The default for tidb_paging_size_bytes changes from 4 MiB to 0, disabling byte-budget paging by default. Integration test expectations are updated for both default-reset checks.

Changes

Paging Default

Layer / File(s) Summary
Paging default and validation
pkg/sessionctx/vardef/tidb_vars.go, tests/integrationtest/r/sessionctx/setvar.result
Sets DefPagingSizeBytes to 0, updates its documentation, and changes reset-value expectations from 4194304 to 0.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • pingcap/tidb#68091: Introduces and propagates tidb_paging_size_bytes, which this change updates.
  • pingcap/tidb#69633: Adjusts when paging is forced to zero based on resource-group conditions.
  • pingcap/tidb#69868: Modifies the same variable and integration test expectations.

Suggested reviewers: qw4990, guo-shaoge, yudongusa, yuhaozhang00

Poem

I’m a rabbit hopping through the bytes,
Paging sleeps beneath moonlit nights.
Four MiB fades into zero,
Tests now cheer, “That’s the hero!”
🐇 Defaults rest where budgets cease.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: restoring the default of tidb_paging_size_bytes to 0.
Description check ✅ Passed The description matches the template with issue reference, problem summary, change details, checklist items, side effects, docs, and release note.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

JmPotato added a commit to JmPotato/docs-cn that referenced this pull request Jul 24, 2026
Sync with pingcap/tidb#70052: keep byte-budget paging disabled by
default, and note 4 MiB as a candidate value when explicitly enabling it.

Signed-off-by: JmPotato <github@ipotato.me>
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.9390%. Comparing base (0b84b15) to head (97cbc20).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #70052        +/-   ##
================================================
- Coverage   76.3266%   73.9390%   -2.3877%     
================================================
  Files          2041       2058        +17     
  Lines        559579     578881     +19302     
================================================
+ Hits         427108     428019       +911     
- Misses       131570     150506     +18936     
+ Partials        901        356       -545     
Flag Coverage Δ
integration 40.9763% <ø> (+1.2710%) ⬆️

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

Components Coverage Δ
dumpling 59.8807% <ø> (ø)
parser ∅ <ø> (∅)
br 47.4060% <ø> (-15.3154%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yudongusa yudongusa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please open a document PR on this.

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 24, 2026
@JmPotato

Copy link
Copy Markdown
Member Author

Please open a document PR on this.

Please take a look at pingcap/docs-cn#21752.

@ti-chi-bot

ti-chi-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rleungx, yudongusa, YuhaoZhang00

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

The pull request process is described here

Details 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 approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 27, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2026-07-24 15:06:08.175444212 +0000 UTC m=+1590154.211539288: ☑️ agreed by yudongusa.
  • 2026-07-27 05:14:04.80265169 +0000 UTC m=+1813830.838746756: ☑️ agreed by rleungx.

@ti-chi-bot
ti-chi-bot Bot merged commit 6bc5d4c into pingcap:master Jul 27, 2026
34 checks passed
@JmPotato
JmPotato deleted the revert-paging-size-bytes-default-0 branch July 27, 2026 07:22
@JmPotato

Copy link
Copy Markdown
Member Author

/cherry-pick release-nextgen-202603

@ti-chi-bot

Copy link
Copy Markdown
Member

@JmPotato: new pull request created to branch release-nextgen-202603: #70081.

Details

In response to this:

/cherry-pick release-nextgen-202603

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 ti-community-infra/tichi repository.

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

Labels

approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants