Bug 1260827 - Migrate times in the DB from EST to UTC
Summary: Migrate times in the DB from EST to UTC
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Database
Version: 4.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 5.0
Assignee: Jeff Fearn 🐞
QA Contact: Rony Gong 🔥
URL:
Whiteboard:
: 1260489 (view as bug list)
Depends On:
Blocks: 1095592
TreeView+ depends on / blocked
 
Reported: 2015-09-08 01:36 UTC by Will Thames
Modified: 2018-12-09 06:29 UTC (History)
3 users (show)

Fixed In Version: 5.0.3.rh3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-05 08:19:26 UTC
Embargoed:


Attachments (Terms of Use)

Description Will Thames 2015-09-08 01:36:36 UTC
Description of problem: 
Bugzilla database has no timezone information, and all timestamps are in EST/EDT.
This means that the DB server and the web server also need to be in EST/EDT which is a very bad server configuration (as timestamps go backwards during the switch back from daylight savings)


Version-Release number of selected component (if applicable):


How reproducible: Entirely


Steps to Reproduce:
1. Change web and DB servers to be non EST/EDT
2. Create a new bug or comment
3. See that the creation time does not match the actual time

Actual results:
Timestamps don't reflect reality

Expected results:
Web and DB server can be in any arbitrary timezone and timezone information is appropriately converted at storage and display time


Additional info:

Comment 1 Jason McDonald 2015-09-08 04:54:22 UTC
Notes for Development and QE:

* The Errata tool is very sensitive to timestamps in Bugzilla. The syncing process for bug data asks Bugzilla for a list of bug ID's for bugs that have changed since the last successful sync.  ET then fetches the detail of those bugs.  If the timestamps are not handled correctly, ET will either sync no bugs (which will block advisories from progressing in their lifecycle) or will sync far too many bugss (which will likely cause severe performance issues for ET).

* Bugzilla propagates bug data to Jira and Salesforce (SFDC).  Any timestamps in that data must be verified to propagate correctly.

* The yet-to-be-activated message bus integration include a timestamp in every message.  Once that code is switched on in production, ET will consume changes from the message bus rather than polling Bugzilla periodically. Inaccurate timestamps in those messages may have a similar impact on ET as described above.

* Other users run saved searches and RPC queries to ask for various types of changes that have occurred within a specific time window.  Some of those query results are used to drive critical business processes, such as triaging of security issues and RHEL bugs, so again those search results must be accurate.

* The rules engine makes use of timestamps in both displays and in the rollback function.  These must be verified to work correctly.

* Timestamps must also be verified to propagate to Teiid correctly.

Comment 2 Jason McDonald 2015-09-08 04:56:50 UTC
Note for SysOps:

* Any change to the system timezone of Bugzilla should be accompanied by a review of the start times of cron jobs.  Some of these were originally chosen to run outside peak usage periods to lessen their impact on performance.

Comment 3 Jason McDonald 2015-09-11 07:16:07 UTC
*** Bug 1260489 has been marked as a duplicate of this bug. ***

Comment 4 Jeff Fearn 🐞 2015-09-15 02:41:56 UTC
Suggest moving this to 5.x as it's an intrusive change and is likely to complicate the migration.

Comment 5 Jeff Fearn 🐞 2015-09-15 04:20:53 UTC
The task here is to change the timestamps from EST +4 to UTC, the web and database servers must all be using UTC as part o this change.

Comment 6 Rony Gong 🔥 2015-10-18 11:06:29 UTC
QA environment(bzperfweb01.app.qa) with version(4.4.10042-1, DB: psql)
Result: Pass
Steps:
1.Execute the scripts of this bug fix, 
2.Both change the timezone to 'UTC' in web and db server.
==>Check some bugs's creation_ts and comment_time keep same as before from web UI, I compare it with current production.
==>Create a new bug, add some comments and do some update to this bug. check that all operation time record right.

Comment 7 Jason McDonald 2015-10-19 07:30:36 UTC
How long did the script take to run in the QE environment?  This information will be useful for planning the deployment of this change.

Comment 8 Rony Gong 🔥 2015-10-19 07:49:20 UTC
(In reply to Jason McDonald from comment #7)
> How long did the script take to run in the QE environment?  This information
> will be useful for planning the deployment of this change.

I execute this script in bzperweb01 which db dumped from production in Fed 2015, it cost around 45 mins,  I will try it in the rdu environment which is closer to current production, and leave comment then.

Comment 10 Jeff Fearn 🐞 2016-04-18 05:13:01 UTC
Hi Rony, did you get the times from RDU?

Comment 11 Rony Gong 🔥 2016-04-18 08:18:51 UTC
(In reply to Jeff Fearn from comment #10)
> Hi Rony, did you get the times from RDU?

On Rdu, It cost 48m49s.
I shut down all web servers.

Comment 12 Jeff Fearn 🐞 2016-06-17 04:24:15 UTC
Moving this back to assigned as it's not been tested as part of the BZ 5 upgrade, or integrated in to the BZ 5 code base.

Comment 13 Jeff Fearn 🐞 2016-06-17 05:08:09 UTC
The server must be using UTC tiem zone, if you used the bugzilla 5 ansible repo to configure the server this should already be done.

e.g.

# ls -l /etc/localtime
lrwxrwxrwx. 1 root root 23 May 12 02:34 /etc/localtime -> /usr/share/zoneinfo/UTC

Script to run is bz5-ET2UTC.pl

Comment 14 Rony Gong 🔥 2016-06-21 02:35:33 UTC
This script cost almost 3 hours in qe test env(bz-web), and changed all time to 4 hours later, please confirm that this script mustn't applied to current BZ4.4 yet.

This script will only execute when BZ5 upgrade.


Note You need to log in before you can comment on or make changes to this bug.