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

Separate fatal.log from error.log #4351

Closed
fuzhe1989 opened this issue Mar 18, 2022 · 3 comments
Closed

Separate fatal.log from error.log #4351

fuzhe1989 opened this issue Mar 18, 2022 · 3 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/enhancement The issue or PR belongs to an enhancement.

Comments

@fuzhe1989
Copy link
Contributor

Enhancement

Fatal erros are that will cause process terminated. Fatal logs are used for outputing information of fatal errors.

Now TiFlash only has one kind of fatal logs: BaseDaemon will print logs when catch some signals and then exit. In the future we may have more kinds of fatal logs.

Fatal logs are different from normal error logs in that:

  1. They are more important and happen rarely, so fsync could be affordable.
  2. They could have different formats, e.g. do not escape \n, so that BaseDaemon can print the stacktrace in one log record.
@fuzhe1989 fuzhe1989 added type/enhancement The issue or PR belongs to an enhancement. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Mar 18, 2022
@fuzhe1989
Copy link
Contributor Author

Now the error.log already sets flush = true. This ensures we won't lose any error log, while also hurts the performance, since errors are not so rare.

@SchrodingerZhu
Copy link
Contributor

Now the error.log already sets flush = true. This ensures we won't lose any error log, while also hurts the performance, since errors are not so rare.

Does this ensure alloc free?

@fuzhe1989
Copy link
Contributor Author

@SchrodingerZhu IMO alloc free is an enhancement. Currently BaseDaemon will direclty use LOG_ERROR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants