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 option to keep large enough info logs in crash loop #5423
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Yi Wu <yiwu@pingcap.com>
CC @siying to chime in. |
My opinion is that, the feature itself is too specific. Even though crash loop is common among RocksDB users, it is still specific to how users use RocksDB. It's the application, not the library, owns the restarting a crashing service. The idea that smaller log files mean a log for crashing and larger ones didn't crash is not robust. Can we instead empower applications to handle everything by themselves? If it is helpful, we can add a function in RocksDB to provide a list of info log files, and before starting a DB, applications can choose to delete smaller files if they like. Also keep in mind that Logger is an open interface and you can plug in your own and do whatever you want there. |
Thanks for comment, and totally agree application should implement Logger to handle the use of logs. One thing is that right now both |
@yiwu-arbug I think it does make sense, though the interface is a little bit hard to determine. For the crash loop case, you don't need this, right? |
@siying I need to double check. I'm not sure if |
@yiwu-arbug it will, but here is a question: do you crash before this function starts, or after it finishes? |
@siying by "you don't need this", I mean, before opening the DB, you can check log files in the directory and delete them accordingly. |
@yiwu-arbug do we still plan to make progress on this? Or should we close? |
Summary:
In case application fall in crash loop, RocksDB generates a new info log file on each restart, and purge useful old logs even when
keep_log_file_num
is set. In these cases the new log files are usually small and useless for debugging. In such cases we can instead keep large enough info log files. Adding two new optionskeep_large_log_file_num
andlarge_info_log_size
for the purpose.Test Plan:
Run db_bench and kill manually, and observe large info logs are kept.