Skip to content

Commit 29798aa

Browse files
committed
update with ccrs
1 parent 5b4bc26 commit 29798aa

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

cmd/pbm/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ func (app *pbmApp) buildReplayCmd() *cobra.Command {
889889
Use: "oplog-replay",
890890
Short: "Replay oplog",
891891
RunE: app.wrapRunE(func(cmd *cobra.Command, args []string) (fmt.Stringer, error) {
892-
return replayOplog(app.ctx, app.conn, app.pbm, replayOpts, app.node, app.pbmOutF)
892+
return replayOplog(app.ctx, app.conn, app.ccrsConn, app.pbm, replayOpts, app.node, app.pbmOutF)
893893
}),
894894
}
895895

cmd/pbm/oplog.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func (r oplogReplayResult) String() string {
4444
func replayOplog(
4545
ctx context.Context,
4646
conn connect.Client,
47+
ccrsConn connect.Client,
4748
pbm *sdk.Client,
4849
o replayOptions,
4950
node string,
@@ -106,7 +107,7 @@ func replayOplog(
106107
}
107108

108109
fmt.Print("Started.\nWaiting to finish")
109-
err = waitRestore(ctx, conn, m, node, defs.StatusDone, 0)
110+
err = waitRestore(ctx, conn, ccrsConn, m, node, defs.StatusDone, 0)
110111
if err != nil {
111112
if errors.Is(err, context.DeadlineExceeded) {
112113
err = errWaitTimeout

cmd/pbm/restore.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func runRestore(
183183
return nil, err
184184
}
185185
if o.extern && outf == outText {
186-
err = waitRestore(ctx, conn, m, node, defs.StatusCopyReady, tdiff)
186+
err = waitRestore(ctx, conn, ccrsConn, m, node, defs.StatusCopyReady, tdiff)
187187
if err != nil {
188188
return nil, errors.Wrap(err, "waiting for the `copyReady` status")
189189
}
@@ -209,7 +209,7 @@ func runRestore(
209209
typ = " physical restore.\nWaiting to finish"
210210
}
211211
fmt.Printf("Started%s", typ)
212-
err = waitRestore(ctx, conn, m, node, defs.StatusDone, tdiff)
212+
err = waitRestore(ctx, conn, ccrsConn, m, node, defs.StatusDone, tdiff)
213213
if err == nil {
214214
return restoreRet{
215215
Name: m.Name,
@@ -235,12 +235,13 @@ func runRestore(
235235
func waitRestore(
236236
ctx context.Context,
237237
conn connect.Client,
238+
ccrsConn connect.Client,
238239
m *restore.RestoreMeta,
239240
node string,
240241
status defs.Status,
241242
tskew int64,
242243
) error {
243-
ep, _ := config.GetEpoch(ctx, conn)
244+
ep, _ := config.GetEpoch(ctx, ccrsConn)
244245
l := log.FromContext(ctx).
245246
NewEvent(string(ctrl.CmdRestore), m.Backup, m.OPID, ep.TS())
246247
stg, err := util.GetStorage(ctx, conn, node, l)

0 commit comments

Comments
 (0)