Skip to content

Commit

Permalink
adds logs for create qrep go function
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Dec 12, 2023
1 parent 7a6f2ae commit 21cd6ec
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions flow/cmd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"log/slog"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -244,6 +245,8 @@ func (h *FlowRequestHandler) CreateQRepFlow(
if req.CreateCatalogEntry {
err := h.createQrepJobEntry(ctx, req, workflowID)
if err != nil {
slog.Error("unable to create flow job entry",
slog.Any("error", err), slog.String("flowName", cfg.FlowJobName))
return nil, fmt.Errorf("unable to create flow job entry: %w", err)
}
}
Expand All @@ -258,6 +261,8 @@ func (h *FlowRequestHandler) CreateQRepFlow(
// hack to facilitate migrating from existing xmin sync
txid, err := strconv.ParseInt(postColon, 10, 64)
if err != nil {
slog.Error("invalid xmin txid for xmin rep",
slog.Any("error", err), slog.String("flowName", cfg.FlowJobName))
return nil, fmt.Errorf("invalid xmin txid for xmin rep: %w", err)
}
state.LastPartition.Range = &protos.PartitionRange{Range: &protos.PartitionRange_IntRange{IntRange: &protos.IntPartitionRange{Start: txid}}}
Expand All @@ -269,11 +274,15 @@ func (h *FlowRequestHandler) CreateQRepFlow(
}
_, err := h.temporalClient.ExecuteWorkflow(ctx, workflowOptions, workflowFn, cfg, state)
if err != nil {
slog.Error("unable to start QRepFlow workflow",
slog.Any("error", err), slog.String("flowName", cfg.FlowJobName))
return nil, fmt.Errorf("unable to start QRepFlow workflow: %w", err)
}

err = h.updateQRepConfigInCatalog(cfg)
if err != nil {
slog.Error("unable to update qrep config in catalog",
slog.Any("error", err), slog.String("flowName", cfg.FlowJobName))
return nil, fmt.Errorf("unable to update qrep config in catalog: %w", err)
}

Expand Down

0 comments on commit 21cd6ec

Please sign in to comment.