-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAT-15970] Supporting HA across timezones
Summary: Issue with timezones not being stored in PG database so changing node timezone had weird effects on HA failovers. By storing the bigint directly we have no ambiguous conversion from pg timestamp to java timestamp and always rely on epoch millisecond time. Test Plan: Set up HA with active (A)/standby (B) on UTC Change standby (B) to America/Chicago Promote standby (B) Change new standby (A) from UTC to America/NewYork Promote standby (A) Reviewers: nsingh Reviewed By: nsingh Subscribers: sanketh, yugaware Differential Revision: https://phorge.dev.yugabyte.com/D41534
- Loading branch information
Showing
2 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ain/resources/db/migration/default_/common/V391__Alter_High_Availability_lastFailover.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Copyright (c) YugaByte, Inc. | ||
|
||
-- Change last_failover column from timestamp without tz to epoch time in ms | ||
ALTER TABLE high_availability_config | ||
ALTER COLUMN last_failover TYPE bigint | ||
USING (EXTRACT(EPOCH FROM last_failover) * 1000)::bigint; |