Skip to content

Commit 35e09a2

Browse files
authored
br: Enhance stream restore logs (#53649)
close #53645, close #53648
1 parent b137425 commit 35e09a2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

br/pkg/task/stream.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,7 @@ func restoreStream(
12341234
totalSize uint64
12351235
checkpointTotalKVCount uint64
12361236
checkpointTotalSize uint64
1237+
currentTS uint64
12371238
mu sync.Mutex
12381239
startTime = time.Now()
12391240
)
@@ -1243,9 +1244,12 @@ func restoreStream(
12431244
} else {
12441245
totalDureTime := time.Since(startTime)
12451246
summary.Log("restore log success summary", zap.Duration("total-take", totalDureTime),
1246-
zap.Uint64("restore-from", cfg.StartTS), zap.Uint64("restore-to", cfg.RestoreTS),
1247-
zap.String("restore-from", stream.FormatDate(oracle.GetTimeFromTS(cfg.StartTS))),
1248-
zap.String("restore-to", stream.FormatDate(oracle.GetTimeFromTS(cfg.RestoreTS))),
1247+
zap.Uint64("source-start-point", cfg.StartTS),
1248+
zap.Uint64("source-end-point", cfg.RestoreTS),
1249+
zap.Uint64("target-end-point", currentTS),
1250+
zap.String("source-start", stream.FormatDate(oracle.GetTimeFromTS(cfg.StartTS))),
1251+
zap.String("source-end", stream.FormatDate(oracle.GetTimeFromTS(cfg.RestoreTS))),
1252+
zap.String("target-end", stream.FormatDate(oracle.GetTimeFromTS(currentTS))),
12491253
zap.Uint64("total-kv-count", totalKVCount),
12501254
zap.Uint64("skipped-kv-count-by-checkpoint", checkpointTotalKVCount),
12511255
zap.String("total-size", units.HumanSize(float64(totalSize))),
@@ -1280,7 +1284,6 @@ func restoreStream(
12801284
}
12811285
defer client.Close()
12821286

1283-
var currentTS uint64
12841287
if taskInfo != nil && taskInfo.RewriteTS > 0 {
12851288
// reuse the task's rewrite ts
12861289
log.Info("reuse the task's rewrite ts", zap.Uint64("rewrite-ts", taskInfo.RewriteTS))

0 commit comments

Comments
 (0)