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

Avoid using temporary storage of slow-log tailer #4340

Open
aylei opened this issue Jan 4, 2022 · 2 comments
Open

Avoid using temporary storage of slow-log tailer #4340

aylei opened this issue Jan 4, 2022 · 2 comments

Comments

@aylei
Copy link
Contributor

aylei commented Jan 4, 2022

Feature Request

Is your feature request related to a problem? Please describe:

Currently, the slow-log tailer requires the tidb-server output slow logs to a temporary dir and tail it to its STDOUT. However, this approach would consume ephemeral storage and may cause tidb-server being evicted under Disk Pressure.

Describe the feature you'd like:

Use pipe to transfer the slow log instead:

# tidb process
> mkfifo slow.log
> ./tidb-server --log-slow-query slow.log

# slow log tailer
> cat slow.log

Pipe does not consume any filesystem storage. We may lose slow logs if the tailer is abnormal, but this can hardly happen since the tailer is as simple as a single cat process.

Describe alternatives you've considered:

N/A

Teachability, Documentation, Adoption, Migration Strategy:

This would be change that requires rolling-restart of tidb-servers, if we think rolling-restarting tidb-servers should be avoided when upgrading tidb-operator, we can add an feature-gate and let the user enable is actively.

@DanielZhangQD
Copy link
Contributor

DanielZhangQD commented Jan 5, 2022

@aylei
Is mkfifo a good way to print the logs in a container?
What about we suggest using a PV for the slow log?

@yiduoyunQ
Copy link
Contributor

yiduoyunQ commented Jan 14, 2022

if #25716 to be fixed, is this still a potential problem?

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

No branches or pull requests

3 participants