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 global variable tidb_slow_log_masking to control masking slow log query (#17637) #17694

Merged
merged 10 commits into from
Jun 6, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Jun 5, 2020

cherry-pick #17637 to release-4.0


Signed-off-by: crazycs crazycs520@gmail.com

What problem does this PR solve?

Issue Number: close #17463

This PR adds global variable tidb_slow_log_masking to control masking slow log query.

Such as below:

  1. Enable the tidb_slow_log_masking first.
 set @@global.tidb_slow_log_masking=1;
  1. Then, when TiDB record the slow log, it will masking the user data of SQL,
    just like SQL normalize, such as below:
# Time: 2020-06-03T18:28:39.886171+08:00
...
...
...
select count ( ? ) , sum ( query_time ) , digest from information_schema . cluster_slow_query where time >= ? and time < ? group by digest order by sum ( query_time ) desc;

The original SQL is:

select count(*), sum(query_time), digest from information_schema.CLUSTER_SLOW_QUERY where time >= '2020-03-05 20:55:00' and time < '2020-06-05 20:57:00' group by digest order by sum(query_time) desc;

What is changed and how it works?

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:

Check List

Tests

  • Unit test
  • Manual test

Side effects

  • No

Release note

  • add global variable tidb_slow_log_masking to control masking slow log query.

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 5, 2020

/run-all-tests

@crazycs520
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520
Copy link
Contributor

/run-all-tests

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520
Copy link
Contributor

/rebuild

@crazycs520
Copy link
Contributor

/run-all-tests

@crazycs520
Copy link
Contributor

/run-all-tests

@crazycs520
Copy link
Contributor

/run-unit-test

@zimulala zimulala added the status/can-merge Indicates a PR has been approved by a committer. label Jun 5, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 5, 2020

Sorry @zimulala, you don't have permission to trigger auto merge event on this branch.

@bb7133 bb7133 modified the milestones: v4.0.1, v4.0.2 Jun 6, 2020
@bb7133
Copy link
Member

bb7133 commented Jun 6, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 6, 2020

/run-all-tests

@bb7133 bb7133 added the status/LGT2 Indicates that a PR has LGTM 2. label Jun 6, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 6, 2020

@sre-bot merge failed.

@zz-jason
Copy link
Member

zz-jason commented Jun 6, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 6, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 6, 2020

@sre-bot merge failed.

@zz-jason
Copy link
Member

zz-jason commented Jun 6, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 6, 2020

/run-all-tests

@sre-bot sre-bot merged commit 57c1884 into pingcap:release-4.0 Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants