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

The time zone of pods for automatic backup and manual backup cannot be set #2944

Closed
gejibin opened this issue Jul 15, 2020 · 5 comments · Fixed by #3034
Closed

The time zone of pods for automatic backup and manual backup cannot be set #2944

gejibin opened this issue Jul 15, 2020 · 5 comments · Fixed by #3034
Assignees
Labels
status/help-wanted Extra attention is needed
Milestone

Comments

@gejibin
Copy link

gejibin commented Jul 15, 2020

tidb实例的输出时间是北京时间,但是做手动备份和自动备份的时间是UTC时间。
The output time of the tidb instance log is Beijing time, but the time for manual backup and automatic backup is UTC time.

The log output time of the manual backup pod is UTC time:

kubectl logs backup-test-utc-backup-01-4bzpm -n gejb-test
Create rclone.conf file.
/tidb-backup-manager backup --namespace=gejb-test --backupName=test-utc-backup-01 --tikvVersion=v4.0.0
I0715 07:54:57.111015 1 backup.go:71] start to process backup gejb-test/test-utc-backup-01
I0715 07:54:57.142404 1 backup_status_updater.go:66] Backup: [gejb-test/test-utc-backup-01] updated successfully
I0715 07:54:57.180364 1 backup_status_updater.go:66] Backup: [gejb-test/test-utc-backup-01] updated successfully
I0715 07:54:57.183689 1 manager.go:183] cluster gejb-test/test-utc-backup-01 tikv_gc_life_time is 10m0s
I0715 07:54:57.189625 1 manager.go:247] set cluster gejb-test/test-utc-backup-01 tikv_gc_life_time to 72h success
I0715 07:54:57.189687 1 backup.go:68] Running br command with args: [backup full --storage=s3://tidb-dev/test-utc-backup-T01/ --s3.provider=ceph

The log output time of pd is Beijing time:

kubectl logs test-utc-001-pd-0 -n gejb-test
Name: test-utc-001-pd-0.test-utc-001-pd-peer.gejb-test.svc
Address 1: 10.233.95.95 test-utc-001-pd-0.test-utc-001-pd-peer.gejb-test.svc.cluster.local
nslookup domain test-utc-001-pd-0.test-utc-001-pd-peer.gejb-test.svc.svc success
starting pd-server ...
/pd-server --data-dir=/var/lib/pd --name=test-utc-001-pd-0 --peer-urls=http://0.0.0.0:2380 --advertise-peer-urls=http://test-utc-001-pd-0.test-utc-001-pd-peer.gejb-test.svc:2380 --client-urls=http://0.0.0.0:2379 --advertise-client-urls=http://test-utc-001-pd-0.test-utc-001-pd-peer.gejb-test.svc:2379 --config=/etc/pd/pd.toml --initial-cluster=test-utc-001-pd-0=http://test-utc-001-pd-0.test-utc-001-pd-peer.gejb-test.svc:2380
[2020/07/15 08:31:20.726 +00:00] [INFO] [util.go:50] ["Welcome to Placement Driver (PD)"]
[2020/07/15 08:31:20.726 +00:00] [INFO] [util.go:51] [PD] [release-version=v4.0.0]
[2020/07/15 08:31:20.726 +00:00] [INFO] [util.go:52] [PD] [edition=Community]
[2020/07/15 08:31:20.726 +00:00] [INFO] [util.go:53] [PD] [git-hash=56d4c3d2237f5bf6fb11a794731ed1d95c8020c2]
[2020/07/15 08:31:20.726 +00:00] [INFO] [util.go:54] [PD] [git-branch=heads/refs/tags/v4.0.0]
[2020/07/15 08:31:20.726 +00:00] [INFO] [util.go:55] [PD] [utc-build-time="2020-05-28 01:39:35"]
[2020/07/15 08:31:20.726 +00:00] [INFO] [metricutil.go:81] ["disable Prometheus push client"]

@DanielZhangQD DanielZhangQD added the status/help-wanted Extra attention is needed label Jul 16, 2020
@DanielZhangQD
Copy link
Contributor

Need to support setting Timezone for the following CRs or components:
TidbMonitor, Backup, Restore, BackupSchedule, Pump, admission-webhook, advanced-statefulset-controller

The TiKVGroup and TiDBGroup will be updated on #2240.

@DanielZhangQD
Copy link
Contributor

@gejibin Would you like to submit PR for this fix?

@DanielZhangQD DanielZhangQD added this to the v1.1.4 milestone Jul 16, 2020
@cofyc
Copy link
Contributor

cofyc commented Jul 16, 2020

You can change the timezone of your tidb-operator deployment, then cron spec used by BackupSchedule will be parsed in your specified timezone. This is almost the same as Kubernetes CronJob.

# timezone is the default system timzone
timezone: UTC

@DanielZhangQD
Copy link
Contributor

CronJob

Yes, it makes sense.

@cofyc
Copy link
Contributor

cofyc commented Jul 29, 2020

TODO

  • admission-webhook, advanced-statefulset-controller deployed via tidb-operator chart should honor .Values.timezone
  • backup-manager job should use the same timezone of tidb-controller-manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/help-wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants