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

Reduce stack logging #10586

Closed
gregwebs opened this issue May 23, 2019 · 3 comments · Fixed by #12155
Closed

Reduce stack logging #10586

gregwebs opened this issue May 23, 2019 · 3 comments · Fixed by #12155
Assignees

Comments

@gregwebs
Copy link
Contributor

Feature Request

Make it possible to reduce the logging of stack traces

Problem

After upgrading TiDB, it is now logging lots of stack traces from warnings. This can make for a lot more data in the log collection pipeline.

Alternatives

Don't log warnings. This does fix my issue, but it creates another one!

Solutions

Solutions to reduce stack trace output

  • Only log the first line of the stack trace (at the warning level)
  • Reduce the directory path that gets logged (currently it includes /home/jenkins/workspace/release_tidb_2.1-ga/)

Releasing

It would be great

  • to see this change in a 2.1 release since it does seem like a change during the previous 2.1 releases
  • for PD and TiDB have uniform behavior for this
@nolouch
Copy link
Member

nolouch commented May 24, 2019

PTAL @lysu

@lysu lysu assigned lysu and unassigned nolouch May 25, 2019
@gregwebs
Copy link
Contributor Author

gregwebs commented Jun 6, 2019

@nolouch @lysu can we get pd and TiDB to agree on the behavior here?

My suggestion is

  • always log stack traces for panics
  • Don't ever log stack traces for warnings
  • Don't log stack traces for errors

Errors should have a way to trace an error. in PD I tried to start creating operational traces rather than stack traces. That is, one should be able to understand what operations are happening that lead up to the error. The stack trace is occasionally useful, but usually less useful than an operational trace

The error message itself or unique error codes (this is something we need!) are usually good enough to locate the source position of the error

@gregwebs
Copy link
Contributor Author

Actually, I am changing my mind: for now given our lack of error and operation codes, it may be best to log stack traces for errors for now. But I still think they should not be logged by default for warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants