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

tikv-server: check TZ setting #1876

Merged
merged 5 commits into from
Jun 1, 2017
Merged

tikv-server: check TZ setting #1876

merged 5 commits into from
Jun 1, 2017

Conversation

andelf
Copy link
Contributor

@andelf andelf commented May 31, 2017

related: pingcap/tidb-ansible#20

If TZ is not set, tikv will stat(/etc/localtime) twice every logging operation.

ref: https://stackoverflow.com/questions/4554271/how-to-avoid-excessive-stat-etc-localtime-calls-in-strftime-on-linux

@siddontang
Copy link
Contributor

Do you use strace to check we don't stat too many /etc/localtime ?

@@ -269,6 +270,13 @@ fn check_system_config(config: &toml::Value) {
for e in util::config::check_kernel() {
warn!("{:?}", e);
}

if cfg!(windows) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean !cfg!(windows)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣 typo

if !cfg!(windows) {
if env::var("TZ").is_err() {
env::set_var("TZ", "/etc/localtime");
error!("environment variable `TZ` is missing, use `/etc/localtime`");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning is better.

@BusyJay
Copy link
Member

BusyJay commented May 31, 2017

LGTM

Copy link
Contributor

@siddontang siddontang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@siddontang siddontang merged commit 0b401da into master Jun 1, 2017
@siddontang siddontang deleted the tz-check branch June 1, 2017 01:25
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants