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

syncer: support configure time_zone for downstream db #3378

Closed
lichunzhu opened this issue Oct 11, 2021 · 4 comments · Fixed by #3253
Closed

syncer: support configure time_zone for downstream db #3378

lichunzhu opened this issue Oct 11, 2021 · 4 comments · Fixed by #3253
Assignees

Comments

@lichunzhu
Copy link
Contributor

Is your feature request related to a problem? Please describe

After pingcap/dm#1691 we deprecated time_zone variable for convenience.
However, sometimes we may need dm to execute dml in specific time_zone, for example, adding an extra column update_time datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP in downstream table.
In this case, update_time will always be a UTC format time. However, we may want a CST time.

Describe the feature you'd like

Support configure time_zone variable in task.yaml. This variable only takes effect for syncer.

Describe alternatives you've considered

Change column update_time's type from datetime to timestamp. But timestamp may not be used after 2038.

Teachability, Documentation, Adoption, Migration Strategy

No response

@lance6716
Copy link
Contributor

we can add it in session variables of config in my memory

@lichunzhu
Copy link
Contributor Author

we can add it in session variables of config in my memory

We'll forcibly reset this now https://github.com/pingcap/dm/blob/83f62ae85d9d150f55c442dd99cf2dc82a49337a/dm/config/task.go#L934

@glorv
Copy link
Contributor

glorv commented Oct 12, 2021

In order to solve this issue, I think we can change our default time_zone from UTC to the global time_zone of downstream cluster. BTW, we will reserve the time_zone setting in task config in case there are other special requirements.

@lichunzhu
Copy link
Contributor Author

In order to solve this issue, I think we can change our default time_zone from UTC to the global time_zone of downstream cluster. BTW, we will reserve the time_zone setting in task config in case there are other special requirements.

SGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants