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

server: set system_time_zone from systemTZ (#13934) #14086

Merged
merged 3 commits into from
Dec 17, 2019

Conversation

bb7133
Copy link
Member

@bb7133 bb7133 commented Dec 17, 2019

Cherry-pick #13934 without conflict.


What problem does this PR solve?

This PR tries to close #13894, by setting system variable system_time_zone from system_tz variable in mysql.tidb table.

What is changed and how it works?

A setSystemTimeZoneVariable() is added to server.NewServer(), which get the value of systemTZ from exported function GetSystemTZ()

Please notice that this PR doesn't change any other behavior: all time-related calculations are not affected.

Check List

Tests

  • Integration test
  • Manual test (add detailed scripts or steps below)
export TZ="Europe/London"
# Before the initial bootstrap of TiDB Server)

./bin/tidb-server
# TiDB bootstrapped and infer `systemTZ` from TZ environment variable.

tidb> select variable_value from mysql.tidb where variable_name = "system_tz"; 
+----------------+
| VARIABLE_VALUE |
+----------------+
| Europe/London  |
+----------------+
1 row in set (0.00 sec)

tidb> select @@system_time_zone;                                                  
+--------------------+
| @@system_time_zone |
+--------------------+
| Europe/London      |
+--------------------+
1 row in set (0.00 sec)

The scripts described in #13894 is also used for manual tests.

Code changes

  • Has exported function/method change

Side effects

  • NA

Related changes

  • Need to update the documentation

Release note

  • Fix the issue that system_time_zone is hard-coded as CST by setting this variable from system_tz in mysql.tidb table.

@bb7133 bb7133 force-pushed the bb7133/cp-13934-3.0 branch from 135d386 to 35771be Compare December 17, 2019 01:35
@zz-jason zz-jason requested a review from lysu December 17, 2019 02:31
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 17, 2019
Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@AilinKid AilinKid added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 17, 2019
@zz-jason zz-jason added the status/can-merge Indicates a PR has been approved by a committer. label Dec 17, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

Your auto merge job has been accepted, waiting for 13951

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

@bb7133 merge failed.

@jackysp
Copy link
Member

jackysp commented Dec 17, 2019

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Dec 17, 2019

/run-all-tests

@sre-bot sre-bot merged commit 9a103ef into pingcap:release-3.0 Dec 17, 2019
@bb7133 bb7133 deleted the bb7133/cp-13934-3.0 branch December 29, 2023 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/server status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants