Skip to content

Commit

Permalink
Fetch clone status always (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik authored Dec 12, 2023
1 parent 825dc3d commit f29deb4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
31 changes: 15 additions & 16 deletions flow/cmd/mirror_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,25 @@ func (h *FlowRequestHandler) CDCFlowStatus(
}

var initialCopyStatus *protos.SnapshotStatus
if config.DoInitialCopy {
cloneJobNames, err := h.getCloneTableFlowNames(ctx, req.FlowJobName)

cloneJobNames, err := h.getCloneTableFlowNames(ctx, req.FlowJobName)
if err != nil {
return nil, err
}

cloneStatuses := []*protos.QRepMirrorStatus{}
for _, cloneJobName := range cloneJobNames {
cloneStatus, err := h.QRepFlowStatus(ctx, &protos.MirrorStatusRequest{
FlowJobName: cloneJobName,
})
if err != nil {
return nil, err
}
cloneStatuses = append(cloneStatuses, cloneStatus)
}

cloneStatuses := []*protos.QRepMirrorStatus{}
for _, cloneJobName := range cloneJobNames {
cloneStatus, err := h.QRepFlowStatus(ctx, &protos.MirrorStatusRequest{
FlowJobName: cloneJobName,
})
if err != nil {
return nil, err
}
cloneStatuses = append(cloneStatuses, cloneStatus)
}

initialCopyStatus = &protos.SnapshotStatus{
Clones: cloneStatuses,
}
initialCopyStatus = &protos.SnapshotStatus{
Clones: cloneStatuses,
}

return &protos.CDCMirrorStatus{
Expand Down
4 changes: 2 additions & 2 deletions flow/connectors/utils/cdc_records/cdc_records_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (

const (
/** begin with in-memory store, and then switch to Pebble DB
when the number of stored records crosses 1M
when the number of stored records crosses 100k
**/
defaultNumRecordsSwitchThreshold = 1_000_000
defaultNumRecordsSwitchThreshold = 1_00_000
)

func encVal(val any) ([]byte, error) {
Expand Down

0 comments on commit f29deb4

Please sign in to comment.