Why gh-ost set time_zone to UTC when applying DML events

オープン
#1,289 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 10 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go, mysql
領域
databases

調査の方向性

Go ソースの ApplyDMLEventQueries から始め、time_zone をどのように設定しているかを調べます。SYSTEM/Shanghai と timestamp の DML イベントを使って、報告された MySQL 5.7.26 のケースを再現し、その後、クエリで取得した値を比較します。合意された説明が得られ、動作が意図しないものである場合は、テスト済みの変更または期待されるタイムゾーンの動作に関するドキュメントが用意されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Env

  • gh-ost : 1.1.2
  • mysql : 5.7.26
    • time_zone: system(ShangHai)

Bug

Mysql server is configured with time_zone=system and the server's time zone is Shanghai. The problem I encountered was that during the gh-ost run, after the insert statement involved the timestamp time field was successfully inserted, when the data was queried again, the time field increased by 8 hours.

question

Looking at the source code, I found that time_zone = '+00:00' is defined in the ApplyDMLEventQueries function, which is equal to the UTC time zone. Because insert is written in UTCtime zone, but select is read in SYSTEM time zone, the time field is increased by 8 hours.

My question is why the UTC time zone is set when applying dml event instead of using the default time zone configuration?

image
主要言語
Go
スター
13.6k
フォーク
1.4k
平均マージ
9日 19時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/gh-ost のほかの issue

github/gh-ost の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。