Skip to content

Commit

Permalink
adding DROP MIRROR support for EventHub
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal committed Sep 20, 2023
1 parent c190013 commit eec1f1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions flow/connectors/eventhub/eventhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ func (c *EventHubConnector) SetupNormalizedTables(
}

func (c *EventHubConnector) SyncFlowCleanup(jobName string) error {
// TODO (kaushik): this has to be implemented for DROP PEER support.
panic("sync flow cleanup not implemented for event hub")
_, err := c.pgMetadata.pool.Exec(c.ctx, fmt.Sprintf("DROP SCHEMA IF EXISTS %s CASCADE",
metadataSchema))
return err
}
3 changes: 2 additions & 1 deletion flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,8 @@ func (c *PostgresConnector) PullFlowCleanup(jobName string) error {
return fmt.Errorf("error dropping publication: %w", err)
}

_, err = pullFlowCleanupTx.Exec(c.ctx, fmt.Sprintf("SELECT pg_drop_replication_slot('%s')", slotName))
_, err = pullFlowCleanupTx.Exec(c.ctx, `SELECT pg_drop_replication_slot(slot_name) FROM pg_replication_slots
WHERE slot_name=$1`, slotName)
if err != nil {
return fmt.Errorf("error dropping replication slot: %w", err)
}
Expand Down

0 comments on commit eec1f1a

Please sign in to comment.