Skip to content

Commit

Permalink
Add log indicating whether we are looking for a stop position or a CO…
Browse files Browse the repository at this point in the history
…PY COMPLETED
  • Loading branch information
notfelineit committed Feb 14, 2025
1 parent 67483b2 commit 7deb2ef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/internal/planetscale_edge_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,16 @@ func (p PlanetScaleEdgeDatabase) sync(ctx context.Context, syncMode string, tc *
tc.Position = ""
}

isFullSync := syncMode == "full"
vtgateReq := buildVStreamRequest(tabletType, s.Name, tc.Shard, tc.Keyspace, tc.Position, tc.LastKnownPk)
p.Logger.Log(LOGLEVEL_INFO, fmt.Sprintf("%sRequesting VStream with %+v", preamble, vtgateReq))

if isFullSync {
p.Logger.Log(LOGLEVEL_INFO, fmt.Sprintf("%sWill stop once COPY COMPLETED event is seen.", preamble))
} else {
p.Logger.Log(LOGLEVEL_INFO, fmt.Sprintf("%sWill stop once stop position [%+v] is found.", preamble, stopPosition))
}

c, err := vtgateClient.VStream(ctx, vtgateReq)

if err != nil {
Expand All @@ -287,7 +295,6 @@ func (p PlanetScaleEdgeDatabase) sync(ctx context.Context, syncMode string, tc *
keyspaceOrDatabase = ps.Database
}

isFullSync := syncMode == "full"
copyCompletedSeen := false
// Can finish sync once we've synced to the stop position, or finished the VStream COPY phase
canFinishSync := false
Expand Down

0 comments on commit 7deb2ef

Please sign in to comment.