Skip to content
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

adding DROP MIRROR support for EventHub #402

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 1 addition & 2 deletions flow/connectors/postgres/postgres_cdc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,7 @@ func (suite *PostgresCDCTestSuite) TestErrorForTableNotExist() {
}

err = suite.connector.PullFlowCleanup(nonExistentFlowName)
suite.Errorf(err, "error dropping replication slot:"+
"ERROR: replication slot \"%s\" does not exist (SQLSTATE 42704)", nonExistentFlowName)
suite.Nil(err)

// creating table and the replication slots for it, and dropping before pull records.
_, err = suite.connector.pool.Exec(context.Background(),
Expand Down
Loading