From 7c31806bf59d25cf3cb9fd9b36f8a0746bb84a65 Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Sun, 21 Jan 2024 15:14:59 +0530 Subject: [PATCH 1/2] add check for rds replication --- flow/connectors/postgres/client.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flow/connectors/postgres/client.go b/flow/connectors/postgres/client.go index 371510adbb..0b87e84078 100644 --- a/flow/connectors/postgres/client.go +++ b/flow/connectors/postgres/client.go @@ -624,7 +624,12 @@ func (c *PostgresConnector) CheckReplicationPermissions(username string) error { } if !replicationRes { - return fmt.Errorf("postgres user does not have replication role") + // RDS case: check pg_settings for rds.logical_replication + var setting string + err := c.pool.QueryRow(c.ctx, "SELECT setting FROM pg_settings WHERE name = 'rds.logical_replication';").Scan(&setting) + if err != nil || setting != "on" { + return fmt.Errorf("postgres user does not have replication role") + } } // check wal_level From 05b32fb5086cbff2ecc27c9fa5d7e23139c343c2 Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Sun, 21 Jan 2024 17:07:37 +0530 Subject: [PATCH 2/2] fix synced at display --- ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx b/ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx index 5a635eee1e..24f4c2ac38 100644 --- a/ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx +++ b/ui/app/mirrors/edit/[mirrorId]/cdcDetails.tsx @@ -17,7 +17,13 @@ type props = { createdAt?: Date; }; function CdcDetails({ syncs, createdAt, mirrorConfig }: props) { - let lastSyncedAt = moment(syncs[0]?.endTime).fromNow(); + let lastSyncedAt = moment( + syncs.length > 1 + ? syncs[1]?.endTime + : syncs.length + ? syncs[0]?.startTime + : new Date() + ).fromNow(); let rowsSynced = syncs.reduce((acc, sync) => { if (sync.endTime !== null) { return acc + sync.numRows;