-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
support rocksdb info log dir #1700
Conversation
src/bin/tikv-server.rs
Outdated
@@ -325,6 +325,13 @@ fn get_rocksdb_db_option(config: &toml::Value) -> RocksdbOptions { | |||
get_toml_int(config, "rocksdb.compaction-readahead-size", Some(0)); | |||
opts.set_compaction_readahead_size(compaction_readahead_size as u64); | |||
|
|||
let info_log_dir = get_toml_string(config, "rocksdb.info-log-dir", Some("".to_owned())); | |||
if !info_log_dir.is_empty() { | |||
opts.create_info_log(&info_log_dir).unwrap_or_else(|e| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to set log_file_time_to_roll
or max_log_file_size
rotate the LOG.
PTAL @zhangjinpeng1987 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# RocksDB info log directory, if set, RocksDB will save the log in `info-log-dir/LOG`. | ||
# info-log-dir = "" | ||
# Maximal size of the info log, if new info log will be created if size is large than it. | ||
# info-log-max-size = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be set even when info-log-dir is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
PTAL @BusyJay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Ping Yu <[email protected]>
We can use
info-log-dir
to let RocksDB save its log to other place, not in origin data storage path.But we should know that the log name is still LOG.
@andelf @BusyJay @zhangjinpeng1987