Skip to content

Commit

Permalink
Clarify timezone issues in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Urmi Mustafi committed Oct 3, 2023
1 parent 62404fe commit 8648d34
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ protected interface CheckedFunction<T, R> {
Notes:
- Set `event_timestamp` default value to turn off timestamp auto-updates for row modifications which alters this col
in an unexpected way upon completing the lease
- Upon reading any timestamps from MySQL we convert the timezone from session (default) to UTC to consistently
use epoch-millis in UTC locally
- Upon using any timestamps from local we convert the timezone from UTC to session
- MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current
time zone for retrieval. https://dev.mysql.com/doc/refman/8.0/en/datetime.html
- Thus, for reading any timestamps from MySQL we convert the timezone from session (default) to UTC to always
use epoch-millis in UTC locally
- Similarly, for inserting/updating any timestamps we convert the timezone from UTC to session (as it will be
(interpreted automatically as session time zone) and explicitly set all timestamp columns to avoid using the
default auto-update/initialization values
- We desire millisecond level precision and denote that with `(3)` for the TIMESTAMP types
*/
private static final String CREATE_LEASE_ARBITER_TABLE_STATEMENT = "CREATE TABLE IF NOT EXISTS %s ("
Expand Down

0 comments on commit 8648d34

Please sign in to comment.