Skip to content

Commit

Permalink
Ignore error for catalog monitor for EH (#369)
Browse files Browse the repository at this point in the history
CDC to Eventhub errors in SyncFlow with 'GetLastSyncBatchID not
supported for Eventhub', because in `flowable.go`'s `StartFlow` this
method is being called for catalog metrics.
Eventhub does not have this method implemented so we can just ignore the
error in this section and have sync ID in the metrics start from 0:
```Go
	if a.CatalogMirrorMonitor.IsActive() && len(records.Records) > 0 {
		syncBatchID, err := dest.GetLastSyncBatchID(input.FlowConnectionConfigs.FlowJobName)
		if err != nil && conn.Destination.Type != protos.DBType_EVENTHUB {
			return nil, err
		}
		....
	}
```
  • Loading branch information
Amogh-Bharadwaj authored Sep 1, 2023
1 parent 23ec4b2 commit 09f26f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (a *FlowableActivity) StartFlow(ctx context.Context, input *protos.StartFlo
}
if a.CatalogMirrorMonitor.IsActive() && len(records.Records) > 0 {
syncBatchID, err := dest.GetLastSyncBatchID(input.FlowConnectionConfigs.FlowJobName)
if err != nil {
if err != nil && conn.Destination.Type != protos.DBType_EVENTHUB {
return nil, err
}

Expand Down

0 comments on commit 09f26f3

Please sign in to comment.