Skip to content

Commit 597d268

Browse files
committed
Warn if the metadata’s connection string matches the destination’s.
1 parent 4c12866 commit 597d268

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

main/migration_verifier.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,24 @@ func handleArgs(ctx context.Context, cCtx *cli.Context) (*verifier.Verifier, err
222222
if err != nil {
223223
return nil, err
224224
}
225-
err = v.SetDstURI(ctx, cCtx.String(dstURI))
225+
226+
dstConnStr := cCtx.String(dstURI)
227+
err = v.SetDstURI(ctx, dstConnStr)
226228
if err != nil {
227229
return nil, err
228230
}
229-
err = v.SetMetaURI(ctx, cCtx.String(metaURI))
231+
232+
metaConnStr := cCtx.String(metaURI)
233+
err = v.SetMetaURI(ctx, metaConnStr)
230234
if err != nil {
231235
return nil, err
232236
}
237+
238+
if dstConnStr == metaConnStr {
239+
v.GetLogger().Warn().
240+
Msg("Storing migration-verifier’s metadata on the destination can significantly impede performance. Use a dedicated cluster for the metadata if you can.")
241+
}
242+
233243
v.SetServerPort(cCtx.Int(serverPort))
234244
v.SetNumWorkers(cCtx.Int(numWorkers))
235245
v.SetGenerationPauseDelay(time.Duration(cCtx.Int64(generationPauseDelay)) * time.Millisecond)

0 commit comments

Comments
 (0)