Bug #82730 Documentation clarification on time zone support
Submitted: 25 Aug 2016 17:44 Modified: 29 Oct 2017 23:41
Reporter: Jeremy Tinley Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: timezone

[25 Aug 2016 17:44] Jeremy Tinley
Description:
The documentation listed here:
http://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html

is a bit misleading on what it means to set SYSTEM for the time zone. 

A user can easily get confused between "The system time zone. When the server starts, it attempts to determine the time zone of the host machine and uses it to set the system_time_zone system variable. The value does not change thereafter."

and then using SYSTEM for their default time zone, which incurs an OS call on every function that requires timezone calculation.

How to repeat:
Experience heavy mutex contention around tzset on Linux/glibc and then go read the documentation to understand why. One should not have to do perf or read source in this case.

Suggested fix:
Change:
"The initial value for time_zone is 'SYSTEM', which indicates that the server time zone is the same as the system time zone."

to

"The initial value for time_zone is 'SYSTEM', which indicates that the server time zone is the same as the system time zone. If set to 'SYSTEM', every MySQL function call that needs timezone calculation will make a libc call (which may be protected by a global mutex) to determine the current system timezone."
[25 Aug 2016 20:08] MySQL Verification Team
Thank you for the bug report.
[29 Oct 2017 23:41] Paul DuBois
Posted by developer:
 
Updated:
https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html
https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_time_zone