Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

br, tidb: Add backup and restore size for TiDB SQL brie task #27508

Merged
merged 7 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions br/pkg/task/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,10 @@ func RunBackup(c context.Context, g glue.Glue, cmdName string, cfg *BackupConfig
return errors.Trace(err)
}
}

g.Record(summary.BackupDataSize, metawriter.ArchiveSize())
archiveSize := metawriter.ArchiveSize()
g.Record(summary.BackupDataSize, archiveSize)
//backup from tidb will fetch a general Size issue https://github.com/pingcap/tidb/issues/27247
g.Record("Size", archiveSize)
failpoint.Inject("s3-outage-during-writing-file", func(v failpoint.Value) {
log.Info("failpoint s3-outage-during-writing-file injected, " +
"process will sleep for 3s and notify the shell to kill s3 service.")
Expand Down
4 changes: 4 additions & 0 deletions br/pkg/task/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ func RunRestore(c context.Context, g glue.Glue, cmdName string, cfg *RestoreConf
}
archiveSize := reader.ArchiveSize(ctx, files)
g.Record(summary.RestoreDataSize, archiveSize)
//restore from tidb will fetch a general Size issue https://github.com/pingcap/tidb/issues/27247
g.Record("Size", archiveSize)
restoreTS, err := client.GetTS(ctx)
if err != nil {
return errors.Trace(err)
Expand All @@ -277,6 +279,8 @@ func RunRestore(c context.Context, g glue.Glue, cmdName string, cfg *RestoreConf
TTL: utils.DefaultBRGCSafePointTTL,
ID: utils.MakeSafePointID(),
}
g.Record("BackupTS", restoreTS)
fengou1 marked this conversation as resolved.
Show resolved Hide resolved

// restore checksum will check safe point with its start ts, see details at
// https://github.com/pingcap/tidb/blob/180c02127105bed73712050594da6ead4d70a85f/store/tikv/kv.go#L186-L190
// so, we should keep the safe point unchangeable. to avoid GC life time is shorter than transaction duration.
Expand Down