Skip to content

Commit

Permalink
[cdc] always initialize childToParentRelIDMapping (#2369)
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal authored Dec 20, 2024
1 parent 61cd7db commit 8aee197
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,9 @@ func pullCore[Items model.Items](
if err != nil {
return err
}
var childToParentRelIDMap map[uint32]uint32
// only initialize the map if needed, escape hatch because custom publications may not have the right setting
if req.OverridePublicationName != "" || pgVersion < shared.POSTGRES_13 {
childToParentRelIDMap, err = GetChildToParentRelIDMap(ctx, c.conn, slices.Collect(maps.Keys(req.SrcTableIDNameMapping)))
if err != nil {
return fmt.Errorf("error getting child to parent relid map: %w", err)
}
childToParentRelIDMap, err := GetChildToParentRelIDMap(ctx, c.conn, slices.Collect(maps.Keys(req.SrcTableIDNameMapping)))
if err != nil {
return fmt.Errorf("error getting child to parent relid map: %w", err)
}

if err := c.MaybeStartReplication(ctx, slotName, publicationName, req.LastOffset, pgVersion); err != nil {
Expand Down

0 comments on commit 8aee197

Please sign in to comment.