Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pingcap/tidb into issue37187
Browse files Browse the repository at this point in the history
  • Loading branch information
Reminiscent committed Sep 22, 2022
2 parents 7b26599 + 4437590 commit 7af05a6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
3 changes: 2 additions & 1 deletion br/pkg/task/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 14 additions & 3 deletions executor/brie.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ type brieTaskInfo struct {
storage string
connID uint64
backupTS uint64
restoreTS uint64
archiveSize uint64
message string
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
7 changes: 5 additions & 2 deletions planner/core/planbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2925,14 +2925,17 @@ 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)

schema := newColumnsWithNames(5)
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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions roadmap.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 7af05a6

Please sign in to comment.