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

*: move config file option query-log-max-len to sysvar #34305

Merged
merged 19 commits into from
May 3, 2022

Conversation

espresso98
Copy link
Collaborator

What problem does this PR solve?

Issue Number: ref #33769

Problem Summary:

The option query-log-max-len has historically been a config option and tidb-query-log-max-len has existed as a session variable. Based on requirements from cloud & PM it should instead be a GLOBAL sysvar.

What is changed and how it works?

This PR converts the option query-log-max-len to a global (cluster-wide) sysvar tidb-query-log-max-len, and removes the config option and the session sysvar.

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 TiDB configuration file option `query-log-max-len` has been replaced by the global system variable `tidb-query-log-max-len`.  This change makes it easier to modify this setting on a cluster wide basis.

@espresso98 espresso98 requested a review from a team as a code owner April 27, 2022 20:42
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Apr 27, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • dveeden
  • morgo

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 Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 27, 2022
@sre-bot
Copy link
Contributor

sre-bot commented Apr 27, 2022

@espresso98
Copy link
Collaborator Author

Please review @morgo

@morgo morgo self-requested a review April 28, 2022 14:49
@morgo morgo added the compatibility-breaker Violation of forwards/backwards compatibility in a design-time piece. label Apr 29, 2022
@morgo
Copy link
Contributor

morgo commented Apr 29, 2022

LGTM, but please resolve conflicts :-)

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 29, 2022
@ti-chi-bot ti-chi-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 29, 2022
@ti-chi-bot ti-chi-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 30, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 2, 2022
@morgo morgo requested a review from dveeden May 2, 2022 13:57
Copy link
Contributor

@dveeden dveeden left a comment

Choose a reason for hiding this comment

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

sql> SET GLOBAL tidb_query_log_max_len=5;
Query OK, 0 rows affected (0.0047 sec)

sql> select sleep(id) from t1;
+-----------+
| sleep(id) |
+-----------+
|         0 |
+-----------+
1 row in set (5.0028 sec)
# Time: 2022-05-03T08:27:00.93426371+02:00
# Txn_start_ts: 432946339101278208
# User@Host: root[root] @ ::1 [::1]
# Conn_ID: 403
# Query_time: 5.002372906
# Parse_time: 0.000205323
# Compile_time: 0.000498304
# Rewrite_time: 0.000165694
# Optimize_time: 0.000127934
# Wait_TS: 0.000028787
# Cop_time: 0.000409313 Request_count: 1
# DB: test
# Is_internal: false
# Digest: 850922af8bcba539198bb9559d6e317af6768dbd53539fee0225f44600f68688
# Stats: t1:pseudo
# Num_cop_tasks: 1
# Cop_proc_avg: 0 Cop_proc_addr: store1
# Cop_wait_avg: 0 Cop_wait_addr: store1
# Mem_max: 539
# Prepared: false
# Plan_from_cache: false
# Plan_from_binding: false
# Has_more_results: false
# KV_total: 0
# PD_total: 0.000004407
# Backoff_total: 0
# Write_sql_response_total: 0.00000353
# Result_rows: 1
# Succ: true
# IsExplicitTxn: false
# Plan: tidb_decode_plan('hAPwkDAJM18zCTAJMQlzbGVlcChjYXN0KHRlc3QudDEuaWQsIGRvdWJsZSBCSU5BUlkpKS0+Q29sdW1uIzIJMQl0aW1lOjVzLCBsb29wczoyLCBDb25jdXJyZW5jeTpPRkYJMzgwIEJ5dGVzCU4vQQoxCTMxXzUJMAkxCWRhdGE6VGFibGVGdWxsU2Nhbl80CTEJdGkBUhgxOC4xwrVzHVhwY29wX3Rhc2s6IHtudW06IDEsIG1heDogMjc5LjkFK0Rwcm9jX2tleXM6IDAsIHJwY18RKQEMBaoUIDE5OC40BS54Y29wcl9jYWNoZV9oaXRfcmF0aW86IDAuMDB9CTE1OR20JDIJNDNfNAkxXzABnwGxiDp0MSwga2VlcCBvcmRlcjpmYWxzZSwgc3RhdHM6cHNldWRvASsIaWt2CbMAewV9EDE1My42BXwAbCUtKDB9CU4vQQlOL0EK')
# Plan_digest: e81eea3563158d75f62a9ce11cffdbdb995e1c92323448dbebc16f8f154e2c46
"selec"(len:24);

@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 3, 2022
@morgo
Copy link
Contributor

morgo commented May 3, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 0e6491a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 3, 2022
@hawkingrei
Copy link
Member

/run-mysql-test

@ti-chi-bot ti-chi-bot merged commit 698a4ff into pingcap:master May 3, 2022
@sre-bot
Copy link
Contributor

sre-bot commented May 3, 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-common-test 🟥 failed 1, success 10, total 11 10 min New failing
idc-jenkins-ci/integration-cdc-test 🟢 all 34 tests passed 25 min Existing passed
idc-jenkins-ci-tidb/sqllogic-test-2 🟢 all 28 tests passed 6 min 43 sec Existing passed
idc-jenkins-ci-tidb/common-test 🟢 all 12 tests passed 6 min 36 sec Existing passed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 6 min 30 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 6 min 17 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 6 min 10 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 5 min 16 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 4 min 10 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility-breaker Violation of forwards/backwards compatibility in a design-time piece. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.