Skip to content
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

*: add tidb_min_paging_size system variable #36107

Merged
merged 7 commits into from
Jul 13, 2022

Conversation

tiancaiamao
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #36106

Problem Summary:

Add a @@tidb_min_paging_size system variable so we can test and turning it.
This variable is not intend to be exposed for the user.
It's just for our internal testing.

What is changed and how it works?

Add a variable, so we can change MinPagingSize dynamically.
This facility makes our testing and turning process easier, we'll do some expirements to find the best default value.

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.

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 11, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • XuHuaiyu
  • xhebox

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.

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-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 11, 2022
@tiancaiamao tiancaiamao marked this pull request as ready for review July 11, 2022 14:30
@tiancaiamao tiancaiamao requested a review from a team as a code owner July 11, 2022 14:30
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 11, 2022
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 12, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jul 12, 2022

@tiancaiamao
Copy link
Contributor Author

Please review #36147 before this one.
I don't want this change mixed with a bug fix PR, so I seperate it into two.

@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 13, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 13, 2022
@@ -1673,6 +1674,10 @@ var defaultSysVars = []*SysVar{
metrics.ToggleSimplifiedMode(TiDBOptOn(s))
return nil
}},
{Scope: ScopeGlobal | ScopeSession, Name: TiDBMinPagingSize, Value: strconv.Itoa(DefMinPagingSize), Type: TypeUnsigned, MinValue: 1, MaxValue: paging.MaxPagingSize, SetSession: func(s *SessionVars, val string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

If it is only for testing, is it necessary to be a global variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, but I see some other variable use global | session, such as tidb_init_chunk_size, tidb_max_chunk_size

Copy link
Contributor

Choose a reason for hiding this comment

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

If you can not come up with a scenario of set global, then no. TiDBInitChunkSize is historical.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the benchbot, we can test with this:

python3 main.py gen-benchbot-case --email "[email protected]" --token 'tcmsp_XXX' --testbed_size "2xl" \
--bench_type sysbench --bench_sub_types "select_random_ranges" \
--duration=30m --threads 100 \
--arch amd64 \
--versions nightly \
--tidb_urls "http://fileserver.pingcap.net/download/builds/pingcap/tidb-check/pr/80b30c51fb509e267d1fca9ed5122b70ded1a172/centos7/tidb-server.tar.gz" \
--testbed_size "2xl" \
--tidb_configs "{prepared-plan-cache: {enabled: true}}" \
--tidb_globals "set global tidb_enable_paging = 1; set global tidb_min_paging_size = 128;" \
--tidb_globals "set global tidb_enable_paging = 1; set global tidb_min_paging_size = 256;" \
--tidb_globals "set global tidb_enable_paging = 1; set global tidb_min_paging_size = 512;" \
--tidb_globals "set global tidb_enable_paging = 0;"

--tidb_globals requires global variables @xhebox

@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 Jul 13, 2022
@tiancaiamao
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: caff4d7

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 13, 2022
@tiancaiamao
Copy link
Contributor Author

/run-mysql-test

@ti-chi-bot ti-chi-bot merged commit 0b427e1 into pingcap:master Jul 13, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Jul 13, 2022

TiDB MergeCI notify

🔴 Bad News! New failing [1] after this pr merged.
These new failed integration tests seem to be caused by the current PR, please try to fix these new failed integration tests, thanks!

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/integration-ddl-test 🟥 failed 1, success 5, total 6 7 min 52 sec New failing
idc-jenkins-ci/integration-cdc-test ✅ all 36 tests passed 25 min Fixed
idc-jenkins-ci-tidb/integration-common-test 🟢 all 11 tests passed 36 min Existing passed
idc-jenkins-ci-tidb/common-test 🟢 all 12 tests passed 15 min Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 5 min 41 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 5 min 31 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 5 min 22 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 3 min 21 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 2 min 52 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

joycse06 added a commit to joycse06/tidb that referenced this pull request Jul 13, 2022
* master: (27 commits)
  executor: parallel cancel mpp query (pingcap#36161)
  store/copr: adjust the cop cache admission process time for paging (pingcap#36157)
  log-backup: get can restored global-checkpoint-ts when support v3 checkpoint advance (pingcap#36197)
  executor: optimize cursor read point get by reading through pessimistic lock cache (pingcap#36149)
  *: add tidb_min_paging_size system variable (pingcap#36107)
  planner: handle the expected row count for pushed-down selection in mpp (pingcap#36195)
  *: support show ddl jobs for sub-jobs (pingcap#36168)
  table-filter: optimize table pattern message and unit tests (pingcap#36160)
  domain: fix unstable test TestAbnormalSessionPool (pingcap#36154)
  executor: check the error returned by `handleNoDelay` (pingcap#36105)
  log-backup: fix checkpoint display (pingcap#36166)
  store/mockstore/unistore: fix several issues of coprocessor paging in unistore (pingcap#36147)
  test: refactor restart test (pingcap#36174)
  ddl: support rename index and columns for multi-schema change (pingcap#36148)
  test: remove meaningless test and update bazel (pingcap#36136)
  planner: Reduce verbosity of logging unknown system variables (pingcap#36013)
  metrics/grafana: bring back the plan cache miss panel (pingcap#36081)
  ddl: implement table granularity DDL for SchemaTracker (pingcap#36077)
  *: bazel use jdk 17 (pingcap#36070)
  telemetry: add reviewer rule (pingcap#36084)
  ...
@tiancaiamao tiancaiamao deleted the min-paging-size branch July 14, 2022 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add a @@tidb_min_paging_size system variable for testing
5 participants