-
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
add option: restrict rocksdb log file num #3259
add option: restrict rocksdb log file num #3259
Conversation
@@ -394,6 +394,7 @@ pub struct DbConfig { | |||
pub compaction_readahead_size: ReadableSize, | |||
pub info_log_max_size: ReadableSize, | |||
pub info_log_roll_time: ReadableDuration, | |||
pub info_log_keep_log_file_num: u64, |
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.
I think we can default to 10 * 1GB log files.
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.
ok
@@ -171,6 +171,7 @@ fn test_serde_custom_tikv_config() { | |||
compaction_readahead_size: ReadableSize::kb(1), | |||
info_log_max_size: ReadableSize::kb(1), | |||
info_log_roll_time: ReadableDuration::secs(12), | |||
info_log_keep_log_file_num: 1000, |
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.
You may want to use a different value than the default for the test.
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.
ok
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.
You need to change the config-template.toml
too.
Rest LGTM.
etc/config-template.toml
Outdated
# If specified with non-zero value, log file will be rolled | ||
# if it has been active longer than `log_file_time_to_roll`. | ||
# Default: 0 (disabled) | ||
# info-log-roll-time = "1s" |
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 should be the same as the default value.
/run-all-tests |
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
LGTM. Please also remember to file a PR in tidb-ansible repository, like this. |
* add option: restrict rocksdb log file num * add test case * tune default log size and num to 1GB * 10 * add rocksdb info log options to conf template * modify initial value in conf template
* add option: restrict rocksdb log file num * add test case * tune default log size and num to 1GB * 10 * add rocksdb info log options to conf template * modify initial value in conf template
What have you changed? (mandatory)
Add an option to DBConfig & RaftDBConfig to restrict the info log file num
What are the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
Write a test case
Does this PR affect documentation (docs/docs-cn) update? (mandatory)
No
Does this PR affect tidb-ansible update? (mandatory)
No