diff --git a/br/pkg/task/restore.go b/br/pkg/task/restore.go index 01d945939fc15..7dcdc1274413a 100644 --- a/br/pkg/task/restore.go +++ b/br/pkg/task/restore.go @@ -580,7 +580,8 @@ func RunRestore(c context.Context, g glue.Glue, cmdName string, cfg *RestoreConf TTL: utils.DefaultBRGCSafePointTTL, ID: utils.MakeSafePointID(), } - g.Record("BackupTS", restoreTS) + g.Record("BackupTS", backupMeta.EndVersion) + g.Record("RestoreTS", restoreTS) // 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 diff --git a/executor/brie.go b/executor/brie.go index c21432b654301..f26ae56aa32e4 100644 --- a/executor/brie.go +++ b/executor/brie.go @@ -102,6 +102,7 @@ type brieTaskInfo struct { storage string connID uint64 backupTS uint64 + restoreTS uint64 archiveSize uint64 message string } @@ -411,9 +412,17 @@ func (e *BRIEExec) Next(ctx context.Context, req *chunk.Chunk) error { req.AppendString(0, e.info.storage) req.AppendUint64(1, e.info.archiveSize) - req.AppendUint64(2, e.info.backupTS) - req.AppendTime(3, e.info.queueTime) - req.AppendTime(4, e.info.execTime) + switch e.info.kind { + case ast.BRIEKindBackup: + req.AppendUint64(2, e.info.backupTS) + req.AppendTime(3, e.info.queueTime) + req.AppendTime(4, e.info.execTime) + case ast.BRIEKindRestore: + req.AppendUint64(2, e.info.backupTS) + req.AppendUint64(3, e.info.restoreTS) + req.AppendTime(4, e.info.queueTime) + req.AppendTime(5, e.info.execTime) + } e.info = nil return nil } @@ -569,6 +578,8 @@ func (gs *tidbGlueSession) Record(name string, value uint64) { switch name { case "BackupTS": gs.info.backupTS = value + case "RestoreTS": + gs.info.restoreTS = value case "Size": gs.info.archiveSize = value } diff --git a/planner/core/planbuilder.go b/planner/core/planbuilder.go index 41d01c61cc983..14a9b169e5536 100644 --- a/planner/core/planbuilder.go +++ b/planner/core/planbuilder.go @@ -2925,7 +2925,7 @@ func buildCancelDDLJobsFields() (*expression.Schema, types.NameSlice) { return schema.col2Schema(), schema.names } -func buildBRIESchema() (*expression.Schema, types.NameSlice) { +func buildBRIESchema(kind ast.BRIEKind) (*expression.Schema, types.NameSlice) { longlongSize, _ := mysql.GetDefaultFieldLengthAndDecimal(mysql.TypeLonglong) datetimeSize, _ := mysql.GetDefaultFieldLengthAndDecimal(mysql.TypeDatetime) @@ -2933,6 +2933,9 @@ func buildBRIESchema() (*expression.Schema, types.NameSlice) { schema.Append(buildColumnWithName("", "Destination", mysql.TypeVarchar, 255)) schema.Append(buildColumnWithName("", "Size", mysql.TypeLonglong, longlongSize)) schema.Append(buildColumnWithName("", "BackupTS", mysql.TypeLonglong, longlongSize)) + if kind == ast.BRIEKindRestore { + schema.Append(buildColumnWithName("", "Cluster TS", mysql.TypeLonglong, longlongSize)) + } schema.Append(buildColumnWithName("", "Queue Time", mysql.TypeDatetime, datetimeSize)) schema.Append(buildColumnWithName("", "Execution Time", mysql.TypeDatetime, datetimeSize)) return schema.col2Schema(), schema.names @@ -3178,7 +3181,7 @@ func (b *PlanBuilder) buildSimple(ctx context.Context, node ast.StmtNode) (Plan, return nil, err } case *ast.BRIEStmt: - p.setSchemaAndNames(buildBRIESchema()) + p.setSchemaAndNames(buildBRIESchema(raw.Kind)) if raw.Kind == ast.BRIEKindRestore { err := ErrSpecificAccessDenied.GenWithStackByArgs("SUPER or RESTORE_ADMIN") b.visitInfo = appendDynamicVisitInfo(b.visitInfo, "RESTORE_ADMIN", false, err) diff --git a/roadmap.md b/roadmap.md index 39ba6eb5cda2d..bc7c2ba5cdafc 100644 --- a/roadmap.md +++ b/roadmap.md @@ -1,8 +1,10 @@ # TiDB Roadmap -This roadmap brings you what's coming in the 1-year future, so you can see the new features or improvements in advance, follow the progress, learn about the key milestones on the way, and give feedback as the development work goes on. +This roadmap brings you what's coming in the 1-year future, so you can see the new features or improvements in advance, follow the progress, learn about the key milestones on the way, and give feedback as the development work goes on. In the course of development, this roadmap is subject to change based on user needs and feedback. If you have a feature request or want to prioritize a feature, please file an issue on [GitHub](https://github.com/pingcap/tidb/issues). -In the course of development, this roadmap is subject to change based on user needs and feedback. If you have a feature request or want to prioritize a feature, please file an issue on [GitHub](https://github.com/pingcap/tidb/issues). +> **Safe harbor statement:** +> +> *Any unreleased features discussed or referenced in our documents, roadmaps, blogs, websites, press releases, or public statements that are not currently available ("unreleased features") are subject to change at our discretion and may not be delivered as planned or at all. Customers acknowledge that purchase decisions are solely based on features and functions that are currently available, and that PingCAP is not obliged to deliver aforementioned unreleased features as part of the contractual agreement unless otherwise stated.* ## TiDB kernel