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

executor, server: reduce connect/disconnect log spam #19308

Merged
merged 9 commits into from Aug 25, 2020
Merged

executor, server: reduce connect/disconnect log spam #19308

merged 9 commits into from Aug 25, 2020

Conversation

ghost
Copy link

@ghost ghost commented Aug 19, 2020

What problem does this PR solve?

Issue Number: Part of #19053 (does not close issue)

Problem Summary:

Currently there is a lot of spam in the server error log related to client activity. This makes it hard to debug issues.

What is changed and how it works?

What's Changed:

This moves three Info log messages to be Debug messages instead:

  • New sessions connecting to the server
  • Sessions disconnecting from the server
  • Setting session variables (global remains unchanged as Info)

This reduces the log spam in an oltp scenario (without a connection pool) quite considerably.

Related changes

  • None

Check List

Tests

  • Manual test (add detailed scripts or steps below)

I compiled the binary and ran while true; do mysql -e 'select 1'; sleep 1; done; in a loop. It looks much better.

Side effects

  • Someone somewhere may rely on these log messages, and need to change their log file to debug. I think this is unlikely though.

Release note

  • The TiDB error log now reports client connect/disconnect activity only under debug level verbosity.

@ghost ghost self-requested a review as a code owner August 19, 2020 15:06
@ghost ghost requested review from XuHuaiyu and removed request for a team August 19, 2020 15:06
@ghost ghost added the sig/execution SIG execution label Aug 19, 2020
@ghost
Copy link
Author

ghost commented Aug 19, 2020

/rebuild

@ghost ghost changed the title executor, server: reduce log spam executor, server: reduce connect/disconnect log spam Aug 19, 2020
Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 20, 2020
Copy link
Member

@ngaut ngaut left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Aug 20, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Aug 20, 2020
@ngaut ngaut added the status/can-merge Indicates a PR has been approved by a committer. label Aug 20, 2020
@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 19248

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@nullnotnil merge failed.

@lysu
Copy link
Contributor

lysu commented Aug 20, 2020

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@nullnotnil merge failed.

@jackysp
Copy link
Member

jackysp commented Aug 24, 2020

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 19379

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@nullnotnil merge failed.

@zz-jason
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 19139
  • 19379
  • 19363
  • 19441

@zz-jason
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 19363
  • 19441
  • 18697
  • 19154
  • 19020
  • 19139
  • 19379
  • 19363

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@nullnotnil merge failed.

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@nullnotnil merge failed.

@zz-jason
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 19139
  • 19379

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #20321

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Sep 30, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@gregwebs
Copy link
Contributor

From a security standpoint the information that there is a new connection could be very valuable. In a normal thread pool based usage it wouldn't be that spammy.

I think we need to have log sections (tags) and the ability to configure which ones are captured. This would be under the tag "connection" which could be configured to only be shown at the debug level.

ti-srebot added a commit that referenced this pull request Oct 1, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ghost ghost deleted the reduce-log-spam branch October 20, 2020 03:18
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants