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
Make lock granted time be consistent with date executed time. Modify listLocks message. LB-2126 #2217
Conversation
Enhance listLocks message LB-2126
➤ Erzsebet Carmean commented: Liquibase GitHub Build Tested: https://github.com/liquibase/liquibase/actions/runs/1468359672 ( https://github.com/liquibase/liquibase/actions/runs/1468359672|smart-link ) POSTGRES 12.6 (TZ Africa/Lusaka) Verify update-sql outputs INERT INTO databasechangeloglock with LOCKGRANTED = NOW(); PASS -- Lock Database Starting Liquibase at 15:10:30 (version [Core: LB-2126/794/648e2a/2021-11-16 18:55+0000, Pro: master/140/1edf3c/2021-11-16T16:02:23Z] #794 built at 2021-11-16 18:55+0000)
MySQL 5 (TZ +12:00) Verify list-locks outputs lock granted time in database’s time. PASS Starting Liquibase at 15:54:23 (version [Core: LB-2126/794/648e2a/2021-11-16 18:55+0000, Pro: master/140/1edf3c/2021-11-16T16:02:23Z] #794 built at 2021-11-16 18:55+0000)
Additional Notes Regarding Extent of Fix Liquibase list-locks sets the DATABASECHANGELOGLOCK.LOCKGRANTED = NOW(). This does result in list-locks displaying the database time IF the lock table was updated by a client session that did not override use of the database time zone in some manner. Please note that the timezone itself will not be displayed in the DATABASECHANGELOGLOCK.LOCKGRANTED column’s value. This fix addresses only the time/date of the insert Liquibase makes when a lock is created. |
Description
Changes all databases to use the database-based "now" SQL function rather than the client machine's now java code.
This makes it so that the times are always based on the database time and timezone vs. the more variable timezone and times of all the liquibase client machinese.
It also adds a note to the list-locks command to let users know how the date is computed.
Dev Handoff Notes (Internal Use)
Links
DATABASECHANGELOGLOCK
columnLOCKGRANTED
does not use timezone #2029 (https://datical.atlassian.net/browse/LB-2190))Testing
DATABASECHANGELOGLOCK
columnLOCKGRANTED
does not use timezone #2029Test Requirements (Internal Liquibase QA)
Test using Postgres and MySQL.
Manual Tests
now()
function to set the DATABASECHANGELOGLOCK.LOCKGRANTED value.Automated Tests
┆Issue is synchronized with this Jira Bug by Unito